@@ -360,10 +360,54 @@ func.func @fat_raw_buffer_cast_easy(%m: memref<8xi32>) -> memref<8xi32, #amdgpu.
360
360
// CHECK-SAME: cacheSwizzleStride(%{{[^)]*}})
361
361
// CHECK-SAME: boundsCheck(false)
362
362
// CHECK-SAME: resetOffset
363
- func.func @fat_raw_buffer_cast (%m: memref <8 xi32 , strided <[1 ], offset : ?>>, %validBytes: i32 , %cacheSwizzle: i14 ) -> memref <8 xi32 , strided <[ 1 ]>, #amdgpu.address_space <fat_raw_buffer >> {
363
+ func.func @fat_raw_buffer_cast (%m: memref <8 xi32 , strided <[1 ], offset : ?>>, %validBytes: i32 , %cacheSwizzle: i14 ) -> memref <8 xi32 , #amdgpu.address_space <fat_raw_buffer >> {
364
364
%ret = amdgpu.fat_raw_buffer_cast %m validBytes (%validBytes ) cacheSwizzleStride (%cacheSwizzle ) boundsCheck (false ) resetOffset
365
- : memref <8 xi32 , strided <[1 ], offset : ?>> to memref <8 xi32 , strided <[1 ]>, #amdgpu.address_space <fat_raw_buffer >>
366
- func.return %ret : memref <8 xi32 , strided <[1 ]>, #amdgpu.address_space <fat_raw_buffer >>
365
+ : memref <8 xi32 , strided <[1 ], offset : ?>> to memref <8 xi32 , #amdgpu.address_space <fat_raw_buffer >>
366
+ func.return %ret : memref <8 xi32 , #amdgpu.address_space <fat_raw_buffer >>
367
+ }
368
+
369
+ // CHECK-LABEL: func @fat_raw_buffer_cast_dynamic_1d_reset_offset
370
+ // CHECK: amdgpu.fat_raw_buffer_cast
371
+ func.func @fat_raw_buffer_cast_dynamic_1d_reset_offset (%m: memref <?xi32 , strided <[1 ], offset : ?>>) -> memref <?xi32 , #amdgpu.address_space <fat_raw_buffer >> {
372
+ %ret = amdgpu.fat_raw_buffer_cast %m resetOffset
373
+ : memref <?xi32 , strided <[1 ], offset : ?>> to memref <?xi32 , #amdgpu.address_space <fat_raw_buffer >>
374
+ func.return %ret : memref <?xi32 , #amdgpu.address_space <fat_raw_buffer >>
375
+ }
376
+
377
+ // CHECK-LABEL: func @fat_raw_buffer_cast_dynamic_0d_reset_offset
378
+ // CHECK: %[[ret:.+]] = amdgpu.fat_raw_buffer_cast
379
+ // CHECK: return %[[ret]]
380
+ func.func @fat_raw_buffer_cast_dynamic_0d_reset_offset (%m: memref <i32 , strided <[], offset : ?>>) -> memref <i32 , #amdgpu.address_space <fat_raw_buffer >> {
381
+ %ret = amdgpu.fat_raw_buffer_cast %m resetOffset
382
+ : memref <i32 , strided <[], offset : ?>> to memref <i32 , #amdgpu.address_space <fat_raw_buffer >>
383
+ func.return %ret : memref <i32 , #amdgpu.address_space <fat_raw_buffer >>
384
+ }
385
+
386
+ // CHECK-LABEL: func @fat_raw_buffer_cast_static_shape_2d_reset_offset
387
+ // CHECK: %[[ret:.+]] = amdgpu.fat_raw_buffer_cast
388
+ // CHECK: return %[[ret]]
389
+ func.func @fat_raw_buffer_cast_static_shape_2d_reset_offset (%m: memref <4 x4 xi32 , strided <[4 , 1 ], offset : ?>>) -> memref <4 x4 xi32 , #amdgpu.address_space <fat_raw_buffer >> {
390
+ %ret = amdgpu.fat_raw_buffer_cast %m resetOffset
391
+ : memref <4 x4 xi32 , strided <[4 , 1 ], offset : ?>> to memref <4 x4 xi32 , #amdgpu.address_space <fat_raw_buffer >>
392
+ func.return %ret : memref <4 x4 xi32 , #amdgpu.address_space <fat_raw_buffer >>
393
+ }
394
+
395
+ // CHECK-LABEL: func @fat_raw_buffer_cast_dynamic_2d_reset_offset
396
+ // CHECK: %[[ret:.+]] = amdgpu.fat_raw_buffer_cast
397
+ // CHECK: return %[[ret]]
398
+ func.func @fat_raw_buffer_cast_dynamic_2d_reset_offset (%m: memref <?x?xi32 , strided <[?, 1 ], offset : ?>>) -> memref <?x?xi32 , strided <[?, 1 ]>, #amdgpu.address_space <fat_raw_buffer >> {
399
+ %ret = amdgpu.fat_raw_buffer_cast %m resetOffset
400
+ : memref <?x?xi32 , strided <[?, 1 ], offset : ?>> to memref <?x?xi32 , strided <[?, 1 ]>, #amdgpu.address_space <fat_raw_buffer >>
401
+ func.return %ret : memref <?x?xi32 , strided <[?, 1 ]>, #amdgpu.address_space <fat_raw_buffer >>
402
+ }
403
+
404
+ // CHECK-LABEL: func @fat_raw_buffer_cast_noncontiguous_2d_reset_offset
405
+ // CHECK: %[[ret:.+]] = amdgpu.fat_raw_buffer_cast
406
+ // CHECK: return %[[ret]]
407
+ func.func @fat_raw_buffer_cast_noncontiguous_2d_reset_offset (%m: memref <4 x4 xi32 , strided <[8 , 1 ], offset : ?>>) -> memref <4 x4 xi32 , strided <[8 , 1 ]>, #amdgpu.address_space <fat_raw_buffer >> {
408
+ %ret = amdgpu.fat_raw_buffer_cast %m resetOffset
409
+ : memref <4 x4 xi32 , strided <[8 , 1 ], offset : ?>> to memref <4 x4 xi32 , strided <[8 , 1 ]>, #amdgpu.address_space <fat_raw_buffer >>
410
+ func.return %ret : memref <4 x4 xi32 , strided <[8 , 1 ]>, #amdgpu.address_space <fat_raw_buffer >>
367
411
}
368
412
369
413
// CHECK-LABEL: func @raw_buffer_load_f32_from_rank_1
0 commit comments