1 ; RUN: opt < %s -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S | grep 0x7FF8000000000000 | count 12
2 ; RUN: opt < %s -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S | grep "0\.0" | count 3
3 ; RUN: opt < %s -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S | grep "3\.5" | count 1
7 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"
8 target triple = "i386-apple-darwin9.6"
9 @"\01LC" = internal constant [4 x i8] c"%f\0A\00" ; <ptr> [#uses=1]
11 define void @foo1() nounwind {
13 %y = alloca float ; <ptr> [#uses=2]
14 %x = alloca float ; <ptr> [#uses=2]
15 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
16 store float 0x7FF0000000000000, ptr %x, align 4
17 store float 0x7FF8000000000000, ptr %y, align 4
18 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
19 %1 = fpext float %0 to double ; <double> [#uses=1]
20 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
21 %3 = fpext float %2 to double ; <double> [#uses=1]
22 %4 = frem double %3, %1 ; <double> [#uses=1]
23 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
26 return: ; preds = %entry
30 declare i32 @printf(ptr, ...) nounwind
32 define void @foo2() nounwind {
34 %y = alloca float ; <ptr> [#uses=2]
35 %x = alloca float ; <ptr> [#uses=2]
36 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
37 store float 0x7FF0000000000000, ptr %x, align 4
38 store float 0.000000e+00, ptr %y, align 4
39 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
40 %1 = fpext float %0 to double ; <double> [#uses=1]
41 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
42 %3 = fpext float %2 to double ; <double> [#uses=1]
43 %4 = frem double %3, %1 ; <double> [#uses=1]
44 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
47 return: ; preds = %entry
51 define void @foo3() nounwind {
53 %y = alloca float ; <ptr> [#uses=2]
54 %x = alloca float ; <ptr> [#uses=2]
55 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
56 store float 0x7FF0000000000000, ptr %x, align 4
57 store float 3.500000e+00, ptr %y, align 4
58 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
59 %1 = fpext float %0 to double ; <double> [#uses=1]
60 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
61 %3 = fpext float %2 to double ; <double> [#uses=1]
62 %4 = frem double %3, %1 ; <double> [#uses=1]
63 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
66 return: ; preds = %entry
70 define void @foo4() nounwind {
72 %y = alloca float ; <ptr> [#uses=2]
73 %x = alloca float ; <ptr> [#uses=2]
74 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
75 store float 0x7FF0000000000000, ptr %x, align 4
76 store float 0x7FF0000000000000, ptr %y, align 4
77 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
78 %1 = fpext float %0 to double ; <double> [#uses=1]
79 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
80 %3 = fpext float %2 to double ; <double> [#uses=1]
81 %4 = frem double %3, %1 ; <double> [#uses=1]
82 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
85 return: ; preds = %entry
89 define void @foo5() nounwind {
91 %y = alloca float ; <ptr> [#uses=2]
92 %x = alloca float ; <ptr> [#uses=2]
93 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
94 store float 0x7FF8000000000000, ptr %x, align 4
95 store float 0x7FF0000000000000, ptr %y, align 4
96 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
97 %1 = fpext float %0 to double ; <double> [#uses=1]
98 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
99 %3 = fpext float %2 to double ; <double> [#uses=1]
100 %4 = frem double %3, %1 ; <double> [#uses=1]
101 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
104 return: ; preds = %entry
108 define void @foo6() nounwind {
110 %y = alloca float ; <ptr> [#uses=2]
111 %x = alloca float ; <ptr> [#uses=2]
112 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
113 store float 0x7FF8000000000000, ptr %x, align 4
114 store float 0.000000e+00, ptr %y, align 4
115 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
116 %1 = fpext float %0 to double ; <double> [#uses=1]
117 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
118 %3 = fpext float %2 to double ; <double> [#uses=1]
119 %4 = frem double %3, %1 ; <double> [#uses=1]
120 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
123 return: ; preds = %entry
127 define void @foo7() nounwind {
129 %y = alloca float ; <ptr> [#uses=2]
130 %x = alloca float ; <ptr> [#uses=2]
131 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
132 store float 0x7FF8000000000000, ptr %x, align 4
133 store float 3.500000e+00, ptr %y, align 4
134 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
135 %1 = fpext float %0 to double ; <double> [#uses=1]
136 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
137 %3 = fpext float %2 to double ; <double> [#uses=1]
138 %4 = frem double %3, %1 ; <double> [#uses=1]
139 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
142 return: ; preds = %entry
146 define void @foo8() nounwind {
148 %y = alloca float ; <ptr> [#uses=2]
149 %x = alloca float ; <ptr> [#uses=2]
150 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
151 store float 0x7FF8000000000000, ptr %x, align 4
152 store float 0x7FF8000000000000, ptr %y, align 4
153 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
154 %1 = fpext float %0 to double ; <double> [#uses=1]
155 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
156 %3 = fpext float %2 to double ; <double> [#uses=1]
157 %4 = frem double %3, %1 ; <double> [#uses=1]
158 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
161 return: ; preds = %entry
165 define void @foo9() nounwind {
167 %y = alloca float ; <ptr> [#uses=2]
168 %x = alloca float ; <ptr> [#uses=2]
169 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
170 store float 0.000000e+00, ptr %x, align 4
171 store float 0x7FF8000000000000, ptr %y, align 4
172 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
173 %1 = fpext float %0 to double ; <double> [#uses=1]
174 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
175 %3 = fpext float %2 to double ; <double> [#uses=1]
176 %4 = frem double %3, %1 ; <double> [#uses=1]
177 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
180 return: ; preds = %entry
184 define void @foo10() nounwind {
186 %y = alloca float ; <ptr> [#uses=2]
187 %x = alloca float ; <ptr> [#uses=2]
188 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
189 store float 0.000000e+00, ptr %x, align 4
190 store float 0x7FF0000000000000, ptr %y, align 4
191 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
192 %1 = fpext float %0 to double ; <double> [#uses=1]
193 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
194 %3 = fpext float %2 to double ; <double> [#uses=1]
195 %4 = frem double %3, %1 ; <double> [#uses=1]
196 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
199 return: ; preds = %entry
203 define void @foo11() nounwind {
205 %y = alloca float ; <ptr> [#uses=2]
206 %x = alloca float ; <ptr> [#uses=2]
207 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
208 store float 0.000000e+00, ptr %x, align 4
209 store float 0.000000e+00, ptr %y, align 4
210 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
211 %1 = fpext float %0 to double ; <double> [#uses=1]
212 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
213 %3 = fpext float %2 to double ; <double> [#uses=1]
214 %4 = frem double %3, %1 ; <double> [#uses=1]
215 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
218 return: ; preds = %entry
222 define void @foo12() nounwind {
224 %y = alloca float ; <ptr> [#uses=2]
225 %x = alloca float ; <ptr> [#uses=2]
226 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
227 store float 0.000000e+00, ptr %x, align 4
228 store float 3.500000e+00, ptr %y, align 4
229 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
230 %1 = fpext float %0 to double ; <double> [#uses=1]
231 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
232 %3 = fpext float %2 to double ; <double> [#uses=1]
233 %4 = frem double %3, %1 ; <double> [#uses=1]
234 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
237 return: ; preds = %entry
241 define void @foo13() nounwind {
243 %y = alloca float ; <ptr> [#uses=2]
244 %x = alloca float ; <ptr> [#uses=2]
245 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
246 store float 3.500000e+00, ptr %x, align 4
247 store float 0x7FF8000000000000, ptr %y, align 4
248 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
249 %1 = fpext float %0 to double ; <double> [#uses=1]
250 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
251 %3 = fpext float %2 to double ; <double> [#uses=1]
252 %4 = frem double %3, %1 ; <double> [#uses=1]
253 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
256 return: ; preds = %entry
260 define void @foo14() nounwind {
262 %y = alloca float ; <ptr> [#uses=2]
263 %x = alloca float ; <ptr> [#uses=2]
264 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
265 store float 3.500000e+00, ptr %x, align 4
266 store float 0x7FF0000000000000, ptr %y, align 4
267 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
268 %1 = fpext float %0 to double ; <double> [#uses=1]
269 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
270 %3 = fpext float %2 to double ; <double> [#uses=1]
271 %4 = frem double %3, %1 ; <double> [#uses=1]
272 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
275 return: ; preds = %entry
279 define void @foo15() nounwind {
281 %y = alloca float ; <ptr> [#uses=2]
282 %x = alloca float ; <ptr> [#uses=2]
283 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
284 store float 3.500000e+00, ptr %x, align 4
285 store float 0.000000e+00, ptr %y, align 4
286 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
287 %1 = fpext float %0 to double ; <double> [#uses=1]
288 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
289 %3 = fpext float %2 to double ; <double> [#uses=1]
290 %4 = frem double %3, %1 ; <double> [#uses=1]
291 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
294 return: ; preds = %entry
298 define void @foo16() nounwind {
300 %y = alloca float ; <ptr> [#uses=2]
301 %x = alloca float ; <ptr> [#uses=2]
302 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
303 store float 3.500000e+00, ptr %x, align 4
304 store float 3.500000e+00, ptr %y, align 4
305 %0 = load float, ptr %y, align 4 ; <float> [#uses=1]
306 %1 = fpext float %0 to double ; <double> [#uses=1]
307 %2 = load float, ptr %x, align 4 ; <float> [#uses=1]
308 %3 = fpext float %2 to double ; <double> [#uses=1]
309 %4 = frem double %3, %1 ; <double> [#uses=1]
310 %5 = call i32 (ptr, ...) @printf(ptr @"\01LC", double %4) nounwind ; <i32> [#uses=0]
313 return: ; preds = %entry