llvm.org GIT mirror llvm / e34ade5
Revert 246186; still breaks on some systems git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246191 91177308-0d34-0410-b5e6-96231b3b80d8 Erik Schnetter 4 years ago
2 changed file(s) with 80 addition(s) and 734 deletion(s). Raw diff Collapse all Expand all
12811281 // return true for a name like "cos\0blah" which strcmp would return equal to
12821282 // "cos", but has length 8.
12831283 switch (Name[0]) {
1284 default:
1285 return false;
1284 default: return false;
12861285 case 'a':
1287 return Name == "acos" || Name == "asin" || Name == "atan" ||
1288 Name == "atan2" || Name == "acosf" || Name == "asinf" ||
1289 Name == "atanf" || Name == "atan2f";
1286 return Name == "acos" || Name == "asin" || Name == "atan" || Name =="atan2";
12901287 case 'c':
1291 return Name == "ceil" || Name == "cos" || Name == "cosh" ||
1292 Name == "ceilf" || Name == "cosf" || Name == "coshf";
1288 return Name == "cos" || Name == "ceil" || Name == "cosf" || Name == "cosh";
12931289 case 'e':
1294 return Name == "exp" || Name == "exp2" || Name == "expf" || Name == "exp2f";
1290 return Name == "exp" || Name == "exp2";
12951291 case 'f':
1296 return Name == "fabs" || Name == "floor" || Name == "fmod" ||
1297 Name == "fabsf" || Name == "floorf" || Name == "fmodf";
1292 return Name == "fabs" || Name == "fmod" || Name == "floor";
12981293 case 'l':
1299 return Name == "log" || Name == "log10" || Name == "logf" ||
1300 Name == "log10f";
1294 return Name == "log" || Name == "log10";
13011295 case 'p':
1302 return Name == "pow" || Name == "powf";
1296 return Name == "pow";
13031297 case 's':
13041298 return Name == "sin" || Name == "sinh" || Name == "sqrt" ||
1305 Name == "sinf" || Name == "sinhf" || Name == "sqrtf";
1299 Name == "sinf" || Name == "sqrtf";
13061300 case 't':
1307 return Name == "tan" || Name == "tanh" || Name == "tanf" || Name == "tanhf";
1301 return Name == "tan" || Name == "tanh";
13081302 }
13091303 }
13101304
15001494
15011495 switch (Name[0]) {
15021496 case 'a':
1503 if ((Name == "acos" && TLI->has(LibFunc::acos)) ||
1504 (Name == "acosf" && TLI->has(LibFunc::acosf)))
1497 if (Name == "acos" && TLI->has(LibFunc::acos))
15051498 return ConstantFoldFP(acos, V, Ty);
1506 else if ((Name == "asin" && TLI->has(LibFunc::asin)) ||
1507 (Name == "asinf" && TLI->has(LibFunc::asinf)))
1499 else if (Name == "asin" && TLI->has(LibFunc::asin))
15081500 return ConstantFoldFP(asin, V, Ty);
1509 else if ((Name == "atan" && TLI->has(LibFunc::atan)) ||
1510 (Name == "atanf" && TLI->has(LibFunc::atanf)))
1501 else if (Name == "atan" && TLI->has(LibFunc::atan))
15111502 return ConstantFoldFP(atan, V, Ty);
15121503 break;
15131504 case 'c':
1514 if ((Name == "ceil" && TLI->has(LibFunc::ceil)) ||
1515 (Name == "ceilf" && TLI->has(LibFunc::ceilf)))
1505 if (Name == "ceil" && TLI->has(LibFunc::ceil))
15161506 return ConstantFoldFP(ceil, V, Ty);
1517 else if ((Name == "cos" && TLI->has(LibFunc::cos)) ||
1518 (Name == "cosf" && TLI->has(LibFunc::cosf)))
1507 else if (Name == "cos" && TLI->has(LibFunc::cos))
15191508 return ConstantFoldFP(cos, V, Ty);
1520 else if ((Name == "cosh" && TLI->has(LibFunc::cosh)) ||
1521 (Name == "coshf" && TLI->has(LibFunc::coshf)))
1509 else if (Name == "cosh" && TLI->has(LibFunc::cosh))
15221510 return ConstantFoldFP(cosh, V, Ty);
1511 else if (Name == "cosf" && TLI->has(LibFunc::cosf))
1512 return ConstantFoldFP(cos, V, Ty);
15231513 break;
15241514 case 'e':
1525 if ((Name == "exp" && TLI->has(LibFunc::exp)) ||
1526 (Name == "expf" && TLI->has(LibFunc::expf)))
1515 if (Name == "exp" && TLI->has(LibFunc::exp))
15271516 return ConstantFoldFP(exp, V, Ty);
1528 if ((Name == "exp2" && TLI->has(LibFunc::exp2)) ||
1529 (Name == "exp2f" && TLI->has(LibFunc::exp2f)))
1517
1518 if (Name == "exp2" && TLI->has(LibFunc::exp2)) {
15301519 // Constant fold exp2(x) as pow(2,x) in case the host doesn't have a
15311520 // C99 library.
15321521 return ConstantFoldBinaryFP(pow, 2.0, V, Ty);
1522 }
15331523 break;
15341524 case 'f':
1535 if ((Name == "fabs" && TLI->has(LibFunc::fabs)) ||
1536 (Name == "fabsf" && TLI->has(LibFunc::fabsf)))
1525 if (Name == "fabs" && TLI->has(LibFunc::fabs))
15371526 return ConstantFoldFP(fabs, V, Ty);
1538 else if ((Name == "floor" && TLI->has(LibFunc::floor)) ||
1539 (Name == "floorf" && TLI->has(LibFunc::floorf)))
1527 else if (Name == "floor" && TLI->has(LibFunc::floor))
15401528 return ConstantFoldFP(floor, V, Ty);
15411529 break;
15421530 case 'l':
1543 if ((Name == "log" && V > 0 && TLI->has(LibFunc::log)) ||
1544 (Name == "logf" && V > 0 && TLI->has(LibFunc::logf)))
1531 if (Name == "log" && V > 0 && TLI->has(LibFunc::log))
15451532 return ConstantFoldFP(log, V, Ty);
1546 else if ((Name == "log10" && V > 0 && TLI->has(LibFunc::log10)) ||
1547 (Name == "log10f" && V > 0 && TLI->has(LibFunc::log10f)))
1533 else if (Name == "log10" && V > 0 && TLI->has(LibFunc::log10))
15481534 return ConstantFoldFP(log10, V, Ty);
15491535 else if (IntrinsicID == Intrinsic::sqrt &&
15501536 (Ty->isHalfTy() || Ty->isFloatTy() || Ty->isDoubleTy())) {
15611547 }
15621548 break;
15631549 case 's':
1564 if ((Name == "sin" && TLI->has(LibFunc::sin)) ||
1565 (Name == "sinf" && TLI->has(LibFunc::sinf)))
1550 if (Name == "sin" && TLI->has(LibFunc::sin))
15661551 return ConstantFoldFP(sin, V, Ty);
1567 else if ((Name == "sinh" && TLI->has(LibFunc::sinh)) ||
1568 (Name == "sinhf" && TLI->has(LibFunc::sinhf)))
1552 else if (Name == "sinh" && TLI->has(LibFunc::sinh))
15691553 return ConstantFoldFP(sinh, V, Ty);
1570 else if ((Name == "sqrt" && V >= 0 && TLI->has(LibFunc::sqrt)) ||
1571 (Name == "sqrtf" && V >= 0 && TLI->has(LibFunc::sqrtf)))
1554 else if (Name == "sqrt" && V >= 0 && TLI->has(LibFunc::sqrt))
15721555 return ConstantFoldFP(sqrt, V, Ty);
1556 else if (Name == "sqrtf" && V >= 0 && TLI->has(LibFunc::sqrtf))
1557 return ConstantFoldFP(sqrt, V, Ty);
1558 else if (Name == "sinf" && TLI->has(LibFunc::sinf))
1559 return ConstantFoldFP(sin, V, Ty);
15731560 break;
15741561 case 't':
1575 if ((Name == "tan" && TLI->has(LibFunc::tan)) ||
1576 (Name == "tanf" && TLI->has(LibFunc::tanf)))
1562 if (Name == "tan" && TLI->has(LibFunc::tan))
15771563 return ConstantFoldFP(tan, V, Ty);
1578 else if ((Name == "tanh" && TLI->has(LibFunc::tanh)) ||
1579 (Name == "tanhf" && TLI->has(LibFunc::tanhf)))
1564 else if (Name == "tanh" && TLI->has(LibFunc::tanh))
15801565 return ConstantFoldFP(tanh, V, Ty);
15811566 break;
15821567 default:
16791664
16801665 if (!TLI)
16811666 return nullptr;
1682 if ((Name == "pow" && TLI->has(LibFunc::pow)) ||
1683 (Name == "powf" && TLI->has(LibFunc::powf)))
1667 if (Name == "pow" && TLI->has(LibFunc::pow))
16841668 return ConstantFoldBinaryFP(pow, Op1V, Op2V, Ty);
1685 if ((Name == "fmod" && TLI->has(LibFunc::fmod)) ||
1686 (Name == "fmodf" && TLI->has(LibFunc::fmodf)))
1669 if (Name == "fmod" && TLI->has(LibFunc::fmod))
16871670 return ConstantFoldBinaryFP(fmod, Op1V, Op2V, Ty);
1688 if ((Name == "atan2" && TLI->has(LibFunc::atan2)) ||
1689 (Name == "atan2f" && TLI->has(LibFunc::atan2f)))
1671 if (Name == "atan2" && TLI->has(LibFunc::atan2))
16901672 return ConstantFoldBinaryFP(atan2, Op1V, Op2V, Ty);
16911673 } else if (ConstantInt *Op2C = dyn_cast(Operands[1])) {
16921674 if (IntrinsicID == Intrinsic::powi && Ty->isHalfTy())
0 ; RUN: opt < %s -constprop -S | FileCheck %s
11 ; RUN: opt < %s -constprop -disable-simplify-libcalls -S | FileCheck %s --check-prefix=FNOBUILTIN
22
3 declare double @acos(double)
4 declare double @asin(double)
5 declare double @atan(double)
6 declare double @atan2(double, double)
7 declare double @ceil(double)
83 declare double @cos(double)
9 declare double @cosh(double)
10 declare double @exp(double)
4
5 declare double @sin(double)
6
7 declare double @tan(double)
8
9 declare double @sqrt(double)
1110 declare double @exp2(double)
12 declare double @fabs(double)
13 declare double @floor(double)
14 declare double @fmod(double, double)
15 declare double @log(double)
16 declare double @log10(double)
17 declare double @pow(double, double)
18 declare double @sin(double)
19 declare double @sinh(double)
20 declare double @sqrt(double)
21 declare double @tan(double)
22 declare double @tanh(double)
23
24 declare float @acosf(float)
25 declare float @asinf(float)
26 declare float @atanf(float)
27 declare float @atan2f(float, float)
28 declare float @ceilf(float)
29 declare float @cosf(float)
30 declare float @coshf(float)
31 declare float @expf(float)
32 declare float @exp2f(float)
33 declare float @fabsf(float)
34 declare float @floorf(float)
35 declare float @fmodf(float, float)
36 declare float @logf(float)
37 declare float @log10f(float)
38 declare float @powf(float, float)
39 declare float @sinf(float)
40 declare float @sinhf(float)
41 declare float @sqrtf(float)
42 declare float @tanf(float)
43 declare float @tanhf(float)
4411
4512 define double @T() {
4613 ; CHECK-LABEL: @T(
9764 entry:
9865 ; CHECK-LABEL: @test_intrinsic_pow(
9966 ; CHECK-NOT: call
100 ; CHECK: ret
10167 %0 = call double @llvm.pow.f64(double 1.500000e+00, double 3.000000e+00)
10268 ret double %0
10369 }
10470 declare double @llvm.pow.f64(double, double) nounwind readonly
105
106 define double @test_acos() nounwind uwtable ssp {
107 entry:
108 ; CHECK-LABEL: @test_acos(
109 ; CHECK-NOT: call
110 ; CHECK: ret
111 %0 = call double @acos(double 3.000000e+00)
112 ret double %0
113 }
114
115 define double @test_asin() nounwind uwtable ssp {
116 entry:
117 ; CHECK-LABEL: @test_asin(
118 ; CHECK-NOT: call
119 ; CHECK: ret
120 %0 = call double @asin(double 3.000000e+00)
121 ret double %0
122 }
123
124 define double @test_atan() nounwind uwtable ssp {
125 entry:
126 ; CHECK-LABEL: @test_atan(
127 ; CHECK-NOT: call
128 ; CHECK: ret
129 %0 = call double @atan(double 3.000000e+00)
130 ret double %0
131 }
132
133 define double @test_atan2() nounwind uwtable ssp {
134 entry:
135 ; CHECK-LABEL: @test_atan2(
136 ; CHECK-NOT: call
137 ; CHECK: ret
138 %0 = call double @atan2(double 3.000000e+00, double 4.000000e+00)
139 ret double %0
140 }
141
142 define double @test_ceil() nounwind uwtable ssp {
143 entry:
144 ; CHECK-LABEL: @test_ceil(
145 ; CHECK-NOT: call
146 ; CHECK: ret
147 %0 = call double @ceil(double 3.000000e+00)
148 ret double %0
149 }
150
151 define double @test_cos() nounwind uwtable ssp {
152 entry:
153 ; CHECK-LABEL: @test_cos(
154 ; CHECK-NOT: call
155 ; CHECK: ret
156 %0 = call double @cos(double 3.000000e+00)
157 ret double %0
158 }
159
160 define double @test_cosh() nounwind uwtable ssp {
161 entry:
162 ; CHECK-LABEL: @test_cosh(
163 ; CHECK-NOT: call
164 ; CHECK: ret
165 %0 = call double @cosh(double 3.000000e+00)
166 ret double %0
167 }
168
169 define double @test_exp() nounwind uwtable ssp {
170 entry:
171 ; CHECK-LABEL: @test_exp(
172 ; CHECK-NOT: call
173 ; CHECK: ret
174 %0 = call double @exp(double 3.000000e+00)
175 ret double %0
176 }
177
178 define double @test_exp2() nounwind uwtable ssp {
179 entry:
180 ; CHECK-LABEL: @test_exp2(
181 ; CHECK-NOT: call
182 ; CHECK: ret
183 %0 = call double @exp2(double 3.000000e+00)
184 ret double %0
185 }
186
187 define double @test_fabs() nounwind uwtable ssp {
188 entry:
189 ; CHECK-LABEL: @test_fabs(
190 ; CHECK-NOT: call
191 ; CHECK: ret
192 %0 = call double @fabs(double 3.000000e+00)
193 ret double %0
194 }
195
196 define double @test_floor() nounwind uwtable ssp {
197 entry:
198 ; CHECK-LABEL: @test_floor(
199 ; CHECK-NOT: call
200 ; CHECK: ret
201 %0 = call double @floor(double 3.000000e+00)
202 ret double %0
203 }
204
205 define double @test_fmod() nounwind uwtable ssp {
206 entry:
207 ; CHECK-LABEL: @test_fmod(
208 ; CHECK-NOT: call
209 ; CHECK: ret
210 %0 = call double @fmod(double 3.000000e+00, double 4.000000e+00)
211 ret double %0
212 }
213
214 define double @test_log() nounwind uwtable ssp {
215 entry:
216 ; CHECK-LABEL: @test_log(
217 ; CHECK-NOT: call
218 ; CHECK: ret
219 %0 = call double @log(double 3.000000e+00)
220 ret double %0
221 }
222
223 define double @test_log10() nounwind uwtable ssp {
224 entry:
225 ; CHECK-LABEL: @test_log10(
226 ; CHECK-NOT: call
227 ; CHECK: ret
228 %0 = call double @log10(double 3.000000e+00)
229 ret double %0
230 }
231
232 define double @test_pow() nounwind uwtable ssp {
233 entry:
234 ; CHECK-LABEL: @test_pow(
235 ; CHECK-NOT: call
236 ; CHECK: ret
237 %0 = call double @pow(double 3.000000e+00, double 4.000000e+00)
238 ret double %0
239 }
240
241 define double @test_sin() nounwind uwtable ssp {
242 entry:
243 ; CHECK-LABEL: @test_sin(
244 ; CHECK-NOT: call
245 ; CHECK: ret
246 %0 = call double @sin(double 3.000000e+00)
247 ret double %0
248 }
249
250 define double @test_sinh() nounwind uwtable ssp {
251 entry:
252 ; CHECK-LABEL: @test_sinh(
253 ; CHECK-NOT: call
254 ; CHECK: ret
255 %0 = call double @sinh(double 3.000000e+00)
256 ret double %0
257 }
258
259 define double @test_sqrt() nounwind uwtable ssp {
260 entry:
261 ; CHECK-LABEL: @test_sqrt(
262 ; CHECK-NOT: call
263 ; CHECK: ret
264 %0 = call double @sqrt(double 3.000000e+00)
265 ret double %0
266 }
267
268 define double @test_tan() nounwind uwtable ssp {
269 entry:
270 ; CHECK-LABEL: @test_tan(
271 ; CHECK-NOT: call
272 ; CHECK: ret
273 %0 = call double @tan(double 3.000000e+00)
274 ret double %0
275 }
276
277 define double @test_tanh() nounwind uwtable ssp {
278 entry:
279 ; CHECK-LABEL: @test_tanh(
280 ; CHECK-NOT: call
281 ; CHECK: ret
282 %0 = call double @tanh(double 3.000000e+00)
283 ret double %0
284 }
285
286 define float @test_acosf() nounwind uwtable ssp {
287 entry:
288 ; CHECK-LABEL: @test_acosf(
289 ; CHECK-NOT: call
290 ; CHECK: ret
291 %0 = call float @acosf(float 3.000000e+00)
292 ret float %0
293 }
294
295 define float @test_asinf() nounwind uwtable ssp {
296 entry:
297 ; CHECK-LABEL: @test_asinf(
298 ; CHECK-NOT: call
299 ; CHECK: ret
300 %0 = call float @asinf(float 3.000000e+00)
301 ret float %0
302 }
303
304 define float @test_atanf() nounwind uwtable ssp {
305 entry:
306 ; CHECK-LABEL: @test_atanf(
307 ; CHECK-NOT: call
308 ; CHECK: ret
309 %0 = call float @atanf(float 3.000000e+00)
310 ret float %0
311 }
312
313 define float @test_atan2f() nounwind uwtable ssp {
314 entry:
315 ; CHECK-LABEL: @test_atan2f(
316 ; CHECK-NOT: call
317 ; CHECK: ret
318 %0 = call float @atan2f(float 3.000000e+00, float 4.000000e+00)
319 ret float %0
320 }
321
322 define float @test_ceilf() nounwind uwtable ssp {
323 entry:
324 ; CHECK-LABEL: @test_ceilf(
325 ; CHECK-NOT: call
326 ; CHECK: ret
327 %0 = call float @ceilf(float 3.000000e+00)
328 ret float %0
329 }
330
331 define float @test_cosf() nounwind uwtable ssp {
332 entry:
333 ; CHECK-LABEL: @test_cosf(
334 ; CHECK-NOT: call
335 ; CHECK: ret
336 %0 = call float @cosf(float 3.000000e+00)
337 ret float %0
338 }
339
340 define float @test_coshf() nounwind uwtable ssp {
341 entry:
342 ; CHECK-LABEL: @test_coshf(
343 ; CHECK-NOT: call
344 ; CHECK: ret
345 %0 = call float @coshf(float 3.000000e+00)
346 ret float %0
347 }
348
349 define float @test_expf() nounwind uwtable ssp {
350 entry:
351 ; CHECK-LABEL: @test_expf(
352 ; CHECK-NOT: call
353 ; CHECK: ret
354 %0 = call float @expf(float 3.000000e+00)
355 ret float %0
356 }
357
358 define float @test_exp2f() nounwind uwtable ssp {
359 entry:
360 ; CHECK-LABEL: @test_exp2f(
361 ; CHECK-NOT: call
362 ; CHECK: ret
363 %0 = call float @exp2f(float 3.000000e+00)
364 ret float %0
365 }
366
367 define float @test_fabsf() nounwind uwtable ssp {
368 entry:
369 ; CHECK-LABEL: @test_fabsf(
370 ; CHECK-NOT: call
371 ; CHECK: ret
372 %0 = call float @fabsf(float 3.000000e+00)
373 ret float %0
374 }
375
376 define float @test_floorf() nounwind uwtable ssp {
377 entry:
378 ; CHECK-LABEL: @test_floorf(
379 ; CHECK-NOT: call
380 ; CHECK: ret
381 %0 = call float @floorf(float 3.000000e+00)
382 ret float %0
383 }
384
385 define float @test_fmodf() nounwind uwtable ssp {
386 entry:
387 ; CHECK-LABEL: @test_fmodf(
388 ; CHECK-NOT: call
389 ; CHECK: ret
390 %0 = call float @fmodf(float 3.000000e+00, float 4.000000e+00)
391 ret float %0
392 }
393
394 define float @test_logf() nounwind uwtable ssp {
395 entry:
396 ; CHECK-LABEL: @test_logf(
397 ; CHECK-NOT: call
398 ; CHECK: ret
399 %0 = call float @logf(float 3.000000e+00)
400 ret float %0
401 }
402
403 define float @test_log10f() nounwind uwtable ssp {
404 entry:
405 ; CHECK-LABEL: @test_log10f(
406 ; CHECK-NOT: call
407 ; CHECK: ret
408 %0 = call float @log10f(float 3.000000e+00)
409 ret float %0
410 }
411
412 define float @test_powf() nounwind uwtable ssp {
413 entry:
414 ; CHECK-LABEL: @test_powf(
415 ; CHECK-NOT: call
416 ; CHECK: ret
417 %0 = call float @powf(float 3.000000e+00, float 4.000000e+00)
418 ret float %0
419 }
420
421 define float @test_sinf() nounwind uwtable ssp {
422 entry:
423 ; CHECK-LABEL: @test_sinf(
424 ; CHECK-NOT: call
425 ; CHECK: ret
426 %0 = call float @sinf(float 3.000000e+00)
427 ret float %0
428 }
429
430 define float @test_sinhf() nounwind uwtable ssp {
431 entry:
432 ; CHECK-LABEL: @test_sinhf(
433 ; CHECK-NOT: call
434 ; CHECK: ret
435 %0 = call float @sinhf(float 3.000000e+00)
436 ret float %0
437 }
438
439 define float @test_sqrtf() nounwind uwtable ssp {
440 entry:
441 ; CHECK-LABEL: @test_sqrtf(
442 ; CHECK-NOT: call
443 ; CHECK: ret
444 %0 = call float @sqrtf(float 3.000000e+00)
445 ret float %0
446 }
447
448 define float @test_tanf() nounwind uwtable ssp {
449 entry:
450 ; CHECK-LABEL: @test_tanf(
451 ; CHECK-NOT: call
452 ; CHECK: ret
453 %0 = call float @tanf(float 3.000000e+00)
454 ret float %0
455 }
456
457 define float @test_tanhf() nounwind uwtable ssp {
458 entry:
459 ; CHECK-LABEL: @test_tanhf(
460 ; CHECK-NOT: call
461 ; CHECK: ret
462 %0 = call float @tanhf(float 3.000000e+00)
463 ret float %0
464 }
465
466 ; Shouldn't fold because of -fno-builtin
467 define double @acos_() nounwind uwtable ssp {
468 ; FNOBUILTIN-LABEL: @acos_(
469 ; FNOBUILTIN: %1 = call double @acos(double 3.000000e+00)
470 %1 = call double @acos(double 3.000000e+00)
471 ret double %1
472 }
473
474 ; Shouldn't fold because of -fno-builtin
475 define double @asin_() nounwind uwtable ssp {
476 ; FNOBUILTIN-LABEL: @asin_(
477 ; FNOBUILTIN: %1 = call double @asin(double 3.000000e+00)
478 %1 = call double @asin(double 3.000000e+00)
479 ret double %1
480 }
481
482 ; Shouldn't fold because of -fno-builtin
483 define double @atan_() nounwind uwtable ssp {
484 ; FNOBUILTIN-LABEL: @atan_(
485 ; FNOBUILTIN: %1 = call double @atan(double 3.000000e+00)
486 %1 = call double @atan(double 3.000000e+00)
487 ret double %1
488 }
489
490 ; Shouldn't fold because of -fno-builtin
491 define double @atan2_() nounwind uwtable ssp {
492 ; FNOBUILTIN-LABEL: @atan2_(
493 ; FNOBUILTIN: %1 = call double @atan2(double 3.000000e+00, double 4.000000e+00)
494 %1 = call double @atan2(double 3.000000e+00, double 4.000000e+00)
495 ret double %1
496 }
497
498 ; Shouldn't fold because of -fno-builtin
499 define double @ceil_() nounwind uwtable ssp {
500 ; FNOBUILTIN-LABEL: @ceil_(
501 ; FNOBUILTIN: %1 = call double @ceil(double 3.000000e+00)
502 %1 = call double @ceil(double 3.000000e+00)
503 ret double %1
504 }
505
506 ; Shouldn't fold because of -fno-builtin
507 define double @cos_() nounwind uwtable ssp {
508 ; FNOBUILTIN-LABEL: @cos_(
509 ; FNOBUILTIN: %1 = call double @cos(double 3.000000e+00)
510 %1 = call double @cos(double 3.000000e+00)
511 ret double %1
512 }
513
514 ; Shouldn't fold because of -fno-builtin
515 define double @cosh_() nounwind uwtable ssp {
516 ; FNOBUILTIN-LABEL: @cosh_(
517 ; FNOBUILTIN: %1 = call double @cosh(double 3.000000e+00)
518 %1 = call double @cosh(double 3.000000e+00)
519 ret double %1
520 }
521
522 ; Shouldn't fold because of -fno-builtin
523 define double @exp_() nounwind uwtable ssp {
524 ; FNOBUILTIN-LABEL: @exp_(
525 ; FNOBUILTIN: %1 = call double @exp(double 3.000000e+00)
526 %1 = call double @exp(double 3.000000e+00)
527 ret double %1
528 }
529
530 ; Shouldn't fold because of -fno-builtin
531 define double @exp2_() nounwind uwtable ssp {
532 ; FNOBUILTIN-LABEL: @exp2_(
533 ; FNOBUILTIN: %1 = call double @exp2(double 3.000000e+00)
534 %1 = call double @exp2(double 3.000000e+00)
535 ret double %1
536 }
537
538 ; Shouldn't fold because of -fno-builtin
539 define double @fabs_() nounwind uwtable ssp {
540 ; FNOBUILTIN-LABEL: @fabs_(
541 ; FNOBUILTIN: %1 = call double @fabs(double 3.000000e+00)
542 %1 = call double @fabs(double 3.000000e+00)
543 ret double %1
544 }
545
546 ; Shouldn't fold because of -fno-builtin
547 define double @floor_() nounwind uwtable ssp {
548 ; FNOBUILTIN-LABEL: @floor_(
549 ; FNOBUILTIN: %1 = call double @floor(double 3.000000e+00)
550 %1 = call double @floor(double 3.000000e+00)
551 ret double %1
552 }
553
554 ; Shouldn't fold because of -fno-builtin
555 define double @fmod_() nounwind uwtable ssp {
556 ; FNOBUILTIN-LABEL: @fmod_(
557 ; FNOBUILTIN: %1 = call double @fmod(double 3.000000e+00, double 4.000000e+00)
558 %1 = call double @fmod(double 3.000000e+00, double 4.000000e+00)
559 ret double %1
560 }
561
562 ; Shouldn't fold because of -fno-builtin
563 define double @log_() nounwind uwtable ssp {
564 ; FNOBUILTIN-LABEL: @log_(
565 ; FNOBUILTIN: %1 = call double @log(double 3.000000e+00)
566 %1 = call double @log(double 3.000000e+00)
567 ret double %1
568 }
569
570 ; Shouldn't fold because of -fno-builtin
571 define double @log10_() nounwind uwtable ssp {
572 ; FNOBUILTIN-LABEL: @log10_(
573 ; FNOBUILTIN: %1 = call double @log10(double 3.000000e+00)
574 %1 = call double @log10(double 3.000000e+00)
575 ret double %1
576 }
577
578 ; Shouldn't fold because of -fno-builtin
579 define double @pow_() nounwind uwtable ssp {
580 ; FNOBUILTIN-LABEL: @pow_(
581 ; FNOBUILTIN: %1 = call double @pow(double 3.000000e+00, double 4.000000e+00)
582 %1 = call double @pow(double 3.000000e+00, double 4.000000e+00)
583 ret double %1
584 }
58571
58672 ; Shouldn't fold because of -fno-builtin
58773 define double @sin_() nounwind uwtable ssp {
59278 }
59379
59480 ; Shouldn't fold because of -fno-builtin
595 define double @sinh_() nounwind uwtable ssp {
596 ; FNOBUILTIN-LABEL: @sinh_(
597 ; FNOBUILTIN: %1 = call double @sinh(double 3.000000e+00)
598 %1 = call double @sinh(double 3.000000e+00)
599 ret double %1
600 }
601
602 ; Shouldn't fold because of -fno-builtin
60381 define double @sqrt_() nounwind uwtable ssp {
60482 ; FNOBUILTIN-LABEL: @sqrt_(
60583 ; FNOBUILTIN: %1 = call double @sqrt(double 3.000000e+00)
60684 %1 = call double @sqrt(double 3.000000e+00)
60785 ret double %1
60886 }
87
88 ; Shouldn't fold because of -fno-builtin
89 define float @sqrtf_() nounwind uwtable ssp {
90 ; FNOBUILTIN-LABEL: @sqrtf_(
91 ; FNOBUILTIN: %1 = call float @sqrtf(float 3.000000e+00)
92 %1 = call float @sqrtf(float 3.000000e+00)
93 ret float %1
94 }
95 declare float @sqrtf(float)
96
97 ; Shouldn't fold because of -fno-builtin
98 define float @sinf_() nounwind uwtable ssp {
99 ; FNOBUILTIN-LABEL: @sinf_(
100 ; FNOBUILTIN: %1 = call float @sinf(float 3.000000e+00)
101 %1 = call float @sinf(float 3.000000e+00)
102 ret float %1
103 }
104 declare float @sinf(float)
609105
610106 ; Shouldn't fold because of -fno-builtin
611107 define double @tan_() nounwind uwtable ssp {
622118 %1 = call double @tanh(double 3.000000e+00)
623119 ret double %1
624120 }
121 declare double @tanh(double)
625122
626123 ; Shouldn't fold because of -fno-builtin
627 define float @acosf_() nounwind uwtable ssp {
628 ; FNOBUILTIN-LABEL: @acosf_(
629 ; FNOBUILTIN: %1 = call float @acosf(float 3.000000e+00)
630 %1 = call float @acosf(float 3.000000e+00)
631 ret float %1
124 define double @pow_() nounwind uwtable ssp {
125 ; FNOBUILTIN-LABEL: @pow_(
126 ; FNOBUILTIN: %1 = call double @pow(double 3.000000e+00, double 3.000000e+00)
127 %1 = call double @pow(double 3.000000e+00, double 3.000000e+00)
128 ret double %1
632129 }
130 declare double @pow(double, double)
633131
634132 ; Shouldn't fold because of -fno-builtin
635 define float @asinf_() nounwind uwtable ssp {
636 ; FNOBUILTIN-LABEL: @asinf_(
637 ; FNOBUILTIN: %1 = call float @asinf(float 3.000000e+00)
638 %1 = call float @asinf(float 3.000000e+00)
639 ret float %1
133 define double @fmod_() nounwind uwtable ssp {
134 ; FNOBUILTIN-LABEL: @fmod_(
135 ; FNOBUILTIN: %1 = call double @fmod(double 3.000000e+00, double 3.000000e+00)
136 %1 = call double @fmod(double 3.000000e+00, double 3.000000e+00)
137 ret double %1
640138 }
139 declare double @fmod(double, double)
641140
642141 ; Shouldn't fold because of -fno-builtin
643 define float @atanf_() nounwind uwtable ssp {
644 ; FNOBUILTIN-LABEL: @atanf_(
645 ; FNOBUILTIN: %1 = call float @atanf(float 3.000000e+00)
646 %1 = call float @atanf(float 3.000000e+00)
647 ret float %1
142 define double @atan2_() nounwind uwtable ssp {
143 ; FNOBUILTIN-LABEL: @atan2_(
144 ; FNOBUILTIN: %1 = call double @atan2(double 3.000000e+00, double 3.000000e+00)
145 %1 = call double @atan2(double 3.000000e+00, double 3.000000e+00)
146 ret double %1
648147 }
649
650 ; Shouldn't fold because of -fno-builtin
651 define float @atan2f_() nounwind uwtable ssp {
652 ; FNOBUILTIN-LABEL: @atan2f_(
653 ; FNOBUILTIN: %1 = call float @atan2f(float 3.000000e+00, float 4.000000e+00)
654 %1 = call float @atan2f(float 3.000000e+00, float 4.000000e+00)
655 ret float %1
656 }
657
658 ; Shouldn't fold because of -fno-builtin
659 define float @ceilf_() nounwind uwtable ssp {
660 ; FNOBUILTIN-LABEL: @ceilf_(
661 ; FNOBUILTIN: %1 = call float @ceilf(float 3.000000e+00)
662 %1 = call float @ceilf(float 3.000000e+00)
663 ret float %1
664 }
665
666 ; Shouldn't fold because of -fno-builtin
667 define float @cosf_() nounwind uwtable ssp {
668 ; FNOBUILTIN-LABEL: @cosf_(
669 ; FNOBUILTIN: %1 = call float @cosf(float 3.000000e+00)
670 %1 = call float @cosf(float 3.000000e+00)
671 ret float %1
672 }
673
674 ; Shouldn't fold because of -fno-builtin
675 define float @coshf_() nounwind uwtable ssp {
676 ; FNOBUILTIN-LABEL: @coshf_(
677 ; FNOBUILTIN: %1 = call float @coshf(float 3.000000e+00)
678 %1 = call float @coshf(float 3.000000e+00)
679 ret float %1
680 }
681
682 ; Shouldn't fold because of -fno-builtin
683 define float @expf_() nounwind uwtable ssp {
684 ; FNOBUILTIN-LABEL: @expf_(
685 ; FNOBUILTIN: %1 = call float @expf(float 3.000000e+00)
686 %1 = call float @expf(float 3.000000e+00)
687 ret float %1
688 }
689
690 ; Shouldn't fold because of -fno-builtin
691 define float @exp2f_() nounwind uwtable ssp {
692 ; FNOBUILTIN-LABEL: @exp2f_(
693 ; FNOBUILTIN: %1 = call float @exp2f(float 3.000000e+00)
694 %1 = call float @exp2f(float 3.000000e+00)
695 ret float %1
696 }
697
698 ; Shouldn't fold because of -fno-builtin
699 define float @fabsf_() nounwind uwtable ssp {
700 ; FNOBUILTIN-LABEL: @fabsf_(
701 ; FNOBUILTIN: %1 = call float @fabsf(float 3.000000e+00)
702 %1 = call float @fabsf(float 3.000000e+00)
703 ret float %1
704 }
705
706 ; Shouldn't fold because of -fno-builtin
707 define float @floorf_() nounwind uwtable ssp {
708 ; FNOBUILTIN-LABEL: @floorf_(
709 ; FNOBUILTIN: %1 = call float @floorf(float 3.000000e+00)
710 %1 = call float @floorf(float 3.000000e+00)
711 ret float %1
712 }
713
714 ; Shouldn't fold because of -fno-builtin
715 define float @fmodf_() nounwind uwtable ssp {
716 ; FNOBUILTIN-LABEL: @fmodf_(
717 ; FNOBUILTIN: %1 = call float @fmodf(float 3.000000e+00, float 4.000000e+00)
718 %1 = call float @fmodf(float 3.000000e+00, float 4.000000e+00)
719 ret float %1
720 }
721
722 ; Shouldn't fold because of -fno-builtin
723 define float @logf_() nounwind uwtable ssp {
724 ; FNOBUILTIN-LABEL: @logf_(
725 ; FNOBUILTIN: %1 = call float @logf(float 3.000000e+00)
726 %1 = call float @logf(float 3.000000e+00)
727 ret float %1
728 }
729
730 ; Shouldn't fold because of -fno-builtin
731 define float @log10f_() nounwind uwtable ssp {
732 ; FNOBUILTIN-LABEL: @log10f_(
733 ; FNOBUILTIN: %1 = call float @log10f(float 3.000000e+00)
734 %1 = call float @log10f(float 3.000000e+00)
735 ret float %1
736 }
737
738 ; Shouldn't fold because of -fno-builtin
739 define float @powf_() nounwind uwtable ssp {
740 ; FNOBUILTIN-LABEL: @powf_(
741 ; FNOBUILTIN: %1 = call float @powf(float 3.000000e+00, float 4.000000e+00)
742 %1 = call float @powf(float 3.000000e+00, float 4.000000e+00)
743 ret float %1
744 }
745
746 ; Shouldn't fold because of -fno-builtin
747 define float @sinf_() nounwind uwtable ssp {
748 ; FNOBUILTIN-LABEL: @sinf_(
749 ; FNOBUILTIN: %1 = call float @sinf(float 3.000000e+00)
750 %1 = call float @sinf(float 3.000000e+00)
751 ret float %1
752 }
753
754 ; Shouldn't fold because of -fno-builtin
755 define float @sinhf_() nounwind uwtable ssp {
756 ; FNOBUILTIN-LABEL: @sinhf_(
757 ; FNOBUILTIN: %1 = call float @sinhf(float 3.000000e+00)
758 %1 = call float @sinhf(float 3.000000e+00)
759 ret float %1
760 }
761
762 ; Shouldn't fold because of -fno-builtin
763 define float @sqrtf_() nounwind uwtable ssp {
764 ; FNOBUILTIN-LABEL: @sqrtf_(
765 ; FNOBUILTIN: %1 = call float @sqrtf(float 3.000000e+00)
766 %1 = call float @sqrtf(float 3.000000e+00)
767 ret float %1
768 }
769
770 ; Shouldn't fold because of -fno-builtin
771 define float @tanf_() nounwind uwtable ssp {
772 ; FNOBUILTIN-LABEL: @tanf_(
773 ; FNOBUILTIN: %1 = call float @tanf(float 3.000000e+00)
774 %1 = call float @tanf(float 3.000000e+00)
775 ret float %1
776 }
777
778 ; Shouldn't fold because of -fno-builtin
779 define float @tanhf_() nounwind uwtable ssp {
780 ; FNOBUILTIN-LABEL: @tanhf_(
781 ; FNOBUILTIN: %1 = call float @tanhf(float 3.000000e+00)
782 %1 = call float @tanhf(float 3.000000e+00)
783 ret float %1
784 }
148 declare double @atan2(double, double)