Skip to content

Commit 7ad324b

Browse files
committed
[InstCombine] add tests for fold with no coverage and missing vector fold
llvm-svn: 278867
1 parent 07d6142 commit 7ad324b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

llvm/test/Transforms/InstCombine/2008-01-29-AddICmp.ll

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,24 @@ define <2 x i1> @test3vec(<2 x i32> %a) {
6767
ret <2 x i1> %c
6868
}
6969

70+
define i1 @test4(i32 %a) {
71+
; CHECK-LABEL: @test4(
72+
; CHECK-NEXT: [[C:%.*]] = icmp slt i32 %a, -4
73+
; CHECK-NEXT: ret i1 [[C]]
74+
;
75+
%b = add i32 %a, 2147483652
76+
%c = icmp sge i32 %b, 4
77+
ret i1 %c
78+
}
79+
80+
define <2 x i1> @test4vec(<2 x i32> %a) {
81+
; CHECK-LABEL: @test4vec(
82+
; CHECK-NEXT: [[B:%.*]] = add <2 x i32> %a, <i32 -2147483644, i32 -2147483644>
83+
; CHECK-NEXT: [[C:%.*]] = icmp sgt <2 x i32> [[B]], <i32 3, i32 3>
84+
; CHECK-NEXT: ret <2 x i1> [[C]]
85+
;
86+
%b = add <2 x i32> %a, <i32 2147483652, i32 2147483652>
87+
%c = icmp sge <2 x i32> %b, <i32 4, i32 4>
88+
ret <2 x i1> %c
89+
}
90+

0 commit comments

Comments
 (0)