Skip to content

Commit 1d942de

Browse files
committed
fixup! fixup! [mlir][vector] Refactor vector-transfer-flatten.mlir (nfc) (3/n)
Replace /// with //, improve indentation
1 parent fa6e7d3 commit 1d942de

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

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

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,17 @@ func.func @transfer_read_dims_mismatch_non_contiguous_non_zero_indices(
123123
// CHECK: #[[$MAP:.+]] = affine_map<()[s0] -> (s0 * 2)>
124124

125125
// CHECK-LABEL: func.func @transfer_read_dims_mismatch_non_contiguous_non_zero_indices(
126-
// CHECK: %[[COLLAPSE:.+]] = memref.collapse_shape %{{.*}} {{\[}}[0], [1], [2, 3]] : memref<1x3x3x2xf32, strided<[40, 10, 2, 1], offset: ?>> into memref<1x3x6xf32, strided<[40, 10, 1], offset: ?>>
126+
// CHECK: %[[COLLAPSE:.+]] = memref.collapse_shape %{{.*}} {{\[}}[0], [1], [2, 3]]
127+
// CHECK-SAME: : memref<1x3x3x2xf32, strided<[40, 10, 2, 1], offset: ?>> into memref<1x3x6xf32, strided<[40, 10, 1], offset: ?>>
127128
// CHECK: %[[APPLY:.*]] = affine.apply #[[$MAP]]()
128129

129130
// CHECK-128B-LABEL: func @transfer_read_dims_mismatch_non_contiguous_non_zero_indices(
130131
// CHECK-128B: memref.collapse_shape
131132

132133
// -----
133134

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

137138
func.func @transfer_read_leading_dynamic_dims(
138139
%arg : memref<?x?x8x4xi8, strided<[?, 32, 4, 1], offset: ?>>,
@@ -148,16 +149,16 @@ func.func @transfer_read_leading_dynamic_dims(
148149

149150
// CHECK-LABEL: func @transfer_read_leading_dynamic_dims
150151
// CHECK-SAME: %[[ARG0:.+]]: memref<?x?x8x4xi8, {{.+}}>, %[[ARG1:.+]]: index, %[[ARG2:.+]]: index
151-
// CHECK: %[[C0_I8:.+]] = arith.constant 0 : i8
152-
// CHECK: %[[C0:.+]] = arith.constant 0 : index
153-
// CHECK: %[[COLLAPSED:.+]] = memref.collapse_shape %[[ARG0]] {{\[}}[0], [1], [2, 3]{{\]}}
154-
// CHECK-SAME: : memref<?x?x8x4xi8, {{.+}}> into memref<?x?x32xi8, {{.+}}>
155-
// CHECK: %[[VEC1D:.+]] = vector.transfer_read %[[COLLAPSED]]
152+
// CHECK: %[[C0_I8:.+]] = arith.constant 0 : i8
153+
// CHECK: %[[C0:.+]] = arith.constant 0 : index
154+
// CHECK: %[[COLLAPSED:.+]] = memref.collapse_shape %[[ARG0]] {{\[}}[0], [1], [2, 3]{{\]}}
155+
// CHECK-SAME: : memref<?x?x8x4xi8, {{.+}}> into memref<?x?x32xi8, {{.+}}>
156+
// CHECK: %[[VEC1D:.+]] = vector.transfer_read %[[COLLAPSED]]
156157
// CHECK-SAME: [%[[ARG1]], %[[ARG2]], %[[C0]]], %[[C0_I8]]
157158
// CHECK-SAME: {in_bounds = [true]}
158-
// CHECK-SAME: : memref<?x?x32xi8, {{.+}}>, vector<32xi8>
159-
// CHECK: %[[VEC2D:.+]] = vector.shape_cast %[[VEC1D]] : vector<32xi8> to vector<8x4xi8>
160-
// CHECK: return %[[VEC2D]] : vector<8x4xi8>
159+
// CHECK-SAME: : memref<?x?x32xi8, {{.+}}>, vector<32xi8>
160+
// CHECK: %[[VEC2D:.+]] = vector.shape_cast %[[VEC1D]] : vector<32xi8> to vector<8x4xi8>
161+
// CHECK: return %[[VEC2D]] : vector<8x4xi8>
161162

162163
// CHECK-128B-LABEL: func @transfer_read_leading_dynamic_dims
163164
// CHECK-128B: memref.collapse_shape
@@ -377,8 +378,8 @@ func.func @transfer_write_dims_mismatch_non_contiguous_non_zero_indices(
377378

378379
// -----
379380

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.
381+
// The leading dynamic shapes don't affect whether this example is flattenable
382+
// or not. Indeed, those dynamic shapes are not candidates for flattening anyway.
382383

383384
func.func @transfer_write_leading_dynamic_dims(
384385
%vec : vector<8x4xi8>,
@@ -393,15 +394,15 @@ func.func @transfer_write_leading_dynamic_dims(
393394
}
394395

395396
// CHECK-LABEL: func @transfer_write_leading_dynamic_dims
396-
// CHECK-SAME: %[[ARG0:.+]]: vector<8x4xi8>, %[[ARG1:.+]]: memref<?x?x8x4xi8, {{.+}}>, %[[ARG2:.+]]: index, %[[ARG3:.+]]: index
397-
// CHECK: %[[C0:.+]] = arith.constant 0 : index
398-
// CHECK: %[[COLLAPSED:.+]] = memref.collapse_shape %[[ARG1]] {{\[}}[0], [1], [2, 3]{{\]}}
399-
// CHECK-SAME: : memref<?x?x8x4xi8, {{.+}}> into memref<?x?x32xi8, {{.+}}>
400-
// CHECK: %[[VEC1D:.+]] = vector.shape_cast %[[ARG0]] : vector<8x4xi8> to vector<32xi8>
401-
// CHECK: vector.transfer_write %[[VEC1D]], %[[COLLAPSED]]
402-
// CHECK-SAME: [%[[ARG2]], %[[ARG3]], %[[C0]]]
403-
// CHECK-SAME: {in_bounds = [true]}
404-
// CHECK-SAME: : vector<32xi8>, memref<?x?x32xi8, {{.+}}>
397+
// CHECK-SAME: %[[ARG0:.+]]: vector<8x4xi8>, %[[ARG1:.+]]: memref<?x?x8x4xi8, {{.+}}>, %[[ARG2:.+]]: index, %[[ARG3:.+]]: index
398+
// CHECK: %[[C0:.+]] = arith.constant 0 : index
399+
// CHECK: %[[COLLAPSED:.+]] = memref.collapse_shape %[[ARG1]] {{\[}}[0], [1], [2, 3]{{\]}}
400+
// CHECK-SAME: : memref<?x?x8x4xi8, {{.+}}> into memref<?x?x32xi8, {{.+}}>
401+
// CHECK: %[[VEC1D:.+]] = vector.shape_cast %[[ARG0]] : vector<8x4xi8> to vector<32xi8>
402+
// CHECK: vector.transfer_write %[[VEC1D]], %[[COLLAPSED]]
403+
// CHECK-SAME: [%[[ARG2]], %[[ARG3]], %[[C0]]]
404+
// CHECK-SAME: {in_bounds = [true]}
405+
// CHECK-SAME: : vector<32xi8>, memref<?x?x32xi8, {{.+}}>
405406

406407
// CHECK-128B-LABEL: func @transfer_write_leading_dynamic_dims
407408
// CHECK-128B: memref.collapse_shape

0 commit comments

Comments
 (0)