[llvm] r373274 - [SimplifyLibCalls] Define the value of the Euler number
Evandro Menezes via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 30 16:21:02 PDT 2019
Author: evandro
Date: Mon Sep 30 16:21:02 2019
New Revision: 373274
URL: http://llvm.org/viewvc/llvm-project?rev=373274&view=rev
Log:
[SimplifyLibCalls] Define the value of the Euler number
This patch fixes the build break on Windows hosts.
There must be a better way of accessing the equivalent POSIX math constant
`M_E`.
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp?rev=373274&r1=373273&r2=373274&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp Mon Sep 30 16:21:02 2019
@@ -1941,7 +1941,9 @@ Value *LibCallSimplifier::optimizeLog(Ca
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
More information about the llvm-commits
mailing list