Skip to content

Commit 83a1404

Browse files
committed
Feedback
1 parent bcf0d6f commit 83a1404

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

mlir/test/Dialect/Vector/canonicalize.mlir

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,9 @@ func.func @extract_from_create_mask_dynamic_position(%dim0: index, %index: index
134134

135135
// CHECK-LABEL: @extract_scalar_poison
136136
func.func @extract_scalar_poison() -> f32 {
137-
// CHECK-NEXT: ub.poison : f32
137+
// CHECK-NEXT: %[[UB:.*]] = ub.poison : f32
138138
// CHECK-NOT: vector.extract
139+
// CHECK-NEXT: return %[[UB]] : f32
139140
%0 = ub.poison : vector<4x8xf32>
140141
%1 = vector.extract %0[2, 4] : f32 from vector<4x8xf32>
141142
return %1 : f32
@@ -145,8 +146,9 @@ func.func @extract_scalar_poison() -> f32 {
145146

146147
// CHECK-LABEL: @extract_vector_poison
147148
func.func @extract_vector_poison() -> vector<8xf32> {
148-
// CHECK-NEXT: ub.poison : vector<8xf32>
149+
// CHECK-NEXT: %[[UB:.*]] = ub.poison : vector<8xf32>
149150
// CHECK-NOT: vector.extract
151+
// CHECK-NEXT: return %[[UB]] : vector<8xf32>
150152
%0 = ub.poison : vector<4x8xf32>
151153
%1 = vector.extract %0[2] : vector<8xf32> from vector<4x8xf32>
152154
return %1 : vector<8xf32>
@@ -156,8 +158,9 @@ func.func @extract_vector_poison() -> vector<8xf32> {
156158

157159
// CHECK-LABEL: @extract_scalar_poison_idx
158160
func.func @extract_scalar_poison_idx(%a: vector<4x5xf32>) -> f32 {
161+
// CHECK-NEXT: %[[UB:.*]] = ub.poison : f32
159162
// CHECK-NOT: vector.extract
160-
// CHECK-NEXT: ub.poison : f32
163+
// CHECK-NEXT: return %[[UB]] : f32
161164
%0 = vector.extract %a[-1, 0] : f32 from vector<4x5xf32>
162165
return %0 : f32
163166
}
@@ -166,8 +169,9 @@ func.func @extract_scalar_poison_idx(%a: vector<4x5xf32>) -> f32 {
166169

167170
// CHECK-LABEL: @extract_vector_poison_idx
168171
func.func @extract_vector_poison_idx(%a: vector<4x5xf32>) -> vector<5xf32> {
172+
// CHECK-NEXT: %[[UB:.*]] = ub.poison : vector<5xf32>
169173
// CHECK-NOT: vector.extract
170-
// CHECK-NEXT: ub.poison : vector<5xf32>
174+
// CHECK-NEXT: return %[[UB]] : vector<5xf32>
171175
%0 = vector.extract %a[-1] : vector<5xf32> from vector<4x5xf32>
172176
return %0 : vector<5xf32>
173177
}
@@ -177,8 +181,9 @@ func.func @extract_vector_poison_idx(%a: vector<4x5xf32>) -> vector<5xf32> {
177181
// CHECK-LABEL: @extract_multiple_poison_idx
178182
func.func @extract_multiple_poison_idx(%a: vector<4x5x8xf32>)
179183
-> vector<8xf32> {
184+
// CHECK-NEXT: %[[UB:.*]] = ub.poison : vector<8xf32>
180185
// CHECK-NOT: vector.extract
181-
// CHECK-NEXT: ub.poison : vector<8xf32>
186+
// CHECK-NEXT: return %[[UB]] : vector<8xf32>
182187
%0 = vector.extract %a[-1, -1] : vector<8xf32> from vector<4x5x8xf32>
183188
return %0 : vector<8xf32>
184189
}
@@ -2917,7 +2922,8 @@ func.func @vector_insert_const_regression(%arg0: i8) -> vector<4xi8> {
29172922
func.func @insert_scalar_poison(%a: vector<4x8xf32>)
29182923
-> vector<4x8xf32> {
29192924
// CHECK-NEXT: %[[UB:.*]] = ub.poison : f32
2920-
// CHECK-NEXT: vector.insert %[[UB]]
2925+
// CHECK-NEXT: %[[RES:.*]] = vector.insert %[[UB]]
2926+
// CHECK-NEXT: return %[[RES]] : vector<4x8xf32>
29212927
%0 = ub.poison : f32
29222928
%1 = vector.insert %0, %a[2, 3] : f32 into vector<4x8xf32>
29232929
return %1 : vector<4x8xf32>
@@ -2932,7 +2938,8 @@ func.func @insert_scalar_poison(%a: vector<4x8xf32>)
29322938
func.func @insert_vector_poison(%a: vector<4x8xf32>)
29332939
-> vector<4x8xf32> {
29342940
// CHECK-NEXT: %[[UB:.*]] = ub.poison : vector<8xf32>
2935-
// CHECK-NEXT: vector.insert %[[UB]]
2941+
// CHECK-NEXT: %[[RES:.*]] = vector.insert %[[UB]]
2942+
// CHECK-NEXT: return %[[RES]] : vector<4x8xf32>
29362943
%0 = ub.poison : vector<8xf32>
29372944
%1 = vector.insert %0, %a[2] : vector<8xf32> into vector<4x8xf32>
29382945
return %1 : vector<4x8xf32>
@@ -2944,8 +2951,9 @@ func.func @insert_vector_poison(%a: vector<4x8xf32>)
29442951
// CHECK-LABEL: @insert_scalar_poison_idx
29452952
func.func @insert_scalar_poison_idx(%a: vector<4x5xf32>, %b: f32)
29462953
-> vector<4x5xf32> {
2954+
// CHECK-NEXT: %[[UB:.*]] = ub.poison : vector<4x5xf32>
29472955
// CHECK-NOT: vector.insert
2948-
// CHECK-NEXT: ub.poison : vector<4x5xf32>
2956+
// CHECK-NEXT: return %[[UB]] : vector<4x5xf32>
29492957
%0 = vector.insert %b, %a[-1, 0] : f32 into vector<4x5xf32>
29502958
return %0 : vector<4x5xf32>
29512959
}
@@ -2955,8 +2963,9 @@ func.func @insert_scalar_poison_idx(%a: vector<4x5xf32>, %b: f32)
29552963
// CHECK-LABEL: @insert_vector_poison_idx
29562964
func.func @insert_vector_poison_idx(%a: vector<4x5xf32>, %b: vector<5xf32>)
29572965
-> vector<4x5xf32> {
2966+
// CHECK-NEXT: %[[UB:.*]] = ub.poison : vector<4x5xf32>
29582967
// CHECK-NOT: vector.insert
2959-
// CHECK-NEXT: ub.poison : vector<4x5xf32>
2968+
// CHECK-NEXT: return %[[UB]] : vector<4x5xf32>
29602969
%0 = vector.insert %b, %a[-1] : vector<5xf32> into vector<4x5xf32>
29612970
return %0 : vector<4x5xf32>
29622971
}
@@ -2966,8 +2975,9 @@ func.func @insert_vector_poison_idx(%a: vector<4x5xf32>, %b: vector<5xf32>)
29662975
// CHECK-LABEL: @insert_multiple_poison_idx
29672976
func.func @insert_multiple_poison_idx(%a: vector<4x5x8xf32>, %b: vector<8xf32>)
29682977
-> vector<4x5x8xf32> {
2978+
// CHECK-NEXT: %[[UB:.*]] = ub.poison : vector<4x5x8xf32>
29692979
// CHECK-NOT: vector.insert
2970-
// CHECK-NEXT: ub.poison : vector<4x5x8xf32>
2980+
// CHECK-NEXT: return %[[UB]] : vector<4x5x8xf32>
29712981
%0 = vector.insert %b, %a[-1, -1] : vector<8xf32> into vector<4x5x8xf32>
29722982
return %0 : vector<4x5x8xf32>
29732983
}

0 commit comments

Comments
 (0)