summaryrefslogtreecommitdiff
path: root/lib/Passes/PassBuilder.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-08-10 05:10:32 +0000
committerDehao Chen <dehao@google.com>2017-08-10 05:10:32 +0000
commita3b8ce30a4f529175b6f723d6c622eb7e78b03b0 (patch)
treeeb99a32009c415602119a918783d0255f0828b92 /lib/Passes/PassBuilder.cpp
parent0302f3db41184435af0ba451755b515815c16306 (diff)
Revert part of r310296 to make it really NFC for instrumentation PGO.
Summary: Part of r310296 will disable PGOIndirectCallPromotion in ThinLTO backend if PGOOpt is None. However, as PGOOpt is not passed down to ThinLTO backend for instrumentation based PGO, that change would actually disable ICP entirely in ThinLTO backend, making it behave differently in instrumentation PGO mode. This change reverts that change, and only disable ICP there when it is SamplePGO. Reviewers: davidxl Reviewed By: davidxl Subscribers: sanjoy, mehdi_amini, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D36566 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310550 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Passes/PassBuilder.cpp')
-rw-r--r--lib/Passes/PassBuilder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Passes/PassBuilder.cpp b/lib/Passes/PassBuilder.cpp
index e5f6cb01d21..84fd98c7c4f 100644
--- a/lib/Passes/PassBuilder.cpp
+++ b/lib/Passes/PassBuilder.cpp
@@ -857,7 +857,7 @@ PassBuilder::buildThinLTODefaultPipeline(OptimizationLevel Level,
// look unreferenced and are removed.
// FIXME: move this into buildModuleSimplificationPipeline to merge the logic
// with SamplePGO.
- if (PGOOpt && !PGOOpt->ProfileUseFile.empty())
+ if (!PGOOpt || PGOOpt->SampleProfileFile.empty())
MPM.addPass(PGOIndirectCallPromotion(true /* InLTO */,
false /* SamplePGO */));