@@ -188,7 +188,29 @@ func.func @transfer_read_leading_dynamic_dims(
188
188
189
189
// -----
190
190
191
- // One of the dims to be flattened is dynamic - not supported ATM.
191
+ // The vector could be a non-contiguous slice of the input
192
+ // memref.
193
+
194
+ func.func @negative_transfer_read_dynamic_dim_to_flatten (
195
+ %mem : memref <4 x?x?x2 xi8 >) -> vector <2 x2 x2 xi8 > {
196
+
197
+ %c0 = arith.constant 0 : index
198
+ %cst = arith.constant 0 : i8
199
+ %res = vector.transfer_read %mem [%c0 , %c0 , %c0 , %c0 ], %cst :
200
+ memref <4 x?x?x2 xi8 >, vector <2 x2 x2 xi8 >
201
+ return %res : vector <2 x2 x2 xi8 >
202
+ }
203
+
204
+ // CHECK-LABEL: func.func @negative_transfer_read_dynamic_dim_to_flatten(
205
+ // CHECK-NOT: memref.collapse_shape
206
+ // CHECK-NOT: vector.shape_cast
207
+
208
+ // CHECK-128B-LABEL: func @negative_transfer_read_dynamic_dim_to_flatten(
209
+ // CHECK-128B-NOT: memref.collapse_shape
210
+
211
+ // -----
212
+
213
+ // Can flatten the righmost dynamic dimension
192
214
193
215
func.func @transfer_read_dynamic_dim_to_flatten (
194
216
%idx_1: index ,
@@ -464,8 +486,28 @@ func.func @transfer_write_leading_dynamic_dims(
464
486
// CHECK-128B: memref.collapse_shape
465
487
466
488
// -----
489
+
490
+ // The vector could be a non-contiguous slice of the input
491
+ // memref.
492
+
493
+ func.func @negative_transfer_write_dynamic_to_flatten (
494
+ %mem : memref <4 x?x?x2 xi8 >,
495
+ %vec : vector <2 x2 x2 xi8 >) {
496
+
497
+ %c0 = arith.constant 0 : index
498
+ vector.transfer_write %vec , %mem [%c0 , %c0 , %c0 , %c0 ]
499
+ : vector <2 x2 x2 xi8 >, memref <4 x?x?x2 xi8 >
500
+ return
501
+ }
467
502
468
- // One of the dims to be flattened is dynamic - not supported ATM.
503
+ // CHECK-LABEL: func.func @negative_transfer_write_dynamic_to_flatten(
504
+ // CHECK-NOT: memref.collapse_shape
505
+ // CHECK-NOT: vector.shape_cast
506
+
507
+ // CHECK-128B-LABEL: func @negative_transfer_write_dynamic_to_flatten(
508
+ // CHECK-128B-NOT: memref.collapse_shape
509
+
510
+ // -----
469
511
470
512
func.func @transfer_write_dynamic_to_flatten (
471
513
%idx_1: index ,
@@ -578,6 +620,8 @@ func.func @negative_out_of_bound_transfer_read(
578
620
579
621
// -----
580
622
623
+ // Can flatten the righmost dynamic dimension
624
+
581
625
func.func @negative_out_of_bound_transfer_write (
582
626
%mem : memref <?x4 x3 x2 xi8 , strided <[24 , 6 , 2 , 1 ], offset : ?>>, %vec : vector <1 x1 x3 x2 xi8 >) {
583
627
%c0 = arith.constant 0 : index
0 commit comments