[PATCH] D154205: [MachineLICM] Handle subloops

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 06:56:07 PDT 2023


jaykang10 added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineLICM.cpp:135
     // Exit blocks for CurLoop.
     SmallVector<MachineBasicBlock *, 8> ExitBlocks;
 
----------------
dmgreen wrote:
> jaykang10 wrote:
> > dmgreen wrote:
> > > Will ExitBlocks be incorrect now?
> > Ah, that is good point!
> > They are out-most loop's ExitBlocks.
> > Let me fix it.
> > Thanks for checking it.
> > 
> Could this use CurLoop->isLoopExiting(ExitBlocks) instead? It might be quicker for larger loops.
This function checks exit blocks which are outside loop and have predecessor inside loop.
isLoopExiting checks exiting blocks which are inside loop and have successor outside loop.
I think we need exit blocks here.
Let me try to keep the exit blocks for each loop in order to avoid re-calculation.


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

https://reviews.llvm.org/D154205



More information about the llvm-commits mailing list