[PATCH] D33382: [PartialInlining] introduce an internal option to add partial inlining pass in the pipeline (off by default for now)

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 09:42:18 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL303567: [PartialInlining] Add internal options to enable partial inlining in pass… (authored by davidxl).

Changed prior to commit:
  https://reviews.llvm.org/D33382?vs=99782&id=99783#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D33382

Files:
  llvm/trunk/lib/Passes/PassBuilder.cpp
  llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp


Index: llvm/trunk/lib/Passes/PassBuilder.cpp
===================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp
+++ llvm/trunk/lib/Passes/PassBuilder.cpp
@@ -150,6 +150,10 @@
 
 static cl::opt<unsigned> MaxDevirtIterations("pm-max-devirt-iterations",
                                              cl::ReallyHidden, cl::init(4));
+static cl::opt<bool>
+    RunPartialInlining("enable-npm-partial-inlining", cl::init(false),
+                       cl::Hidden, cl::ZeroOrMore,
+                       cl::desc("Run Partial inlinining pass"));
 
 static cl::opt<bool> EnableGVNHoist(
     "enable-npm-gvn-hoist", cl::init(false), cl::Hidden,
@@ -552,6 +556,11 @@
   // At this point, we expect to have canonical and simple IR which we begin
   // *optimizing* for efficient execution going forward.
 
+  // Run partial inlining pass to partially inline functions that have
+  // large bodies.
+  if (RunPartialInlining)
+    MPM.addPass(PartialInlinerPass());
+
   // Eliminate externally available functions now that inlining is over -- we
   // won't emit these anyways.
   MPM.addPass(EliminateAvailableExternallyPass());
Index: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -44,8 +44,12 @@
 using namespace llvm;
 
 static cl::opt<bool>
-RunLoopVectorization("vectorize-loops", cl::Hidden,
-                     cl::desc("Run the Loop vectorization passes"));
+    RunPartialInlining("enable-partial-inlining", cl::init(false), cl::Hidden,
+                       cl::ZeroOrMore, cl::desc("Run Partial inlinining pass"));
+
+static cl::opt<bool>
+    RunLoopVectorization("vectorize-loops", cl::Hidden,
+                         cl::desc("Run the Loop vectorization passes"));
 
 static cl::opt<bool>
 RunSLPVectorization("vectorize-slp", cl::Hidden,
@@ -516,6 +520,8 @@
   // pass manager that we are specifically trying to avoid. To prevent this
   // we must insert a no-op module pass to reset the pass manager.
   MPM.add(createBarrierNoopPass());
+  if (RunPartialInlining)
+    MPM.add(createPartialInliningPass());
 
   if (!DisableUnitAtATime && OptLevel > 1 && !PrepareForLTO &&
       !PrepareForThinLTO)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33382.99783.patch
Type: text/x-patch
Size: 2352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170522/7cae6e3f/attachment.bin>


More information about the llvm-commits mailing list