diff options
| author | Evandro Menezes <e.menezes@samsung.com> | 2019-10-09 19:58:01 +0000 |
|---|---|---|
| committer | Evandro Menezes <e.menezes@samsung.com> | 2019-10-09 19:58:01 +0000 |
| commit | e60415a0db2b1696c016ad21821cc2704ee18811 (patch) | |
| tree | 05680cdc96773d35d6f85c813ef3ae18195505a1 /llvm/lib/Transforms | |
| parent | 2e6f6b4dadbf2af58646bbddec45bd3233fe3d19 (diff) | |
| download | bcm5719-llvm-e60415a0db2b1696c016ad21821cc2704ee18811.tar.gz bcm5719-llvm-e60415a0db2b1696c016ad21821cc2704ee18811.zip | |
[Support] Add mathematical constants
Add own version of the mathematical constants from the upcoming C++20 `std::numbers`.
Differential revision: https://reviews.llvm.org/D68257
llvm-svn: 374207
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp index 1fb4f28f336..461a5e2cba0 100644 --- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -48,7 +48,6 @@ static cl::opt<bool> cl::desc("Enable unsafe double to float " "shrinking for math lib calls")); - //===----------------------------------------------------------------------===// // Helper Functions //===----------------------------------------------------------------------===// @@ -1941,9 +1940,8 @@ Value *LibCallSimplifier::optimizeLog(CallInst *Log, IRBuilder<> &B) { ArgID == Intrinsic::exp || ArgID == Intrinsic::exp2) { Constant *Eul; if (ArgLb == ExpLb || ArgID == Intrinsic::exp) - // FIXME: The Euler number should be M_E, but it's place of definition - // is not quite standard. - Eul = ConstantFP::get(Log->getType(), 2.7182818284590452354); + // FIXME: Add more precise value of e for long double. + Eul = ConstantFP::get(Log->getType(), numbers::e); else if (ArgLb == Exp2Lb || ArgID == Intrinsic::exp2) Eul = ConstantFP::get(Log->getType(), 2.0); else |

