blob: cc001f0334c34d250bff714da1423e03ab7789c0 [file] [log] [blame]
Dale Johannesenb5721632009-01-21 00:35:19 +00001; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0x7FF8000000000000 | count 7
Dale Johannesen1f864982009-01-21 20:32:55 +00002; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0x7FF00000FFFFFFFF | count 5
Dale Johannesenb5721632009-01-21 00:35:19 +00003; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep {0\\.0} | count 3
4; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep {3\\.5} | count 1
Dale Johannesen1f864982009-01-21 20:32:55 +00005;
Dale Johannesenb5721632009-01-21 00:35:19 +00006
7; ModuleID = 'apf.c'
8target 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"
9target triple = "i386-apple-darwin9.6"
10@"\01LC" = internal constant [4 x i8] c"%f\0A\00" ; <[4 x i8]*> [#uses=1]
11
12define void @foo1() nounwind {
13entry:
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]
25 br label %return
26
27return: ; preds = %entry
28 ret void
29}
30
31declare i32 @printf(i8*, ...) nounwind
32
33define void @foo2() nounwind {
34entry:
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]
46 br label %return
47
48return: ; preds = %entry
49 ret void
50}
51
52define void @foo3() nounwind {
53entry:
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]
65 br label %return
66
67return: ; preds = %entry
68 ret void
69}
70
71define void @foo4() nounwind {
72entry:
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]
84 br label %return
85
86return: ; preds = %entry
87 ret void
88}
89
90define void @foo5() nounwind {
91entry:
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]
103 br label %return
104
105return: ; preds = %entry
106 ret void
107}
108
109define void @foo6() nounwind {
110entry:
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]
122 br label %return
123
124return: ; preds = %entry
125 ret void
126}
127
128define void @foo7() nounwind {
129entry:
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]
141 br label %return
142
143return: ; preds = %entry
144 ret void
145}
146
147define void @foo8() nounwind {
148entry:
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]
160 br label %return
161
162return: ; preds = %entry
163 ret void
164}
165
166define void @foo9() nounwind {
167entry:
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]
179 br label %return
180
181return: ; preds = %entry
182 ret void
183}
184
185define void @foo10() nounwind {
186entry:
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]
198 br label %return
199
200return: ; preds = %entry
201 ret void
202}
203
204define void @foo11() nounwind {
205entry:
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]
217 br label %return
218
219return: ; preds = %entry
220 ret void
221}
222
223define void @foo12() nounwind {
224entry:
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]
236 br label %return
237
238return: ; preds = %entry
239 ret void
240}
241
242define void @foo13() nounwind {
243entry:
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]
255 br label %return
256
257return: ; preds = %entry
258 ret void
259}
260
261define void @foo14() nounwind {
262entry:
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]
274 br label %return
275
276return: ; preds = %entry
277 ret void
278}
279
280define void @foo15() nounwind {
281entry:
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]
293 br label %return
294
295return: ; preds = %entry
296 ret void
297}
298
299define void @foo16() nounwind {
300entry:
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]
312 br label %return
313
314return: ; preds = %entry
315 ret void
316}