summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-08-13 20:14:27 +0000
committerSanjay Patel <spatel@rotateright.com>2018-08-13 20:14:27 +0000
commit981f50919e20af957dc147ec429ef0cd397e49f6 (patch)
tree68ffdab5aa42aded5d2a409733f2e6e4ac568858 /llvm/lib/Transforms/Utils
parent753bc5496b6ed20db4fd153328633d2118f072da (diff)
downloadbcm5719-llvm-981f50919e20af957dc147ec429ef0cd397e49f6.tar.gz
bcm5719-llvm-981f50919e20af957dc147ec429ef0cd397e49f6.zip
[SimplifyLibCalls] don't drop fast-math-flags on trig reflection folds
llvm-svn: 339608
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index eda3f059e69..599d50b46cb 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -1124,7 +1124,9 @@ Value *LibCallSimplifier::optimizeCAbs(CallInst *CI, IRBuilder<> &B) {
static Value *optimizeTrigReflections(CallInst *Call, LibFunc Func,
IRBuilder<> &B) {
- // FIXME: This drops FMF.
+ IRBuilder<>::FastMathFlagGuard Guard(B);
+ B.setFastMathFlags(Call->getFastMathFlags());
+
// TODO: Add tan() and other calls.
// TODO: Can this be shared to also handle LLVM intrinsics?
Value *X;
OpenPOWER on IntegriCloud