summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Passes/PassBuilder.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-10-01 05:24:51 +0000
committerDehao Chen <dehao@google.com>2017-10-01 05:24:51 +0000
commitd26dae0d34cf13daab871fcffa513c6dd96a15bb (patch)
treeebab447ed20bf788df4b4b11c3fd81c859b4d595 /llvm/lib/Passes/PassBuilder.cpp
parent0b9fbf97f0a5d5a4f6bd7d09aa1ec2fadae157bf (diff)
downloadbcm5719-llvm-d26dae0d34cf13daab871fcffa513c6dd96a15bb.tar.gz
bcm5719-llvm-d26dae0d34cf13daab871fcffa513c6dd96a15bb.zip
Separate the logic when handling indirect calls in SamplePGO ThinLTO compile phase and other phases.
Summary: In SamplePGO ThinLTO compile phase, we will not invoke ICP as it may introduce confusion to the 2nd annotation. This patch extracted that logic and makes it clearer before profile annotation. In the mean time, we need to make function importing process both inlined callsites as well as not promoted indirect callsites. Reviewers: tejohnson Reviewed By: tejohnson Subscribers: sanjoy, mehdi_amini, llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D38094 llvm-svn: 314619
Diffstat (limited to 'llvm/lib/Passes/PassBuilder.cpp')
-rw-r--r--llvm/lib/Passes/PassBuilder.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index c277b5b14e7..c9cc0c5ae38 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -555,7 +555,8 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
if (PGOOpt && !PGOOpt->SampleProfileFile.empty()) {
// Annotate sample profile right after early FPM to ensure freshness of
// the debug info.
- MPM.addPass(SampleProfileLoaderPass(PGOOpt->SampleProfileFile));
+ MPM.addPass(SampleProfileLoaderPass(PGOOpt->SampleProfileFile,
+ Phase == ThinLTOPhase::PreLink));
// Do not invoke ICP in the ThinLTOPrelink phase as it makes it hard
// for the profile annotation to be accurate in the ThinLTO backend.
if (Phase != ThinLTOPhase::PreLink)
OpenPOWER on IntegriCloud