|
57 | 57 | #include <cassert> |
58 | 58 | #include <cerrno> |
59 | 59 | #include <cfenv> |
60 | | -#include <cfloat> |
61 | 60 | #include <cmath> |
62 | 61 | #include <cstdint> |
63 | 62 |
|
@@ -1699,9 +1698,9 @@ bool llvm::canConstantFoldCallTo(const CallBase *Call, const Function *F) { |
1699 | 1698 | Name == "sinh" || Name == "sinhf" || |
1700 | 1699 | Name == "sqrt" || Name == "sqrtf"; |
1701 | 1700 | case 't': |
1702 | | - return Name == "tan" || Name == "tanf" || Name == "tanh" || |
1703 | | - Name == "tanhf" || Name == "trunc" || Name == "truncf" || |
1704 | | - Name == "tgamma" || Name == "tgammaf"; |
| 1701 | + return Name == "tan" || Name == "tanf" || |
| 1702 | + Name == "tanh" || Name == "tanhf" || |
| 1703 | + Name == "trunc" || Name == "truncf"; |
1705 | 1704 | case '_': |
1706 | 1705 | // Check for various function names that get used for the math functions |
1707 | 1706 | // when the header files are preprocessed with the macro |
@@ -2418,14 +2417,6 @@ static Constant *ConstantFoldScalarCall1(StringRef Name, |
2418 | 2417 | if (TLI->has(Func)) |
2419 | 2418 | return ConstantFoldFP(erf, APF, Ty); |
2420 | 2419 | break; |
2421 | | - case LibFunc_tgamma: |
2422 | | - case LibFunc_tgammaf: |
2423 | | - // NOTE: These boundaries are somewhat conservative. |
2424 | | - if (TLI->has(Func) && |
2425 | | - (Ty->isDoubleTy() && APF > APFloat(DBL_MIN) && APF < APFloat(171.0) || |
2426 | | - Ty->isFloatTy() && APF > APFloat(FLT_MIN) && APF < APFloat(35.0f))) |
2427 | | - return ConstantFoldFP(tgamma, APF, Ty); |
2428 | | - break; |
2429 | 2420 | case LibFunc_nearbyint: |
2430 | 2421 | case LibFunc_nearbyintf: |
2431 | 2422 | case LibFunc_rint: |
@@ -3638,10 +3629,6 @@ bool llvm::isMathLibCallNoop(const CallBase *Call, |
3638 | 3629 | case LibFunc_sqrtf: |
3639 | 3630 | return Op.isNaN() || Op.isZero() || !Op.isNegative(); |
3640 | 3631 |
|
3641 | | - case LibFunc_tgamma: |
3642 | | - case LibFunc_tgammaf: |
3643 | | - return true; |
3644 | | - |
3645 | 3632 | // FIXME: Add more functions: sqrt_finite, atanh, expm1, log1p, |
3646 | 3633 | // maybe others? |
3647 | 3634 | default: |
|
0 commit comments