[PATCH] D154205: [MachineLICM] Handle subloops

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 09:22:16 PDT 2023


jaykang10 added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineLICM.cpp:786
+        MachineBasicBlock *InnerMostLoopPreheader =
+            InnerMostLoop->getLoopPreheader();
+        if (CurLoop != InnerMostLoop && InnerMostLoopPreheader) {
----------------
nikic wrote:
> This is going to hoist to the inner-most preheader, but it may be that the instruction is invariant wrt a number of a loops (just not the outer-most one). Shouldn't we be going up the loop chain to find the highest invariant loop?
I wanted to check that this approach is acceptable first.
We can go up the loop chain. Let me update the code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154205



More information about the llvm-commits mailing list