Skip to content

Commit f2f9cdd

Browse files
authored
[MLIR] Add test fort #110518 cast-to-dyn_cast fix (#110563)
#110518 fixed assertion failures in `cast` introduced in #108450. Signed-off-by: Benoit Jacob <[email protected]>
1 parent f86526c commit f2f9cdd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

mlir/test/Dialect/Affine/canonicalize.mlir

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,3 +1514,22 @@ func.func @drop_single_loop_delinearize(%arg0 : index, %arg1 : index) -> index {
15141514
// CHECK: scf.for %[[IV:[a-zA-Z0-9]+]] =
15151515
// CHECK-NOT: affine.delinearize_index
15161516
// CHECK: "some_use"(%{{.+}}, %[[IV]])
1517+
1518+
// -----
1519+
1520+
// CHECK-LABEL: func @delinearize_non_induction_variable
1521+
func.func @delinearize_non_induction_variable(%arg0: memref<?xi32>, %i : index, %t0 : index, %t1 : index, %t2 : index) -> index {
1522+
%c1024 = arith.constant 1024 : index
1523+
%1 = affine.apply affine_map<(d0)[s0, s1, s2] -> (d0 + s0 + s1 * 64 + s2 * 128)>(%i)[%t0, %t1, %t2]
1524+
%2 = affine.delinearize_index %1 into (%c1024) : index
1525+
return %2 : index
1526+
}
1527+
1528+
// -----
1529+
1530+
// CHECK-LABEL: func @delinearize_non_loop_like
1531+
func.func @delinearize_non_loop_like(%arg0: memref<?xi32>, %i : index) -> index {
1532+
%c1024 = arith.constant 1024 : index
1533+
%2 = affine.delinearize_index %i into (%c1024) : index
1534+
return %2 : index
1535+
}

0 commit comments

Comments
 (0)