diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-12-31 21:52:31 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-12-31 21:52:31 +0000 |
commit | aa23114cb46bc35c95c2c38a98e16b38c8d29670 (patch) | |
tree | de410c704afcd6d5aa399b2de473776d2dadc63e /llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | |
parent | f6f32bcaa470ec6a45a0b57426c573388a47ddc7 (diff) | |
download | bcm5719-llvm-aa23114cb46bc35c95c2c38a98e16b38c8d29670.tar.gz bcm5719-llvm-aa23114cb46bc35c95c2c38a98e16b38c8d29670.zip |
[LibCallSimplifier] propagate FMF when shrinking unary calls
llvm-svn: 256679
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp index ea49131e937..2eba5fe31e0 100644 --- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -994,6 +994,10 @@ Value *LibCallSimplifier::optimizeUnaryDoubleFP(CallInst *CI, IRBuilder<> &B, Value *V = valueHasFloatPrecision(CI->getArgOperand(0)); if (V == nullptr) return nullptr; + + // Propagate fast-math flags from the existing call to the new call. + IRBuilder<>::FastMathFlagGuard Guard(B); + B.SetFastMathFlags(CI->getFastMathFlags()); // floor((double)floatval) -> (double)floorf(floatval) if (Callee->isIntrinsic()) { |