From b665fc7193d25a756054ab5959e7da9f04e56cf5 Mon Sep 17 00:00:00 2001 From: Evandro Menezes Date: Mon, 30 Sep 2019 23:21:02 +0000 Subject: [PATCH] [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`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373274 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/SimplifyLibCalls.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Utils/SimplifyLibCalls.cpp b/lib/Transforms/Utils/SimplifyLibCalls.cpp index b252167ba27..3af754a3eb0 100644 --- a/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -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 -- 2.40.0