[PATCH] D72618: [Inlining] Add PreInlineThreshold for the new pass manager

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 06:35:54 PST 2020


kazu created this revision.
kazu added a reviewer: davidxl.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72618

Files:
  llvm/lib/Passes/PassBuilder.cpp


Index: llvm/lib/Passes/PassBuilder.cpp
===================================================================
--- llvm/lib/Passes/PassBuilder.cpp
+++ llvm/lib/Passes/PassBuilder.cpp
@@ -192,6 +192,11 @@
                        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 @@
   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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72618.237662.patch
Type: text/x-patch
Size: 1066 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200113/0856efb8/attachment.bin>


More information about the llvm-commits mailing list