summaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2014-01-16 21:07:52 +0000
committerOwen Anderson <resistor@mac.com>2014-01-16 21:07:52 +0000
commit5d9450f92f559bec20ef2ce253ab7bdf5e75216b (patch)
tree8aa0478e8b1dd06552268231c1c755663b18f759 /lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
parentda5e148474e717918af06024d0b2ead54373f3f9 (diff)
downloadllvm-5d9450f92f559bec20ef2ce253ab7bdf5e75216b.tar.gz
llvm-5d9450f92f559bec20ef2ce253ab7bdf5e75216b.tar.bz2
llvm-5d9450f92f559bec20ef2ce253ab7bdf5e75216b.tar.xz
Fix an instance where we would drop fast math flags when performing an fdiv to reciprocal multiply transformation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199425 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineMulDivRem.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineMulDivRem.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index 94461c5f84..f61d82340b 100644
--- a/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -1050,8 +1050,10 @@ Instruction *InstCombiner::visitFDiv(BinaryOperator &I) {
}
// X / C => X * 1/C
- if (Instruction *T = CvtFDivConstToReciprocal(Op0, Op1C, AllowReciprocal))
+ if (Instruction *T = CvtFDivConstToReciprocal(Op0, Op1C, AllowReciprocal)) {
+ T->copyFastMathFlags(&I);
return T;
+ }
return 0;
}