aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-03-31 10:12:22 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-03-31 10:12:22 +0000
commit68b4bd0a63156a9f57210243bc5a8959e93b24fa (patch)
tree2a5710eba7c95b81b204107ff67e6deaab541d7a /lib
parent0db50189dcde3408134e9011052ed8b731ec303a (diff)
downloadexternal_llvm-68b4bd0a63156a9f57210243bc5a8959e93b24fa.zip
external_llvm-68b4bd0a63156a9f57210243bc5a8959e93b24fa.tar.gz
external_llvm-68b4bd0a63156a9f57210243bc5a8959e93b24fa.tar.bz2
InstCombine: fold fcmp (fneg x), (fneg y) -> fcmp x, y
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCompares.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 6743885..cb434bd 100644
--- a/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -2855,6 +2855,11 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
}
}
+ // fcmp (fneg x), (fneg y) -> fcmp 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);
+
// fcmp (fpext x), (fpext y) -> fcmp x, y
if (FPExtInst *LHSExt = dyn_cast<FPExtInst>(Op0))
if (FPExtInst *RHSExt = dyn_cast<FPExtInst>(Op1))