[PATCH] D99249: [PassManager] Run additional LICM before LoopRotate

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 10:34:20 PDT 2021


lebedev.ri marked 2 inline comments as done.
lebedev.ri added inline comments.


================
Comment at: llvm/lib/Passes/PassBuilder.cpp:579
   // TODO: Investigate promotion cap for O1.
   LPM1.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap));
   LPM1.addPass(SimpleLoopUnswitchPass());
----------------
thopre wrote:
> mkazantsev wrote:
> > Theroretically LICM should move all invariants out of loop, and loop rotation should not create any new invariants. Do we really need this again?
> Load of size >4 whose base pointer is derived from the `this` pointer fail the isSafeToExecuteUnconditionally() in LICM because the alignment of the `this` is 1.
> Theroretically LICM should move all invariants out of loop, and loop rotation should not create any new invariants. Do we really need this again?

I think the numbers speak for themselves, see 3'rd table in the description i just added
that shows improvements when going from `LICM before LoopRotate` to `LICM after LoopRotate`.
Especially, note the `licm.NumSunk` (+30%), and note that there was no such regression
when just moving the LICM to before LoopRotate.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99249



More information about the llvm-commits mailing list