diff options
author | Owen Anderson <resistor@mac.com> | 2013-02-07 00:21:34 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2013-02-07 00:21:34 +0000 |
commit | ec643abe6903284fc9ae7b6d9ae5e0b4ad40ad28 (patch) | |
tree | fed80233a33989203470c21cfae7ba95096849e7 /lib/Analysis | |
parent | 42258e0ea8781dd29cae4b1a6eb54d8c70dcea0b (diff) | |
download | external_llvm-ec643abe6903284fc9ae7b6d9ae5e0b4ad40ad28.zip external_llvm-ec643abe6903284fc9ae7b6d9ae5e0b4ad40ad28.tar.gz external_llvm-ec643abe6903284fc9ae7b6d9ae5e0b4ad40ad28.tar.bz2 |
Conditionalize constant folding of math intrinsics on the availability of an implementation on the host. This is a little bit unfortunate, but until someone decides to implement a full libm for APFloat, we don't have a better way to get this functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174561 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/ConstantFolding.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index e499c73..26e3888 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -1282,16 +1282,26 @@ llvm::ConstantFoldCall(Function *F, ArrayRef<Constant *> Operands, default: break; case Intrinsic::fabs: return ConstantFoldFP(fabs, V, Ty); +#if HAVE_LOG2 case Intrinsic::log2: return ConstantFoldFP(log2, V, Ty); +#endif +#if HAVE_LOG case Intrinsic::log: return ConstantFoldFP(log, V, Ty); +#endif +#if HAVE_LOG10 case Intrinsic::log10: return ConstantFoldFP(log10, V, Ty); +#endif +#if HAVE_EXP case Intrinsic::exp: return ConstantFoldFP(exp, V, Ty); +#endif +#if HAVE_EXP2 case Intrinsic::exp2: return ConstantFoldFP(exp2, V, Ty); +#endif case Intrinsic::floor: return ConstantFoldFP(floor, V, Ty); } |