summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Passes
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-07-26 15:01:20 +0000
committerDehao Chen <dehao@google.com>2017-07-26 15:01:20 +0000
commite90d0153ca51bcb5f131dd7c93abae6f2399f5c5 (patch)
tree03ec4caefcbf348f3d68a4aae2dc16ad7212fad6 /llvm/lib/Passes
parent6d8de5ce637d28ddffc168946362aa50ee585249 (diff)
downloadbcm5719-llvm-e90d0153ca51bcb5f131dd7c93abae6f2399f5c5.tar.gz
bcm5719-llvm-e90d0153ca51bcb5f131dd7c93abae6f2399f5c5.zip
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 llvm-svn: 309121
Diffstat (limited to 'llvm/lib/Passes')
-rw-r--r--llvm/lib/Passes/PassBuilder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 9e0cf27aa17..20fc475305a 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud