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 | d159d946449def169bff0fc86e0f6b20d59cf475 (patch) | |
| tree | aec06be04987a76b5d655a7162d65ea6ee7f6517 /llvm/lib/Transforms | |
| parent | a8c5d0872d64a5ae3deaa7ed839a00f72169d3b2 (diff) | |
| download | bcm5719-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.cpp | 5 |
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)) |

