summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-12-14 16:49:28 +0000
committerDehao Chen <dehao@google.com>2016-12-14 16:49:28 +0000
commitcb61c94d87abb55ff00472266ea3fffce305f5bc (patch)
tree7a9622cb59c7d444fed2a3f919567b216d86d97d /llvm/lib/Transforms
parentfe2c2b082ff2cc3c9eb28d13407cc75e32c6cf6d (diff)
downloadbcm5719-llvm-cb61c94d87abb55ff00472266ea3fffce305f5bc.tar.gz
bcm5719-llvm-cb61c94d87abb55ff00472266ea3fffce305f5bc.zip
Create SampleProfileLoader pass in llvm instead of clang
Summary: We used to create SampleProfileLoader pass in clang. This makes LTO/ThinLTO unable to add this pass in the linker plugin. This patch moves the SampleProfileLoader pass creation from clang to llvm pass manager builder. Reviewers: tejohnson, davidxl, dnovillo Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D27743 llvm-svn: 289669
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 254a7461980..a663eedc4f4 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -383,6 +383,11 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
void PassManagerBuilder::populateModulePassManager(
legacy::PassManagerBase &MPM) {
+ if (!PGOSampleUse.empty()) {
+ MPM.add(createPruneEHPass());
+ MPM.add(createSampleProfileLoaderPass(PGOSampleUse));
+ }
+
// Allow forcing function attributes as a debugging and tuning aid.
MPM.add(createForceFunctionAttrsLegacyPass());
OpenPOWER on IntegriCloud