diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-31 10:12:22 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-31 10:12:22 +0000 |
commit | 68b4bd0a63156a9f57210243bc5a8959e93b24fa (patch) | |
tree | 2a5710eba7c95b81b204107ff67e6deaab541d7a /lib | |
parent | 0db50189dcde3408134e9011052ed8b731ec303a (diff) | |
download | external_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.cpp | 5 |
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)) |