Skip to content

Commit 9219d85

Browse files
committed
fixup! [mlir][vector] Refactor vector-transfer-flatten.mlir (nfc) (3/n)
Improve comments
1 parent f2a5ed4 commit 9219d85

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

mlir/test/Dialect/Vector/vector-transfer-flatten.mlir

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func.func @transfer_read_dims_mismatch_non_contiguous_non_zero_indices(
132132
// -----
133133

134134
/// The leading dynamic shapes don't affect whether this example is flattenable
135-
/// or not as those dynamic shapes are not candidates for flattening anyway.
135+
/// or not. Indeed, those dynamic shapes are not candidates for flattening anyway.
136136

137137
func.func @transfer_read_leading_dynamic_dims(
138138
%arg : memref<?x?x8x4xi8, strided<[?, 32, 4, 1], offset: ?>>,
@@ -141,7 +141,8 @@ func.func @transfer_read_leading_dynamic_dims(
141141

142142
%c0_i8 = arith.constant 0 : i8
143143
%c0 = arith.constant 0 : index
144-
%result = vector.transfer_read %arg[%idx_1, %idx_2, %c0, %c0], %c0_i8 {in_bounds = [true, true]} : memref<?x?x8x4xi8, strided<[?, 32, 4, 1], offset: ?>>, vector<8x4xi8>
144+
%result = vector.transfer_read %arg[%idx_1, %idx_2, %c0, %c0], %c0_i8 {in_bounds = [true, true]} :
145+
memref<?x?x8x4xi8, strided<[?, 32, 4, 1], offset: ?>>, vector<8x4xi8>
145146
return %result : vector<8x4xi8>
146147
}
147148

@@ -163,10 +164,9 @@ func.func @transfer_read_leading_dynamic_dims(
163164

164165
// -----
165166

166-
// The input memref has a dynamic trailing shape and hence is not flattened.
167-
// TODO: This case could be supported via memref.dim
167+
// One of the dims to be flattened is dynamic - not supported ATM.
168168

169-
func.func @transfer_read_dims_mismatch_non_zero_indices_trailing_dynamic_dim(
169+
func.func @negative_transfer_read_dynamic_dim_to_flatten(
170170
%idx_1: index,
171171
%idx_2: index,
172172
%m_in: memref<1x?x4x6xi32>) -> vector<1x2x6xi32> {
@@ -178,11 +178,11 @@ func.func @transfer_read_dims_mismatch_non_zero_indices_trailing_dynamic_dim(
178178
return %v : vector<1x2x6xi32>
179179
}
180180

181-
// CHECK-LABEL: func.func @transfer_read_dims_mismatch_non_zero_indices_trailing_dynamic_dim
181+
// CHECK-LABEL: func.func @negative_transfer_read_dynamic_dim_to_flatten
182182
// CHECK-NOT: memref.collapse_shape
183183
// CHECK-NOT: vector.shape_cast
184184

185-
// CHECK-128B-LABEL: func @transfer_read_dims_mismatch_non_zero_indices_trailing_dynamic_dim
185+
// CHECK-128B-LABEL: func @negative_transfer_read_dynamic_dim_to_flatten
186186
// CHECK-128B-NOT: memref.collapse_shape
187187

188188
// -----
@@ -377,8 +377,8 @@ func.func @transfer_write_dims_mismatch_non_contiguous_non_zero_indices(
377377

378378
// -----
379379

380-
// The leading dynamic shapes don't affect whether this example is flattenable
381-
// or not as those dynamic shapes are not candidates for flattening anyway.
380+
/// The leading dynamic shapes don't affect whether this example is flattenable
381+
/// or not. Indeed, those dynamic shapes are not candidates for flattening anyway.
382382

383383
func.func @transfer_write_leading_dynamic_dims(
384384
%vec : vector<8x4xi8>,
@@ -387,7 +387,8 @@ func.func @transfer_write_leading_dynamic_dims(
387387
%idx_2 : index) {
388388

389389
%c0 = arith.constant 0 : index
390-
vector.transfer_write %vec, %arg[%idx_1, %idx_2, %c0, %c0] {in_bounds = [true, true]} : vector<8x4xi8>, memref<?x?x8x4xi8, strided<[?, 32, 4, 1], offset: ?>>
390+
vector.transfer_write %vec, %arg[%idx_1, %idx_2, %c0, %c0] {in_bounds = [true, true]} :
391+
vector<8x4xi8>, memref<?x?x8x4xi8, strided<[?, 32, 4, 1], offset: ?>>
391392
return
392393
}
393394

@@ -407,10 +408,9 @@ func.func @transfer_write_leading_dynamic_dims(
407408

408409
// -----
409410

410-
// The input memref has a dynamic trailing shape and hence is not flattened.
411-
// TODO: This case could be supported via memref.dim
411+
// One of the dims to be flattened is dynamic - not supported ATM.
412412

413-
func.func @transfer_write_dims_mismatch_non_zero_indices_trailing_dynamic_dim(
413+
func.func @negative_transfer_write_dynamic_to_flatten(
414414
%idx_1: index,
415415
%idx_2: index,
416416
%vec : vector<1x2x6xi32>,
@@ -423,11 +423,11 @@ func.func @transfer_write_dims_mismatch_non_zero_indices_trailing_dynamic_dim(
423423
return
424424
}
425425

426-
// CHECK-LABEL: func.func @transfer_write_dims_mismatch_non_zero_indices_trailing_dynamic_dim(
426+
// CHECK-LABEL: func.func @negative_transfer_write_dynamic_to_flatten
427427
// CHECK-NOT: memref.collapse_shape
428428
// CHECK-NOT: vector.shape_cast
429429

430-
// CHECK-128B-LABEL: func @transfer_write_dims_mismatch_non_zero_indices_trailing_dynamic_dim(
430+
// CHECK-128B-LABEL: func @negative_transfer_write_dynamic_to_flatten
431431
// CHECK-128B-NOT: memref.collapse_shape
432432

433433
// -----

0 commit comments

Comments
 (0)