[llvm-branch-commits] [llvm] [LoopInterchange] Reject if inner loop IV has outer-variant step (PR #202751)

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jun 11 04:03:59 PDT 2026


================
@@ -1251,8 +1251,14 @@ bool LoopInterchangeLegality::checkInductionsAndReductions(Loop *OuterLoop) {
     for (PHINode &PHI : CurLoop->getHeader()->phis()) {
       InductionDescriptor ID;
       if (InductionDescriptor::isInductionPHI(&PHI, CurLoop, SE, ID)) {
-        if (CurLoop == InnerLoop)
+        if (CurLoop == InnerLoop) {
----------------
nikic wrote:

Just to double check, we only care about the loop directly nested inside OuterLoop here, not any of the loops inside InnerLoop? Those don't need a loop-invariant step?

https://github.com/llvm/llvm-project/pull/202751


More information about the llvm-branch-commits mailing list