File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1900,3 +1900,28 @@ define i1 @masked_icmps_bmask_notmixed_not_subset_notoptimized(i32 %A) {
19001900 %res = and i1 %tst1 , %tst2
19011901 ret i1 %res
19021902}
1903+
1904+ define i1 @pr120361 (i8 %x , i8 %y ) {
1905+ ; CHECK-LABEL: @pr120361(
1906+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp samesign eq i8 [[X:%.*]], -1
1907+ ; CHECK-NEXT: ret i1 [[CMP1]]
1908+ ;
1909+ %cmp1 = icmp samesign eq i8 %x , -1
1910+ %cmp2 = icmp ne i8 %x , 0
1911+ %result = select i1 %cmp2 , i1 %cmp1 , i1 false
1912+ ret i1 %result
1913+ }
1914+
1915+ define i1 @pr120361_v2 (i32 %x ) {
1916+ ; CHECK-LABEL: @pr120361_v2(
1917+ ; CHECK-NEXT: [[AND2:%.*]] = and i32 [[X:%.*]], -113
1918+ ; CHECK-NEXT: [[CMP2:%.*]] = icmp samesign eq i32 [[AND2]], 15
1919+ ; CHECK-NEXT: ret i1 [[CMP2]]
1920+ ;
1921+ %and1 = and i32 %x , 15
1922+ %cmp1 = icmp ne i32 %and1 , 0
1923+ %and2 = and i32 %x , -113
1924+ %cmp2 = icmp samesign eq i32 %and2 , 15
1925+ %and = select i1 %cmp1 , i1 %cmp2 , i1 false
1926+ ret i1 %and
1927+ }
You can’t perform that action at this time.
0 commit comments