[PATCH] D105131: Change the phase ordering of SROA in the LTO to enable more cse opportunities

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 29 11:53:08 PDT 2021


lebedev.ri added a comment.

I have three comments:

1. I don't think we should do any old-pm specific changes. If this applies to the new-pm, then sure, old-pm can be changed to keep it in sync.
2. I'm not sure why this is LTO-specific. Why should this not apply to the regular pipeline?
3. I'm extremely unconvinced that simply moving SROA run like it is done in the patch now is okay.



================
Comment at: llvm/lib/Transforms/IPO/PassManagerBuilder.cpp:1084-1100
   // Optimize globals again if we ran the inliner.
   if (RunInliner)
     PM.add(createGlobalOptimizerPass());
   PM.add(createGlobalDCEPass()); // Remove dead functions.
 
   // If we didn't decide to inline a function, check to see if we can
   // transform it to pass arguments by value instead of by reference.
----------------
I may be reading this wrong, but to me it looks like we no longer do any SROA after running the inliner.
This function is called by `populateLTOPassManager()`, it does then call `addLateLTOOptimizationPasses()`,
but that one doesn't schedule any additional SROA runs.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105131



More information about the llvm-commits mailing list