File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -4837,3 +4837,19 @@ define i32 @replace_and_cond_multiuse2(i1 %cond1, i1 %cond2) {
48374837 %mux = select i1 %cond1 , i32 %sel , i32 1
48384838 ret i32 %mux
48394839}
4840+
4841+ define i32 @src_simplify_2x_at_once_and (i32 %x , i32 %y ) {
4842+ ; CHECK-LABEL: @src_simplify_2x_at_once_and(
4843+ ; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], [[Y:%.*]]
4844+ ; CHECK-NEXT: [[AND0:%.*]] = icmp eq i32 [[AND]], -1
4845+ ; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[X]], [[Y]]
4846+ ; CHECK-NEXT: [[COND:%.*]] = select i1 [[AND0]], i32 0, i32 [[XOR]]
4847+ ; CHECK-NEXT: ret i32 [[COND]]
4848+ ;
4849+ %and = and i32 %x , %y
4850+ %and0 = icmp eq i32 %and , -1
4851+ %sub = sub i32 %x , %y
4852+ %xor = xor i32 %x , %y
4853+ %cond = select i1 %and0 , i32 %sub , i32 %xor
4854+ ret i32 %cond
4855+ }
You can’t perform that action at this time.
0 commit comments