1 ; RUN: opt < %s -simplifycfg -instcombine -S | grep 0x7FF8000000000000 | count 7
2 ; RUN: opt < %s -simplifycfg -instcombine -S | grep 0x7FF00000FFFFFFFF | count 5
3 ; RUN: opt < %s -simplifycfg -instcombine -S | grep {0\\.0} | count 3
4 ; RUN: opt < %s -simplifycfg -instcombine -S | grep {3\\.5} | count 1
8 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
9 target triple = "i386-apple-darwin9.6"
10 @"\01LC" = internal constant [4 x i8] c"%f\0A\00" ; <[4 x i8]*> [#uses=1]
12 define void @foo1() nounwind {
14 %y = alloca float ; <float*> [#uses=2]
15 %x = alloca float ; <float*> [#uses=2]
16 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
17 store float 0x7FF0000000000000, float* %x, align 4
18 store float 0x7FF8000000000000, float* %y, align 4
19 %0 = load float* %y, align 4 ; <float> [#uses=1]
20 %1 = fpext float %0 to double ; <double> [#uses=1]
21 %2 = load float* %x, align 4 ; <float> [#uses=1]
22 %3 = fpext float %2 to double ; <double> [#uses=1]
23 %4 = frem double %3, %1 ; <double> [#uses=1]
24 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
27 return: ; preds = %entry
31 declare i32 @printf(i8*, ...) nounwind
33 define void @foo2() nounwind {
35 %y = alloca float ; <float*> [#uses=2]
36 %x = alloca float ; <float*> [#uses=2]
37 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
38 store float 0x7FF0000000000000, float* %x, align 4
39 store float 0.000000e+00, float* %y, align 4
40 %0 = load float* %y, align 4 ; <float> [#uses=1]
41 %1 = fpext float %0 to double ; <double> [#uses=1]
42 %2 = load float* %x, align 4 ; <float> [#uses=1]
43 %3 = fpext float %2 to double ; <double> [#uses=1]
44 %4 = frem double %3, %1 ; <double> [#uses=1]
45 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
48 return: ; preds = %entry
52 define void @foo3() nounwind {
54 %y = alloca float ; <float*> [#uses=2]
55 %x = alloca float ; <float*> [#uses=2]
56 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
57 store float 0x7FF0000000000000, float* %x, align 4
58 store float 3.500000e+00, float* %y, align 4
59 %0 = load float* %y, align 4 ; <float> [#uses=1]
60 %1 = fpext float %0 to double ; <double> [#uses=1]
61 %2 = load float* %x, align 4 ; <float> [#uses=1]
62 %3 = fpext float %2 to double ; <double> [#uses=1]
63 %4 = frem double %3, %1 ; <double> [#uses=1]
64 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
67 return: ; preds = %entry
71 define void @foo4() nounwind {
73 %y = alloca float ; <float*> [#uses=2]
74 %x = alloca float ; <float*> [#uses=2]
75 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
76 store float 0x7FF0000000000000, float* %x, align 4
77 store float 0x7FF0000000000000, float* %y, align 4
78 %0 = load float* %y, align 4 ; <float> [#uses=1]
79 %1 = fpext float %0 to double ; <double> [#uses=1]
80 %2 = load float* %x, align 4 ; <float> [#uses=1]
81 %3 = fpext float %2 to double ; <double> [#uses=1]
82 %4 = frem double %3, %1 ; <double> [#uses=1]
83 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
86 return: ; preds = %entry
90 define void @foo5() nounwind {
92 %y = alloca float ; <float*> [#uses=2]
93 %x = alloca float ; <float*> [#uses=2]
94 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
95 store float 0x7FF8000000000000, float* %x, align 4
96 store float 0x7FF0000000000000, float* %y, align 4
97 %0 = load float* %y, align 4 ; <float> [#uses=1]
98 %1 = fpext float %0 to double ; <double> [#uses=1]
99 %2 = load float* %x, align 4 ; <float> [#uses=1]
100 %3 = fpext float %2 to double ; <double> [#uses=1]
101 %4 = frem double %3, %1 ; <double> [#uses=1]
102 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
105 return: ; preds = %entry
109 define void @foo6() nounwind {
111 %y = alloca float ; <float*> [#uses=2]
112 %x = alloca float ; <float*> [#uses=2]
113 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
114 store float 0x7FF8000000000000, float* %x, align 4
115 store float 0.000000e+00, float* %y, align 4
116 %0 = load float* %y, align 4 ; <float> [#uses=1]
117 %1 = fpext float %0 to double ; <double> [#uses=1]
118 %2 = load float* %x, align 4 ; <float> [#uses=1]
119 %3 = fpext float %2 to double ; <double> [#uses=1]
120 %4 = frem double %3, %1 ; <double> [#uses=1]
121 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
124 return: ; preds = %entry
128 define void @foo7() nounwind {
130 %y = alloca float ; <float*> [#uses=2]
131 %x = alloca float ; <float*> [#uses=2]
132 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
133 store float 0x7FF8000000000000, float* %x, align 4
134 store float 3.500000e+00, float* %y, align 4
135 %0 = load float* %y, align 4 ; <float> [#uses=1]
136 %1 = fpext float %0 to double ; <double> [#uses=1]
137 %2 = load float* %x, align 4 ; <float> [#uses=1]
138 %3 = fpext float %2 to double ; <double> [#uses=1]
139 %4 = frem double %3, %1 ; <double> [#uses=1]
140 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
143 return: ; preds = %entry
147 define void @foo8() nounwind {
149 %y = alloca float ; <float*> [#uses=2]
150 %x = alloca float ; <float*> [#uses=2]
151 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
152 store float 0x7FF8000000000000, float* %x, align 4
153 store float 0x7FF8000000000000, float* %y, align 4
154 %0 = load float* %y, align 4 ; <float> [#uses=1]
155 %1 = fpext float %0 to double ; <double> [#uses=1]
156 %2 = load float* %x, align 4 ; <float> [#uses=1]
157 %3 = fpext float %2 to double ; <double> [#uses=1]
158 %4 = frem double %3, %1 ; <double> [#uses=1]
159 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
162 return: ; preds = %entry
166 define void @foo9() nounwind {
168 %y = alloca float ; <float*> [#uses=2]
169 %x = alloca float ; <float*> [#uses=2]
170 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
171 store float 0.000000e+00, float* %x, align 4
172 store float 0x7FF8000000000000, float* %y, align 4
173 %0 = load float* %y, align 4 ; <float> [#uses=1]
174 %1 = fpext float %0 to double ; <double> [#uses=1]
175 %2 = load float* %x, align 4 ; <float> [#uses=1]
176 %3 = fpext float %2 to double ; <double> [#uses=1]
177 %4 = frem double %3, %1 ; <double> [#uses=1]
178 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
181 return: ; preds = %entry
185 define void @foo10() nounwind {
187 %y = alloca float ; <float*> [#uses=2]
188 %x = alloca float ; <float*> [#uses=2]
189 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
190 store float 0.000000e+00, float* %x, align 4
191 store float 0x7FF0000000000000, float* %y, align 4
192 %0 = load float* %y, align 4 ; <float> [#uses=1]
193 %1 = fpext float %0 to double ; <double> [#uses=1]
194 %2 = load float* %x, align 4 ; <float> [#uses=1]
195 %3 = fpext float %2 to double ; <double> [#uses=1]
196 %4 = frem double %3, %1 ; <double> [#uses=1]
197 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
200 return: ; preds = %entry
204 define void @foo11() nounwind {
206 %y = alloca float ; <float*> [#uses=2]
207 %x = alloca float ; <float*> [#uses=2]
208 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
209 store float 0.000000e+00, float* %x, align 4
210 store float 0.000000e+00, float* %y, align 4
211 %0 = load float* %y, align 4 ; <float> [#uses=1]
212 %1 = fpext float %0 to double ; <double> [#uses=1]
213 %2 = load float* %x, align 4 ; <float> [#uses=1]
214 %3 = fpext float %2 to double ; <double> [#uses=1]
215 %4 = frem double %3, %1 ; <double> [#uses=1]
216 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
219 return: ; preds = %entry
223 define void @foo12() nounwind {
225 %y = alloca float ; <float*> [#uses=2]
226 %x = alloca float ; <float*> [#uses=2]
227 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
228 store float 0.000000e+00, float* %x, align 4
229 store float 3.500000e+00, float* %y, align 4
230 %0 = load float* %y, align 4 ; <float> [#uses=1]
231 %1 = fpext float %0 to double ; <double> [#uses=1]
232 %2 = load float* %x, align 4 ; <float> [#uses=1]
233 %3 = fpext float %2 to double ; <double> [#uses=1]
234 %4 = frem double %3, %1 ; <double> [#uses=1]
235 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
238 return: ; preds = %entry
242 define void @foo13() nounwind {
244 %y = alloca float ; <float*> [#uses=2]
245 %x = alloca float ; <float*> [#uses=2]
246 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
247 store float 3.500000e+00, float* %x, align 4
248 store float 0x7FF8000000000000, float* %y, align 4
249 %0 = load float* %y, align 4 ; <float> [#uses=1]
250 %1 = fpext float %0 to double ; <double> [#uses=1]
251 %2 = load float* %x, align 4 ; <float> [#uses=1]
252 %3 = fpext float %2 to double ; <double> [#uses=1]
253 %4 = frem double %3, %1 ; <double> [#uses=1]
254 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
257 return: ; preds = %entry
261 define void @foo14() nounwind {
263 %y = alloca float ; <float*> [#uses=2]
264 %x = alloca float ; <float*> [#uses=2]
265 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
266 store float 3.500000e+00, float* %x, align 4
267 store float 0x7FF0000000000000, float* %y, align 4
268 %0 = load float* %y, align 4 ; <float> [#uses=1]
269 %1 = fpext float %0 to double ; <double> [#uses=1]
270 %2 = load float* %x, align 4 ; <float> [#uses=1]
271 %3 = fpext float %2 to double ; <double> [#uses=1]
272 %4 = frem double %3, %1 ; <double> [#uses=1]
273 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
276 return: ; preds = %entry
280 define void @foo15() nounwind {
282 %y = alloca float ; <float*> [#uses=2]
283 %x = alloca float ; <float*> [#uses=2]
284 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
285 store float 3.500000e+00, float* %x, align 4
286 store float 0.000000e+00, float* %y, align 4
287 %0 = load float* %y, align 4 ; <float> [#uses=1]
288 %1 = fpext float %0 to double ; <double> [#uses=1]
289 %2 = load float* %x, align 4 ; <float> [#uses=1]
290 %3 = fpext float %2 to double ; <double> [#uses=1]
291 %4 = frem double %3, %1 ; <double> [#uses=1]
292 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
295 return: ; preds = %entry
299 define void @foo16() nounwind {
301 %y = alloca float ; <float*> [#uses=2]
302 %x = alloca float ; <float*> [#uses=2]
303 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
304 store float 3.500000e+00, float* %x, align 4
305 store float 3.500000e+00, float* %y, align 4
306 %0 = load float* %y, align 4 ; <float> [#uses=1]
307 %1 = fpext float %0 to double ; <double> [#uses=1]
308 %2 = load float* %x, align 4 ; <float> [#uses=1]
309 %3 = fpext float %2 to double ; <double> [#uses=1]
310 %4 = frem double %3, %1 ; <double> [#uses=1]
311 %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
314 return: ; preds = %entry