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 | 132ae8b9550d5dda70c0e9dada6cb92d903cb4b7 (patch) | |
tree | 9ad1d0fbf2b5b614d874e5e6aefec0db1387aa7a /llvm/lib/Analysis/ConstantFolding.cpp | |
parent | 5dc3899ca417b344a272c109837f62a7ac840235 (diff) | |
download | bcm5719-llvm-132ae8b9550d5dda70c0e9dada6cb92d903cb4b7.tar.gz bcm5719-llvm-132ae8b9550d5dda70c0e9dada6cb92d903cb4b7.zip |
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.
llvm-svn: 174561
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | llvm/lib/Analysis/ConstantFolding.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index e499c73566c..26e38886f60 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/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); } |