[llvm] [LoopInterchange] Check all inner-exit LCSSA PHIs (PR #200860)
Madhur Amilkanthwar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 2 23:50:46 PDT 2026
================
@@ -1371,8 +1371,10 @@ areInnerLoopExitPHIsSupported(Loop *OuterL, Loop *InnerL,
// from the loop latch.
if (PHI.getNumIncomingValues() > 1)
return false;
+ // The reduction LCSSA PHI's store user is rewritten by reduction2Memory();
+ // skip its user-check but keep validating the remaining LCSSA PHIs.
----------------
madhur13490 wrote:
The PHIs iterated here are in `InnerL->getUniqueExitBlock()`, and as LoopInterchangePass runs as a LoopNestPass via the LoopPassManager, which guarantees `LoopSimplify` (thus the exit block has dedicated exits) and LCSSA. The earlier `getNumIncomingValues() > 1` condition in code further restricts to single-incoming PHIs. Under these preconditions every PHI we continue validating is an LCSSA PHI, so the wording "remaining LCSSA PHIs" is correct.
https://github.com/llvm/llvm-project/pull/200860
More information about the llvm-commits
mailing list