[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:43 PDT 2026


================
@@ -0,0 +1,54 @@
+; Non-reduction LCSSA PHIs in the inner-loop exit must still be validated
+; even when a reduction LCSSA PHI is present. Used to crash.
+;
+; RUN: opt < %s -passes=loop-interchange -loop-interchange-reduction-to-mem \
+; RUN:   -pass-remarks-missed=loop-interchange -pass-remarks-output=%t -S \
+; RUN:   | FileCheck -check-prefix=IR %s
+; RUN: FileCheck --input-file=%t %s
+
+; CHECK: --- !Missed
+; CHECK-NEXT: Pass:            loop-interchange
+; CHECK-NEXT: Name:            UnsupportedExitPHI
+; CHECK-NEXT: Function:        reduction_lcssa_with_non_phi_user
+; CHECK-NEXT: Args:
+; CHECK-NEXT:   - String:          Found unsupported PHI node in loop exit.
+
+ at A = common global [100 x [100 x i32]] zeroinitializer
+ at sum = common global [100 x i32] zeroinitializer
+
+; IR-LABEL: @reduction_lcssa_with_non_phi_user(
+; IR-NOT: split
----------------
madhur13490 wrote:

Thanks. updated the test.

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


More information about the llvm-commits mailing list