[Mlir-commits] [mlir] [mlir][affine] Modify assertion into a user visible diagnostic (PR #136474)
Andrzej Warzyński
llvmlistbot at llvm.org
Tue Apr 29 12:14:01 PDT 2025
================
@@ -9,3 +9,34 @@ func.func @unparallel_loop_reduction_unsupported(%in: memref<256x512xf32>, %out:
}
return
}
+
+// -----
+
+#map = affine_map<(d0)[s0] -> (d0 mod s0)>
+#map1 = affine_map<(d0)[s0] -> (d0 floordiv s0)>
+
+func.func @iv_mapped_to_multiple_indices_unsupported(%arg0: index) -> memref<2x2xf32> {
+ %c2 = arith.constant 2 : index
+ %cst = arith.constant 1.0 : f32
+ %alloc = memref.alloc() : memref<2x2xf32>
+
+ affine.for %i = 0 to 4 {
+ %row = affine.apply #map1(%i)[%c2]
+ %col = affine.apply #map(%i)[%c2]
+ affine.store %cst, %alloc[%row, %col] : memref<2x2xf32>
+ }
+
+ return %alloc : memref<2x2xf32>
+ }
+
+// CHECK: #[[$ATTR_0:.+]] = affine_map<(d0)[s0] -> (d0 floordiv s0)>
+// CHECK: #[[$ATTR_1:.+]] = affine_map<(d0)[s0] -> (d0 mod s0)>
+
+// CHECK-LABEL: func.func @iv_mapped_to_multiple_indices_unsupported(
+// CHECK-SAME: %[[VAL_0:[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*]]: index) -> memref<2x2xf32> {
----------------
banach-space wrote:
I presume this was auto-generated by `generate-test-checks.py` - see [#128083](https://github.com/llvm/llvm-project/pull/128083).
I agree that, in most cases, this strictness is unnecessary, and I’ve effectively reverted that behavior in [#136721](https://github.com/llvm/llvm-project/pull/136721).
Btw, I'd like to make a few more improvements to `generate-test-checks.py` if time permits.
https://github.com/llvm/llvm-project/pull/136474
More information about the Mlir-commits
mailing list