aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/InstCombine/InstCombineCompares.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-03-31 10:46:03 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-03-31 10:46:03 +0000
commit00e00d693c3991d85ffebf305ddbfd5dfb99ead6 (patch)
treee2176c3d0f03bd1d85a82eb479afafecd38319ed /lib/Transforms/InstCombine/InstCombineCompares.cpp
parent68b4bd0a63156a9f57210243bc5a8959e93b24fa (diff)
downloadexternal_llvm-00e00d693c3991d85ffebf305ddbfd5dfb99ead6.tar.gz
external_llvm-00e00d693c3991d85ffebf305ddbfd5dfb99ead6.tar.bz2
external_llvm-00e00d693c3991d85ffebf305ddbfd5dfb99ead6.zip
InstCombine: Fix transform to use the swapped predicate.
Thanks Frits! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCompares.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCompares.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp
index cb434bda57..3e549d9428 100644
--- a/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -2855,10 +2855,10 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
}
}
- // fcmp (fneg x), (fneg y) -> fcmp x, y
+ // fcmp pred (fneg x), (fneg y) -> fcmp swap(pred) x, y
Value *X, *Y;
if (match(Op0, m_FNeg(m_Value(X))) && match(Op1, m_FNeg(m_Value(Y))))
- return new FCmpInst(I.getPredicate(), X, Y);
+ return new FCmpInst(I.getSwappedPredicate(), X, Y);
// fcmp (fpext x), (fpext y) -> fcmp x, y
if (FPExtInst *LHSExt = dyn_cast<FPExtInst>(Op0))