Skip to content

Commit 1a4b759

Browse files
committed
test name improvements
1 parent 49ebfa7 commit 1a4b759

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

mlir/test/Dialect/Vector/vector-shape-cast-lowering-transforms.mlir

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,19 @@ func.func @shape_cast_1d0d(%arg0 : vector<1xf32>) -> vector<f32> {
141141
}
142142

143143

144-
// CHECK-LABEL: func.func @shape_cast_squeeze_leading_one(
144+
// The shapes have 2 inner dimension sizes in common, so the extract result is rank-2.
145+
// CHECK-LABEL: func.func @squeeze_out_prefix_unit_dim(
145146
// CHECK-SAME: %[[ARG0:.*]]: vector<1x2x3xf32>) -> vector<2x3xf32> {
146147
// CHECK: %[[EXTRACTED:.*]] = vector.extract %[[ARG0]][0] :
147148
// CHECK-SAME: vector<2x3xf32> from vector<1x2x3xf32>
148149
// CHECK: return %[[EXTRACTED]] : vector<2x3xf32>
149-
func.func @shape_cast_squeeze_leading_one(%arg0 : vector<1x2x3xf32>) -> vector<2x3xf32> {
150+
func.func @squeeze_out_prefix_unit_dim(%arg0 : vector<1x2x3xf32>) -> vector<2x3xf32> {
150151
%s = vector.shape_cast %arg0 : vector<1x2x3xf32> to vector<2x3xf32>
151152
return %s : vector<2x3xf32>
152153
}
153154

154-
// CHECK-LABEL: func.func @shape_cast_squeeze_middle_one(
155+
// The shapes have 1 inner dimension size in common, so the extract results are rank-1.
156+
// CHECK-LABEL: func.func @squeeze_out_middle_unit_dim(
155157
// CHECK-SAME: %[[ARG0:.*]]: vector<2x1x3xf32>) -> vector<2x3xf32> {
156158
// CHECK: %[[UB:.*]] = ub.poison : vector<2x3xf32>
157159
// CHECK: %[[E0:.*]] = vector.extract %[[ARG0]][0, 0] : vector<3xf32>
@@ -161,31 +163,31 @@ func.func @shape_cast_squeeze_leading_one(%arg0 : vector<1x2x3xf32>) -> vector<2
161163
// CHECK: %[[I1:.*]] = vector.insert %[[E1]], %[[I0]] [1] : vector<3xf32>
162164
// CHECK-SAME: into vector<2x3xf32>
163165
// CHECK: return %[[I1]] : vector<2x3xf32>
164-
func.func @shape_cast_squeeze_middle_one(%arg0 : vector<2x1x3xf32>) -> vector<2x3xf32> {
166+
func.func @squeeze_out_middle_unit_dim(%arg0 : vector<2x1x3xf32>) -> vector<2x3xf32> {
165167
%s = vector.shape_cast %arg0 : vector<2x1x3xf32> to vector<2x3xf32>
166168
return %s : vector<2x3xf32>
167169
}
168170

169-
// CHECK-LABEL: func.func @shape_cast_unsqueeze_leading_one(
171+
// CHECK-LABEL: func.func @prepend_unit_dim(
170172
// CHECK-SAME: %[[ARG0:.*]]: vector<2x3xf32>) -> vector<1x2x3xf32> {
171173
// CHECK: %[[UB:.*]] = ub.poison : vector<1x2x3xf32>
172174
// CHECK: %[[INSERTED:.*]] = vector.insert %[[ARG0]], %[[UB]] [0]
173175
// CHECK-SAME: : vector<2x3xf32> into vector<1x2x3xf32>
174176
// CHECK: return %[[INSERTED]] : vector<1x2x3xf32>
175-
func.func @shape_cast_unsqueeze_leading_one(%arg0 : vector<2x3xf32>) -> vector<1x2x3xf32> {
177+
func.func @prepend_unit_dim(%arg0 : vector<2x3xf32>) -> vector<1x2x3xf32> {
176178
%s = vector.shape_cast %arg0 : vector<2x3xf32> to vector<1x2x3xf32>
177179
return %s : vector<1x2x3xf32>
178180
}
179181

180-
// CHECK-LABEL: func.func @shape_cast_unsqueeze_middle_one(
182+
// CHECK-LABEL: func.func @insert_middle_unit_dim(
181183
// CHECK-SAME: %[[ARG0:.*]]: vector<2x3xf32>) -> vector<2x1x3xf32> {
182184
// CHECK: %[[UB:.*]] = ub.poison : vector<2x1x3xf32>
183185
// CHECK: %[[E0:.*]] = vector.extract %[[ARG0]][0] : vector<3xf32>
184186
// CHECK: %[[I0:.*]] = vector.insert %[[E0]], %[[UB]] [0, 0] : vector<3xf32>
185187
// CHECK: %[[E1:.*]] = vector.extract %[[ARG0]][1] : vector<3xf32>
186188
// CHECK: %[[I1:.*]] = vector.insert %[[E1]], %[[I0]] [1, 0] : vector<3xf32>
187189
// CHECK: return %[[I1]] : vector<2x1x3xf32>
188-
func.func @shape_cast_unsqueeze_middle_one(%arg0 : vector<2x3xf32>) -> vector<2x1x3xf32> {
190+
func.func @insert_middle_unit_dim(%arg0 : vector<2x3xf32>) -> vector<2x1x3xf32> {
189191
%s = vector.shape_cast %arg0 : vector<2x3xf32> to vector<2x1x3xf32>
190192
return %s : vector<2x1x3xf32>
191193
}

0 commit comments

Comments
 (0)