[llvm] [LoopInterchange] Forbid interchange when the dependency is confused (PR #78533)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 13 12:46:33 PDT 2024
================
@@ -0,0 +1,55 @@
+; REQUIRES: asserts
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -verify-dom-info -verify-loop-info \
+; RUN: -S -debug 2>&1 | FileCheck %s
+
+;; Test that a confused dependency in loop should prevent interchange in
+;; loops i and j.
+;;
+;; void test_deps() {
+;; for (int i = 0; i <= 3; i++)
+;; for (int j = 0; j <= 3; j++) {
+;; *f ^= 0x1000;
+;; c[j][i] = *f;
+;; }
+;; }
+
+
+; CHECK: Confused dependency between:
+; CHECK: store i32 %xor, ptr %arrayidx6, align 4
+; CHECK: %1 = load i32, ptr %0, align 4
+; CHECK-NOT: Loops interchanged.
+
+ at a = global i32 0, align 4
+ at f = global ptr @a, align 8
+ at c = global [4 x [4 x i32]] zeroinitializer, align 8
----------------
artagnon wrote:
Do these need to be globals? Can they not be passed as arguments to the function?
https://github.com/llvm/llvm-project/pull/78533
More information about the llvm-commits
mailing list