summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2020-01-13 06:34:16 -0800
committerKazu Hirata <kazu@google.com>2020-01-13 07:59:42 -0800
commit6b686703e63f0e992438ce445cbe4b3e78b94ea4 (patch)
treeeffd97a2f7e276c493a1d87f0ed749db4b26f0a8 /llvm/lib
parente653d306ce90e5612796d8adce9eb34b1c10e85a (diff)
downloadbcm5719-llvm-6b686703e63f0e992438ce445cbe4b3e78b94ea4.tar.gz
bcm5719-llvm-6b686703e63f0e992438ce445cbe4b3e78b94ea4.zip
[Inlining] Add PreInlineThreshold for the new pass manager
Summary: This patch makes it easy to try out different preinlining thresholds with a command-line switch just like -preinline-threshold for the legacy pass manager. Reviewers: davidxl Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72618
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Passes/PassBuilder.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 953b688c7f8..b05ee0537eb 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -192,6 +192,11 @@ static cl::opt<bool>
cl::Hidden, cl::ZeroOrMore,
cl::desc("Run Partial inlinining pass"));
+static cl::opt<int> PreInlineThreshold(
+ "npm-preinline-threshold", cl::Hidden, cl::init(75), cl::ZeroOrMore,
+ cl::desc("Control the amount of inlining in pre-instrumentation inliner "
+ "(default = 75)"));
+
static cl::opt<bool>
RunNewGVN("enable-npm-newgvn", cl::init(false),
cl::Hidden, cl::ZeroOrMore,
@@ -575,8 +580,7 @@ void PassBuilder::addPGOInstrPasses(ModulePassManager &MPM, bool DebugLogging,
if (!isOptimizingForSize(Level) && !IsCS) {
InlineParams IP;
- // In the old pass manager, this is a cl::opt. Should still this be one?
- IP.DefaultThreshold = 75;
+ IP.DefaultThreshold = PreInlineThreshold;
// FIXME: The hint threshold has the same value used by the regular inliner.
// This should probably be lowered after performance testing.
OpenPOWER on IntegriCloud