Skip to content

Commit 05d8297

Browse files
committed
[MLIR] Add test for the fix
1 parent 2c217b2 commit 05d8297

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

mlir/test/Dialect/Affine/load-store.mlir

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,20 @@ func.func @test_prefetch(%arg0 : index, %arg1 : index) {
198198

199199
// -----
200200

201+
// Test with load affine map with same SSA name.
202+
func.func @test_load_same_ssa_name() {
203+
%0 = memref.alloc() : memref<10x10xf32>
204+
affine.for %i0 = 0 to 100 {
205+
%i2:2 = affine.delinearize_index %i0 into (10, 10) : index, index
206+
%1 = affine.load %0[%i2#0, %i2#1] : memref<10x10xf32>
207+
// CHECK: %{{.*}} = affine.load %{{.*}}[%{{.*}}, %{{.*}}] : memref<10x10xf32>
208+
affine.store %1, %0[%i2#0, %i2#1] : memref<10x10xf32>
209+
}
210+
return
211+
}
212+
213+
// -----
214+
201215
// Test with just loop IVs.
202216
func.func @vector_load_vector_store_iv() {
203217
%0 = memref.alloc() : memref<100x100xf32>

0 commit comments

Comments
 (0)