[llvm] [LoopInterchange] Swap preheader contents before rebuilding LCSSA (PR #218468)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 04:55:11 PDT 2026
================
@@ -0,0 +1,129 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -passes=loop-interchange -verify-loop-lcssa -S | FileCheck %s
+
+; A cross-level reduction (%acc) over the (j, i) pair, nested in an outer k loop
+; and guarded by an if, so the reduction seed %mul lives in a dedicated,
+; single-predecessor preheader of the j loop. When j and i interchange, the
+; reduction PHI moves to the new outer header and its seed edge references %mul.
+; The preheader-content swap must run before the LCSSA rebuild so that %mul is
+; relocated into the new outer preheader and dominates that edge; otherwise
+; formLCSSAForInstructions is handed dominance-broken IR.
+;
+; Generated from the following C (clang -O1 -fno-unroll-loops -S -emit-llvm):
----------------
nishant-sachdeva-amd wrote:
Accepted this. I followed another test `debug-info-intrinsic.ll` , and changed this line to
`; Generated with 'clang -O1 -fno-unroll-loops -S -emit-llvm'`
https://github.com/llvm/llvm-project/pull/218468
More information about the llvm-commits
mailing list