[llvm] Reland "[LTO] Run Argument Promotion before IPSCCP" (PR #111853)
    Hari Limaye via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Nov  5 06:31:05 PST 2024
    
    
  
================
@@ -1828,6 +1828,15 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
     MPM.addPass(PGOIndirectCallPromotion(
         true /* InLTO */, PGOOpt && PGOOpt->Action == PGOOptions::SampleUse));
 
+    // Promoting by-reference arguments to by-value exposes more constants to
+    // IPSCCP.
+    MPM.addPass(
+        createModuleToPostOrderCGSCCPassAdaptor(PostOrderFunctionAttrsPass()));
+    MPM.addPass(
+        createModuleToPostOrderCGSCCPassAdaptor(ArgumentPromotionPass()));
+    MPM.addPass(
+        createModuleToFunctionPassAdaptor(SROAPass(SROAOptions::ModifyCFG)));
----------------
hazzlim wrote:
No worries - I have updated to use a single CGSCCPassManager for FunctionAttrs and ArgPromo. 
https://github.com/llvm/llvm-project/pull/111853
    
    
More information about the llvm-commits
mailing list