File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff 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
48054817define i32 @replace_and_cond_multiuse1 (i1 %cond1 , i1 %cond2 ) {
48064818; CHECK-LABEL: @replace_and_cond_multiuse1(
You can’t perform that action at this time.
0 commit comments