summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commitd159d946449def169bff0fc86e0f6b20d59cf475 (patch)
treeaec06be04987a76b5d655a7162d65ea6ee7f6517 /llvm/lib/Transforms
parenta8c5d0872d64a5ae3deaa7ed839a00f72169d3b2 (diff)
downloadbcm5719-llvm-d159d946449def169bff0fc86e0f6b20d59cf475.tar.gz
bcm5719-llvm-d159d946449def169bff0fc86e0f6b20d59cf475.zip
InstCombine: fold fcmp (fneg x), (fneg y) -> fcmp x, y
llvm-svn: 128627
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 6743885cd42..cb434bda57a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/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))
OpenPOWER on IntegriCloud