[Mlir-commits] [mlir] [mlir][affine] Treat failed dependence checks conservatively (PR #211014)

Akimasa Watanuki llvmlistbot at llvm.org
Sat Aug 22 09:02:52 PDT 2026


================
@@ -0,0 +1,25 @@
+// RUN: mlir-opt %s -test-loop-permutation="permutation-map=1,0 check-validity=1" | FileCheck %s
+// RUN: mlir-opt %s -affine-loop-tile="tile-size=4" | FileCheck %s
+
+#dynamic_index = affine_map<()[s0, s1] -> (s0 * s1)>
+
+// Dependence analysis cannot represent the common semi-affine index. The
+// remaining indices carry a (1, -1) dependence, so both transforms must fail.
+// CHECK-LABEL: func.func @unknown_dependence
+func.func @unknown_dependence(
+    %A: memref<?x9x9xi32>, %B: memref<9x9xi32>,
+    %p: index, %q: index, %value: i32) {
+  // CHECK:      affine.for %[[I:.*]] = 1 to 8 {
+  // CHECK-NEXT:   affine.for %[[J:.*]] = 1 to 8 {
----------------
Men-cotton wrote:

```suggestion
  // CHECK:      affine.for %[[I:.*]] = 1 to 8
  // CHECK-NEXT:   affine.for %[[J:.*]] = 1 to 8
```

Nit: The trailing `{` characters are not needed to verify the loop order here. Could we omit them to keep these checks minimal? For details, please refer to https://mlir.llvm.org/getting_started/TestingGuide/#contributor-guidelines.

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


More information about the Mlir-commits mailing list