summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-06-27 17:23:33 +0000
committerDehao Chen <dehao@google.com>2017-06-27 17:23:33 +0000
commit66131665c44c8d6d93204541fbc83bfe7466a47e (patch)
treed512c2b9055018d16d501820c8848208ea2f4f9b /llvm/lib/Transforms/IPO
parentd6f10a62c6db33cd7d99b850341684c94471bc3f (diff)
downloadbcm5719-llvm-66131665c44c8d6d93204541fbc83bfe7466a47e.tar.gz
bcm5719-llvm-66131665c44c8d6d93204541fbc83bfe7466a47e.zip
Enable ICP for AutoFDO.
Summary: AutoFDO should have ICP enabled. Reviewers: davidxl Reviewed By: davidxl Subscribers: sanjoy, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D34662 llvm-svn: 306429
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 087a8aa2c62..1a34eca2c5d 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -263,11 +263,12 @@ void PassManagerBuilder::populateFunctionPassManager(
// Do PGO instrumentation generation or use pass as the option specified.
void PassManagerBuilder::addPGOInstrPasses(legacy::PassManagerBase &MPM) {
- if (!EnablePGOInstrGen && PGOInstrUse.empty())
+ if (!EnablePGOInstrGen && PGOInstrUse.empty() && PGOSampleUse.empty())
return;
// Perform the preinline and cleanup passes for O1 and above.
// And avoid doing them if optimizing for size.
- if (OptLevel > 0 && SizeLevel == 0 && !DisablePreInliner) {
+ if (OptLevel > 0 && SizeLevel == 0 && !DisablePreInliner &&
+ PGOSampleUse.empty()) {
// Create preinline pass. We construct an InlineParams object and specify
// the threshold here to avoid the command line options of the regular
// inliner to influence pre-inlining. The only fields of InlineParams we
OpenPOWER on IntegriCloud