diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-31 10:11:58 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-31 10:11:58 +0000 |
commit | cd0274ca189040a2fd883b00a678184afc2cda3a (patch) | |
tree | 891e6633d316d3d59d67988a0b022554538c8072 /lib | |
parent | 021cf96ffc954250f500c9721ff4aad409a47434 (diff) | |
download | external_llvm-cd0274ca189040a2fd883b00a678184afc2cda3a.zip external_llvm-cd0274ca189040a2fd883b00a678184afc2cda3a.tar.gz external_llvm-cd0274ca189040a2fd883b00a678184afc2cda3a.tar.bz2 |
InstCombine: fold fcmp (fpext x), (fpext y) -> fcmp x, y.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineCompares.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp index 8787e2a..698b715 100644 --- a/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2813,5 +2813,12 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) { } } + // fcmp (fpext x), (fpext y) -> fcmp x, y + if (FPExtInst *LHSExt = dyn_cast<FPExtInst>(Op0)) + if (FPExtInst *RHSExt = dyn_cast<FPExtInst>(Op1)) + if (LHSExt->getSrcTy() == RHSExt->getSrcTy()) + return new FCmpInst(I.getPredicate(), LHSExt->getOperand(0), + RHSExt->getOperand(0)); + return Changed ? &I : 0; } |