1 ; RUN: llc < %s -mtriple=i386-apple-darwin10 -mcpu=penryn | FileCheck %s
5 define i32 @test1(i32 %a, i32 %b) nounwind ssp {
12 %0 = and i32 %a, 16384
13 %1 = icmp ne i32 %0, 0
14 %2 = and i32 %b, 16384
15 %3 = icmp ne i32 %2, 0
17 br i1 %4, label %bb1, label %bb
20 %5 = tail call i32 (...) @foo() nounwind ; <i32> [#uses=1]
24 %6 = tail call i32 (...) @bar() nounwind ; <i32> [#uses=1]
34 ; PR3351 - (P == 0) & (Q == 0) -> (P|Q) == 0
35 define i32 @test2(i32* %P, i32* %Q) nounwind ssp {
37 %a = icmp eq i32* %P, null ; <i1> [#uses=1]
38 %b = icmp eq i32* %Q, null ; <i1> [#uses=1]
40 br i1 %c, label %bb1, label %return
45 return: ; preds = %entry
48 ; CHECK: movl 4(%esp), %eax
49 ; CHECK-NEXT: orl 8(%esp), %eax
50 ; CHECK-NEXT: jne LBB1_2
53 ; PR3351 - (P != 0) | (Q != 0) -> (P|Q) != 0
54 define i32 @test3(i32* %P, i32* %Q) nounwind ssp {
56 %a = icmp ne i32* %P, null ; <i1> [#uses=1]
57 %b = icmp ne i32* %Q, null ; <i1> [#uses=1]
59 br i1 %c, label %bb1, label %return
64 return: ; preds = %entry
67 ; CHECK: movl 4(%esp), %eax
68 ; CHECK-NEXT: orl 8(%esp), %eax
69 ; CHECK-NEXT: je LBB2_2
72 ; <rdar://problem/7598384>:
88 define float @test4(float %x, float %y) nounwind readnone optsize ssp {
90 %0 = fpext float %x to double ; <double> [#uses=1]
91 %1 = fpext float %y to double ; <double> [#uses=1]
92 %2 = fmul double %0, %1 ; <double> [#uses=3]
93 %3 = fcmp oeq double %2, 0.000000e+00 ; <i1> [#uses=1]
94 br i1 %3, label %bb2, label %bb1
101 bb1: ; preds = %entry
102 %4 = fadd double %2, -1.000000e+00 ; <double> [#uses=1]
105 bb2: ; preds = %entry, %bb1
106 %.0.in = phi double [ %4, %bb1 ], [ %2, %entry ] ; <double> [#uses=1]
107 %.0 = fptrunc double %.0.in to float ; <float> [#uses=1]
111 declare i32 @llvm.x86.sse41.ptestz(<4 x float> %p1, <4 x float> %p2) nounwind
112 declare i32 @llvm.x86.sse41.ptestc(<4 x float> %p1, <4 x float> %p2) nounwind
114 define <4 x float> @test5(<4 x float> %a, <4 x float> %b) nounwind {
116 ; CHECK-LABEL: test5:
121 %res = call i32 @llvm.x86.sse41.ptestz(<4 x float> %a, <4 x float> %a) nounwind
122 %one = icmp ne i32 %res, 0
123 br i1 %one, label %bb1, label %bb2
126 %c = fadd <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
130 %d = fdiv <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
134 %e = phi <4 x float> [%c, %bb1], [%d, %bb2]
138 define <4 x float> @test7(<4 x float> %a, <4 x float> %b) nounwind {
140 ; CHECK-LABEL: test7:
145 %res = call i32 @llvm.x86.sse41.ptestz(<4 x float> %a, <4 x float> %a) nounwind
146 %one = trunc i32 %res to i1
147 br i1 %one, label %bb1, label %bb2
150 %c = fadd <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
154 %d = fdiv <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
158 %e = phi <4 x float> [%c, %bb1], [%d, %bb2]
162 define <4 x float> @test8(<4 x float> %a, <4 x float> %b) nounwind {
164 ; CHECK-LABEL: test8:
169 %res = call i32 @llvm.x86.sse41.ptestc(<4 x float> %a, <4 x float> %a) nounwind
170 %one = icmp ne i32 %res, 0
171 br i1 %one, label %bb1, label %bb2
174 %c = fadd <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
178 %d = fdiv <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
182 %e = phi <4 x float> [%c, %bb1], [%d, %bb2]
186 define <4 x float> @test10(<4 x float> %a, <4 x float> %b) nounwind {
188 ; CHECK-LABEL: test10:
193 %res = call i32 @llvm.x86.sse41.ptestc(<4 x float> %a, <4 x float> %a) nounwind
194 %one = trunc i32 %res to i1
195 br i1 %one, label %bb1, label %bb2
198 %c = fadd <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
202 %d = fdiv <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
206 %e = phi <4 x float> [%c, %bb1], [%d, %bb2]
210 define <4 x float> @test11(<4 x float> %a, <4 x float> %b) nounwind {
212 ; CHECK-LABEL: test11:
217 %res = call i32 @llvm.x86.sse41.ptestz(<4 x float> %a, <4 x float> %a) nounwind
218 %one = icmp eq i32 %res, 1
219 br i1 %one, label %bb1, label %bb2
222 %c = fadd <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
226 %d = fdiv <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
230 %e = phi <4 x float> [%c, %bb1], [%d, %bb2]
234 define <4 x float> @test12(<4 x float> %a, <4 x float> %b) nounwind {
236 ; CHECK-LABEL: test12:
241 %res = call i32 @llvm.x86.sse41.ptestz(<4 x float> %a, <4 x float> %a) nounwind
242 %one = icmp ne i32 %res, 1
243 br i1 %one, label %bb1, label %bb2
246 %c = fadd <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
250 %d = fdiv <4 x float> %b, < float 1.000000e+002, float 2.000000e+002, float 3.000000e+002, float 4.000000e+002 >
254 %e = phi <4 x float> [%c, %bb1], [%d, %bb2]