[llvm] [LoopInterchange] Swap preheader contents before rebuilding LCSSA (PR #218468)
Madhur Amilkanthwar via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 22:48:04 PDT 2026
================
@@ -0,0 +1,103 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -verify-dom-info -verify-loop-info -verify-scev -verify-loop-lcssa -S | FileCheck %s
+
+; A cross-inner/outer reduction over the (j,i) pair, nested inside an outer k
+; loop. The reduction seed %seed is defined in the pair's preheader. When j/i
+; interchange, the reduction PHI moves to the new outer header and its seed edge
+; references %seed. The preheader-content swap must run before the LCSSA rebuild
+; so that %seed is relocated into the new outer preheader and dominates the seed
+; edge; otherwise formLCSSAForInstructions is handed dominance-broken IR.
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define i64 @adv2(ptr %Arr) {
----------------
madhur13490 wrote:
Please have better name for the function. `adv2` does not convey anything.
https://github.com/llvm/llvm-project/pull/218468
More information about the llvm-commits
mailing list