Skip to content

Commit e9731a0

Browse files
committed
fixup! [mlir][vector] Update tests for collapse 1/n (nfc)
Fix failing test
1 parent 48c614f commit e9731a0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

mlir/test/Dialect/Vector/vector-transfer-collapse-inner-most-dims.mlir

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func.func @negative_scalable_unit_dim(%in: memref<1x1x8x1xf32, strided<[3072, 8,
6161
%0 = vector.transfer_read %in[%c0, %c0, %c0, %c0], %cst {in_bounds = [true, true, true]} : memref<1x1x8x1xf32, strided<[3072, 8, 1, 1], offset: ?>>, vector<1x8x[1]xf32>
6262
return %0 : vector<1x8x[1]xf32>
6363
}
64-
// CHECK-LABEL: func @scalable_unit_dim
64+
// CHECK-LABEL: func @negative_scalable_unit_dim
6565
// CHECK-NOT: memref.subview
6666
// CHECK-NOT: vector.shape_cast
6767

@@ -257,3 +257,16 @@ func.func @leading_scalable_dimension_transfer_write(%dest : memref<24x1xf32>, %
257257
// CHECK: %[[SUBVIEW:.+]] = memref.subview %[[DEST]][0, 0] [24, 1] [1, 1] : memref<24x1xf32> to memref<24xf32, strided<[1]>>
258258
// CHECK: %[[CAST:.+]] = vector.shape_cast %[[VEC]] : vector<[4]x1xf32> to vector<[4]xf32>
259259
// CHECK: vector.transfer_write %[[CAST]], %[[SUBVIEW]]{{.*}} {in_bounds = [true]} : vector<[4]xf32>, memref<24xf32, strided<[1]>>
260+
261+
// -----
262+
263+
// Negative test: [1] (scalable 1) is _not_ a unit dimension.
264+
func.func @trailing_scalable_one_dim_transfer_write(%dest : memref<24x1xf32>, %vec: vector<4x[1]xf32>, %index: index) {
265+
%c0 = arith.constant 0 : index
266+
vector.transfer_write %vec, %dest[%index, %c0] {in_bounds = [true, true]} : vector<4x[1]xf32>, memref<24x1xf32>
267+
return
268+
}
269+
// CHECK: func.func @trailing_scalable_one_dim_transfer_write
270+
// CHECK-NOT: vector.shape_cast
271+
// CHECK: vector.transfer_write {{.*}} : vector<4x[1]xf32>, memref<24x1xf32>
272+
// CHECK-NOT: vector.shape_cast

0 commit comments

Comments
 (0)