Skip to content

Commit b77006f

Browse files
committed
Add more tests
1 parent c5e38a7 commit b77006f

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

mlir/test/Dialect/Vector/canonicalize.mlir

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3380,12 +3380,37 @@ func.func @negative_from_elements_to_constant() -> vector<1x!llvm.ptr> {
33803380
// CHECK-LABEL: @negative_from_elements_poison
33813381
// CHECK: %[[VAL:.*]] = ub.poison : vector<2xf32>
33823382
// CHECK: return %[[VAL]] : vector<2xf32>
3383-
func.func @negative_from_elements_poison() -> vector<2xf32> {
3383+
func.func @negative_from_elements_poison_f32() -> vector<2xf32> {
33843384
%0 = ub.poison : f32
33853385
%1 = vector.from_elements %0, %0 : vector<2xf32>
33863386
return %1 : vector<2xf32>
33873387
}
33883388

3389+
// -----
3390+
3391+
// CHECK-LABEL: @negative_from_elements_poison_i32
3392+
// CHECK: %[[VAL:.*]] = ub.poison : vector<2xi32>
3393+
// CHECK: return %[[VAL]] : vector<2xi32>
3394+
func.func @negative_from_elements_poison_i32() -> vector<2xi32> {
3395+
%0 = ub.poison : i32
3396+
%1 = vector.from_elements %0, %0 : vector<2xi32>
3397+
return %1 : vector<2xi32>
3398+
}
3399+
3400+
// -----
3401+
3402+
// CHECK-LABEL: @negative_from_elements_poison_constant_mix
3403+
// CHECK: %[[POISON:.*]] = ub.poison : f32
3404+
// CHECK: %[[CONST:.*]] = arith.constant 1.000000e+00 : f32
3405+
// CHECK: %[[RES:.*]] = vector.from_elements %[[POISON]], %[[CONST]] : vector<2xf32>
3406+
// CHECK: return %[[RES]] : vector<2xf32>
3407+
func.func @negative_from_elements_poison_constant_mix() -> vector<2xf32> {
3408+
%0 = ub.poison : f32
3409+
%c = arith.constant 1.0 : f32
3410+
%1 = vector.from_elements %0, %c : vector<2xf32>
3411+
return %1 : vector<2xf32>
3412+
}
3413+
33893414
// +---------------------------------------------------------------------------
33903415
// End of Tests for foldFromElementsToConstant
33913416
// +---------------------------------------------------------------------------

0 commit comments

Comments
 (0)