Skip to content

Commit 6902d2a

Browse files
committed
[InstCombine] Add vec tests. NFC.
1 parent a85cd48 commit 6902d2a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

llvm/test/Transforms/InstCombine/select.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4801,6 +4801,18 @@ define i32 @replace_and_cond(i1 %cond1, i1 %cond2) {
48014801
ret i32 %mux
48024802
}
48034803

4804+
define <2 x i32> @replace_and_cond_vec(<2 x i1> %cond1, <2 x i1> %cond2) {
4805+
; CHECK-LABEL: @replace_and_cond_vec(
4806+
; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[COND2:%.*]], <2 x i32> splat (i32 3), <2 x i32> splat (i32 2)
4807+
; CHECK-NEXT: [[MUX:%.*]] = select <2 x i1> [[COND1:%.*]], <2 x i32> [[SEL]], <2 x i32> splat (i32 1)
4808+
; CHECK-NEXT: ret <2 x i32> [[MUX]]
4809+
;
4810+
%and = and <2 x i1> %cond1, %cond2
4811+
%sel = select <2 x i1> %and, <2 x i32> splat(i32 3), <2 x i32> splat(i32 2)
4812+
%mux = select <2 x i1> %cond1, <2 x i32> %sel, <2 x i32> splat(i32 1)
4813+
ret <2 x i32> %mux
4814+
}
4815+
48044816
; TODO: We can still replace the use of %and with %cond2
48054817
define i32 @replace_and_cond_multiuse1(i1 %cond1, i1 %cond2) {
48064818
; CHECK-LABEL: @replace_and_cond_multiuse1(

0 commit comments

Comments
 (0)