Skip to content

Commit 0ce089b

Browse files
committed
[InstCombine] Add pre-commit tests. NFC.
1 parent d1a7225 commit 0ce089b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

llvm/test/Transforms/InstCombine/icmp-logical.ll

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)