]> granicus.if.org Git - llvm/commitdiff
[SimplifyLibCalls] Define the value of the Euler number
authorEvandro Menezes <e.menezes@samsung.com>
Mon, 30 Sep 2019 23:21:02 +0000 (23:21 +0000)
committerEvandro Menezes <e.menezes@samsung.com>
Mon, 30 Sep 2019 23:21:02 +0000 (23:21 +0000)
This patch fixes the build break on Windows hosts.

There must be a better way of accessing the equivalent POSIX math constant
`M_E`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373274 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/SimplifyLibCalls.cpp

index b252167ba27d45785b6942a56462392a48f530ae..3af754a3eb0383cdc5ec91a6b594485f34c978ac 100644 (file)
@@ -1941,7 +1941,9 @@ Value *LibCallSimplifier::optimizeLog(CallInst *Log, IRBuilder<> &B) {
            ArgID == Intrinsic::exp || ArgID == Intrinsic::exp2) {
     Constant *Eul;
     if (ArgLb == ExpLb || ArgID == Intrinsic::exp)
-      Eul = ConstantFP::get(Log->getType(), M_E);
+      // 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);
     else if (ArgLb == Exp2Lb || ArgID == Intrinsic::exp2)
       Eul = ConstantFP::get(Log->getType(), 2.0);
     else