Skip to content

Commit fed321f

Browse files
committed
[InstCombine] Add pre-commit tests. NFC.
1 parent f1467b3 commit fed321f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

llvm/test/Transforms/InstCombine/vector-udiv.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,15 @@ define <4 x i32> @test_v4i32_zext_shl_const_pow2(<4 x i32> %a0, <4 x i16> %a1) {
9797
%3 = udiv <4 x i32> %a0, %2
9898
ret <4 x i32> %3
9999
}
100+
101+
; Make sure we do not simplify udiv <i32 42, i32 -7>, <i32 0, i32 1> to
102+
; poison when threading udiv over selects
103+
104+
define <2 x i32> @vec_select_udiv_poison(<2 x i1> %x) {
105+
; CHECK-LABEL: @vec_select_udiv_poison(
106+
; CHECK-NEXT: ret <2 x i32> zeroinitializer
107+
;
108+
%sel = select <2 x i1> %x, <2 x i32> <i32 -1, i32 -1>, <2 x i32> <i32 0, i32 1>
109+
%div = udiv <2 x i32> <i32 42, i32 -7>, %sel
110+
ret <2 x i32> %div
111+
}

0 commit comments

Comments
 (0)