[Mlir-commits] [mlir] [mlir] Fix support for loop normalization with integer indices (PR #76566)
Arseniy Obolenskiy
llvmlistbot at llvm.org
Fri Dec 29 18:16:44 PST 2023
================
@@ -270,3 +270,28 @@ module attributes {transform.with_named_sequence} {
transform.yield
}
}
+
+// -----
+
+func.func @normalize_i32_loop() {
+ // CHECK: scf.for %arg0 = %c0_i32 to {{.*}} step %c1_i32 : i32
----------------
aobolensk wrote:
Done for lower bound, step and induction var. As for upper bound, it is hard to match, because it is calculated using a bunch of expressions that involve arith.ceildiv, arith.muli, because of coalescing algorithm (maybe do you have any suggestions on how to match it in a more proper way?). Also, there is no 2nd loop in the output, because two loops were coalesced.
Unfortunately, the normalization function is not exposed, so I use coalescing to check that normalization of the loop works. Without the patch I get:
```
error: unexpected error: 'scf.for' op failed to verify that all of {lowerBound, upperBound, step} have same type
```
on this test case
https://github.com/llvm/llvm-project/pull/76566
More information about the Mlir-commits
mailing list