[PATCH] D151380: [ModuleInliner] Add two cgscc pass in module-inliner pipeline for simplication parity.

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 15:01:46 PDT 2023


mingmingl created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
mingmingl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

- This closes the gap between module inliner and scc inliner (0.25% on an internal workload)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151380

Files:
  llvm/lib/Passes/PassBuilderPipelines.cpp


Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -950,10 +950,20 @@
 
   MPM.addPass(ModuleInlinerPass(IP, UseInlineAdvisor, Phase));
 
+  MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(
+      PostOrderFunctionAttrsPass(/*SkipNonRecursive*/ true)));
+
+  if (Level == OptimizationLevel::O3)
+    MPM.addPass(
+        createModuleToPostOrderCGSCCPassAdaptor(ArgumentPromotionPass()));
+
   MPM.addPass(createModuleToFunctionPassAdaptor(
       buildFunctionSimplificationPipeline(Level, Phase),
       PTO.EagerlyInvalidateAnalyses));
 
+  MPM.addPass(
+      createModuleToPostOrderCGSCCPassAdaptor(PostOrderFunctionAttrsPass()));
+
   MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(
       CoroSplitPass(Level != OptimizationLevel::O0)));
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151380.525347.patch
Type: text/x-patch
Size: 914 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230524/ed7ab46f/attachment.bin>


More information about the llvm-commits mailing list