File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -3203,6 +3203,21 @@ define i1 @icmp_and_or_lshr(i32 %x, i32 %y) {
32033203 ret i1 %ret
32043204}
32053205
3206+ define i1 @icmp_and_or_lshr_samesign (i32 %x , i32 %y ) {
3207+ ; CHECK-LABEL: @icmp_and_or_lshr_samesign(
3208+ ; CHECK-NEXT: [[SHF1:%.*]] = shl nuw i32 1, [[Y:%.*]]
3209+ ; CHECK-NEXT: [[OR2:%.*]] = or i32 [[SHF1]], 1
3210+ ; CHECK-NEXT: [[AND3:%.*]] = and i32 [[X:%.*]], [[OR2]]
3211+ ; CHECK-NEXT: [[RET:%.*]] = icmp samesign ne i32 [[AND3]], 0
3212+ ; CHECK-NEXT: ret i1 [[RET]]
3213+ ;
3214+ %shf = lshr i32 %x , %y
3215+ %or = or i32 %shf , %x
3216+ %and = and i32 %or , 1
3217+ %ret = icmp samesign ne i32 %and , 0
3218+ ret i1 %ret
3219+ }
3220+
32063221define <2 x i1 > @icmp_and_or_lshr_vec (<2 x i32 > %x , <2 x i32 > %y ) {
32073222; CHECK-LABEL: @icmp_and_or_lshr_vec(
32083223; CHECK-NEXT: [[SHF:%.*]] = lshr <2 x i32> [[X:%.*]], [[Y:%.*]]
You can’t perform that action at this time.
0 commit comments