summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 975cb83b8f3..c1c904b331a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -5467,9 +5467,10 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
Value *X, *Y;
if (match(Op0, m_FNeg(m_Value(X)))) {
if (match(Op1, m_FNeg(m_Value(Y)))) {
- // FIXME: Drops FMF.
// fcmp pred (fneg X), (fneg Y) -> fcmp swap(pred) X, Y
- return new FCmpInst(I.getSwappedPredicate(), X, Y);
+ Instruction *NewFCmp = new FCmpInst(I.getSwappedPredicate(), X, Y);
+ NewFCmp->copyFastMathFlags(&I);
+ return NewFCmp;
}
Constant *C;
OpenPOWER on IntegriCloud