@@ -358,6 +358,8 @@ func.func @same_memref_load_multiple_stores(%producer : memref<32xf32>, %produce
358
358
return
359
359
}
360
360
361
+ // -----
362
+
361
363
#map = affine_map <()[s0 ] -> (s0 + 5 )>
362
364
#map1 = affine_map <()[s0 ] -> (s0 + 17 )>
363
365
@@ -391,3 +393,35 @@ func.func @memref_index_type() {
391
393
// PRODUCER-CONSUMER-MAXIMAL: return
392
394
return
393
395
}
396
+
397
+ // -----
398
+
399
+ #map = affine_map <(d0 ) -> (d0 )>
400
+ #map1 =affine_map <(d0 ) -> (d0 + 1 )>
401
+
402
+ // Test non-integer memory spaces.
403
+
404
+ // PRODUCER-CONSUMER-LABEL: func @non_int_memory_space
405
+ func.func @non_int_memory_space () {
406
+ %alloc = memref.alloc () : memref <256 x8 xf32 , #spirv.storage_class <StorageBuffer >>
407
+ affine.for %arg0 = 0 to 64 {
408
+ affine.for %arg1 = 0 to 8 {
409
+ %0 = affine.apply #map (%arg1 )
410
+ %1 = affine.load %alloc [%arg0 , %0 ] : memref <256 x8 xf32 , #spirv.storage_class <StorageBuffer >>
411
+ affine.store %1 , %alloc [%arg0 , %arg1 ] : memref <256 x8 xf32 , #spirv.storage_class <StorageBuffer >>
412
+ }
413
+ }
414
+ affine.for %arg0 = 16 to 32 {
415
+ affine.for %arg1 = 0 to 8 {
416
+ %0 = affine.apply #map (%arg1 )
417
+ %1 = affine.load %alloc [%arg0 , %0 ] : memref <256 x8 xf32 , #spirv.storage_class <StorageBuffer >>
418
+ affine.store %1 , %alloc [%arg0 , %arg1 ] : memref <256 x8 xf32 , #spirv.storage_class <StorageBuffer >>
419
+ }
420
+ }
421
+ // Fused nest.
422
+ // PRODUCER-CONSUMER-NEXT: memref.alloc()
423
+ // PRODUCER-CONSUMER-NEXT: memref.alloc()
424
+ // PRODUCER-CONSUMER-NEXT: affine.for %{{.*}} = 16 to 32
425
+ // PRODUCER-CONSUMER-NEXT: affine.for %{{.*}} = 0 to 8
426
+ return
427
+ }
0 commit comments