[PATCH] D137038: [NewPM][Pipeline] Add PipelineTuningOption to set inliner threshold

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 10:48:12 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG4fa328074efd: [NewPM][Pipeline] Add PipelineTuningOption to set inliner threshold (authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137038/new/

https://reviews.llvm.org/D137038

Files:
  llvm/include/llvm/Passes/PassBuilder.h
  llvm/lib/Passes/PassBuilderPipelines.cpp


Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -200,6 +200,7 @@
   LicmMssaNoAccForPromotionCap = SetLicmMssaNoAccForPromotionCap;
   CallGraphProfile = true;
   MergeFunctions = EnableMergeFunctions;
+  InlinerThreshold = -1;
   EagerlyInvalidateAnalyses = EnableEagerlyInvalidateAnalyses;
 }
 
@@ -719,7 +720,11 @@
 ModuleInlinerWrapperPass
 PassBuilder::buildInlinerPipeline(OptimizationLevel Level,
                                   ThinOrFullLTOPhase Phase) {
-  InlineParams IP = getInlineParamsFromOptLevel(Level);
+  InlineParams IP;
+  if (PTO.InlinerThreshold == -1)
+    IP = getInlineParamsFromOptLevel(Level);
+  else
+    IP = getInlineParams(PTO.InlinerThreshold);
   // For PreLinkThinLTO + SamplePGO, set hot-caller threshold to 0 to
   // disable hot callsite inline (as much as possible [1]) because it makes
   // profile annotation in the backend inaccurate.
Index: llvm/include/llvm/Passes/PassBuilder.h
===================================================================
--- llvm/include/llvm/Passes/PassBuilder.h
+++ llvm/include/llvm/Passes/PassBuilder.h
@@ -75,6 +75,9 @@
   /// false.
   bool MergeFunctions;
 
+  /// Tuning option to override the default inliner threshold.
+  int InlinerThreshold;
+
   // Experimental option to eagerly invalidate more analyses. This has the
   // potential to decrease max memory usage in exchange for more compile time.
   // This may affect codegen due to either passes using analyses only when


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137038.472693.patch
Type: text/x-patch
Size: 1624 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221102/6dd9da8e/attachment.bin>


More information about the llvm-commits mailing list