6
6
///----------------------------------------------------------------------------------------
7
7
/// vector.transfer_read
8
8
/// [Pattern: FlattenContiguousRowMajorTransferReadPattern]
9
+ ///
10
+ /// NOTE: Scalable vectors are not supported
9
11
///----------------------------------------------------------------------------------------
10
12
11
13
func.func @transfer_read_dims_match_contiguous (
@@ -28,6 +30,22 @@ func.func @transfer_read_dims_match_contiguous(
28
30
// CHECK-128B-LABEL: func @transfer_read_dims_match_contiguous
29
31
// CHECK-128B: memref.collapse_shape
30
32
33
+ func.func @transfer_read_dims_match_contiguous_scalable (
34
+ %mem : memref <5 x4 x3 x2 xi8 , strided <[24 , 6 , 2 , 1 ], offset : ?>>) -> vector <5 x4 x3 x[2 ]xi8 > {
35
+
36
+ %c0 = arith.constant 0 : index
37
+ %cst = arith.constant 0 : i8
38
+ %res = vector.transfer_read %mem [%c0 , %c0 , %c0 , %c0 ], %cst :
39
+ memref <5 x4 x3 x2 xi8 , strided <[24 , 6 , 2 , 1 ], offset : ?>>, vector <5 x4 x3 x[2 ]xi8 >
40
+ return %res : vector <5 x4 x3 x[2 ]xi8 >
41
+ }
42
+
43
+ // CHECK-LABEL: func @transfer_read_dims_match_contiguous_scalable
44
+ // CHECK-NOT: memref.collapse_shape
45
+
46
+ // CHECK-128B-LABEL: func @transfer_read_dims_match_contiguous_scalable
47
+ // CHECK-128B-NOT: memref.collapse_shape
48
+
31
49
// -----
32
50
33
51
func.func @transfer_read_dims_match_contiguous_empty_stride (
@@ -259,6 +277,8 @@ func.func @transfer_read_non_contiguous_src(
259
277
///----------------------------------------------------------------------------------------
260
278
/// vector.transfer_write
261
279
/// [Pattern: FlattenContiguousRowMajorTransferWritePattern]
280
+ ///
281
+ /// NOTE: Scalable vectors are not supported
262
282
///----------------------------------------------------------------------------------------
263
283
264
284
func.func @transfer_write_dims_match_contiguous (
@@ -281,6 +301,22 @@ func.func @transfer_write_dims_match_contiguous(
281
301
// CHECK-128B-LABEL: func @transfer_write_dims_match_contiguous(
282
302
// CHECK-128B: memref.collapse_shape
283
303
304
+ func.func @transfer_write_dims_match_contiguous_scalable (
305
+ %mem : memref <5 x4 x3 x2 xi8 , strided <[24 , 6 , 2 , 1 ], offset : ?>>,
306
+ %vec : vector <5 x4 x3 x[2 ]xi8 >) {
307
+
308
+ %c0 = arith.constant 0 : index
309
+ vector.transfer_write %vec , %mem [%c0 , %c0 , %c0 , %c0 ] :
310
+ vector <5 x4 x3 x[2 ]xi8 >, memref <5 x4 x3 x2 xi8 , strided <[24 , 6 , 2 , 1 ], offset : ?>>
311
+ return
312
+ }
313
+
314
+ // CHECK-LABEL: func @transfer_write_dims_match_contiguous_scalable(
315
+ // CHECK-NOT: memref.collapse_shape
316
+
317
+ // CHECK-128B-LABEL: func @transfer_write_dims_match_contiguous_scalable
318
+ // CHECK-128B-NOT: memref.collapse_shape
319
+
284
320
// -----
285
321
286
322
func.func @transfer_write_dims_match_contiguous_empty_stride (
@@ -504,7 +540,11 @@ func.func @transfer_write_non_contiguous_src(
504
540
505
541
///----------------------------------------------------------------------------------------
506
542
/// [Pattern: DropUnitDimFromElementwiseOps]
543
+ ///
507
544
/// TODO: Move to a dedicated file - there's no "flattening" in the following tests
545
+ /// TODO: Potential duplication with tests from:
546
+ /// * "vector-dropleadunitdim-transforms.mlir"
547
+ /// * "vector-transfer-drop-unit-dims-patterns.mlir"
508
548
///----------------------------------------------------------------------------------------
509
549
510
550
func.func @fold_unit_dim_add_basic (%vec : vector <1 x8 xi32 >) -> vector <1 x8 xi32 > {
0 commit comments