aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-03-31 10:11:58 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-03-31 10:11:58 +0000
commitcd0274ca189040a2fd883b00a678184afc2cda3a (patch)
tree891e6633d316d3d59d67988a0b022554538c8072 /lib
parent021cf96ffc954250f500c9721ff4aad409a47434 (diff)
downloadexternal_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.cpp7
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;
}