[llvm] [LoopInterchange] Reject interchange when a freeze would move or be cloned (PR #213309)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 02:20:27 PDT 2026


================
@@ -0,0 +1,135 @@
+; A freeze whose execution count changes under interchange can resample poison
+; and break the correlation shared by its uses. Reject that nest, but retain
+; interchange for an otherwise-identical profitable control.
+;
+; RUN: opt < %s -passes='loop(loop-interchange),print<loops>' \
+; RUN:     -cache-line-size=64 -disable-output 2>&1 \
+; RUN:     | FileCheck %s --check-prefix=LOOPS
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 \
+; RUN:     -pass-remarks-output=%t.yaml -disable-output
+; RUN: FileCheck %s --check-prefix=REMARK --input-file=%t.yaml
+; RUN: llvm-extract -S -func=outer_header_freeze %s -o %t.freeze
+; RUN: opt -S -passes=no-op-loopnest %t.freeze -o %t.noop
+; RUN: opt -S -passes=loop-interchange -cache-line-size=64 \
+; RUN:     %t.freeze -o %t.out
+; RUN: diff -u %t.noop %t.out
----------------
MattPD wrote:

Done. `freeze.ll` now uses the suggested RUN line, with checks generated by `update_test_checks.py`.

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


More information about the llvm-commits mailing list