diff options
author | Dehao Chen <dehao@google.com> | 2017-07-26 15:01:20 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-07-26 15:01:20 +0000 |
commit | d2fb04a72a2a70415303e14e9d88437c0a257231 (patch) | |
tree | a9f2db5eaeb75eaa431cf0422abe1c6fbf573a23 /lib/Passes | |
parent | 0f1c53205c6876815220f39315cefb1968ad0d18 (diff) |
Make new PM honor -fdebug-info-for-profiling
Summary: The new PM needs to invoke add-discriminator pass when building with -fdebug-info-for-profiling.
Reviewers: chandlerc, davidxl
Reviewed By: chandlerc
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D35744
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Passes')
-rw-r--r-- | lib/Passes/PassBuilder.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Passes/PassBuilder.cpp b/lib/Passes/PassBuilder.cpp index 9e0cf27aa17..20fc475305a 100644 --- a/lib/Passes/PassBuilder.cpp +++ b/lib/Passes/PassBuilder.cpp @@ -535,6 +535,8 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, // Create an early function pass manager to cleanup the output of the // frontend. FunctionPassManager EarlyFPM(DebugLogging); + if (PGOOpt && PGOOpt->SamplePGOSupport) + EarlyFPM.addPass(AddDiscriminatorsPass()); EarlyFPM.addPass(SimplifyCFGPass()); EarlyFPM.addPass(SROA()); EarlyFPM.addPass(EarlyCSEPass()); |