summaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-04-12 21:56:23 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-04-12 21:56:23 +0000
commit6ac927860610d134f2a35119abff6eb2d81846a1 (patch)
tree654dd8ca899627dcaee95553f6fb25ea7698b551 /lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
parenta74f91e44cd9df787081304235d34c89ac642652 (diff)
downloadllvm-6ac927860610d134f2a35119abff6eb2d81846a1.tar.gz
llvm-6ac927860610d134f2a35119abff6eb2d81846a1.tar.bz2
llvm-6ac927860610d134f2a35119abff6eb2d81846a1.tar.xz
InstCombine: Check the operand types before merging fcmp ord & fcmp ord.
Fixes PR15737. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineAndOrXor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index a40dafa3b1..a7f0149487 100644
--- a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -934,6 +934,9 @@ Value *InstCombiner::FoldAndOfICmps(ICmpInst *LHS, ICmpInst *RHS) {
Value *InstCombiner::FoldAndOfFCmps(FCmpInst *LHS, FCmpInst *RHS) {
if (LHS->getPredicate() == FCmpInst::FCMP_ORD &&
RHS->getPredicate() == FCmpInst::FCMP_ORD) {
+ if (LHS->getOperand(0)->getType() != RHS->getOperand(0)->getType())
+ return 0;
+
// (fcmp ord x, c) & (fcmp ord y, c) -> (fcmp ord x, y)
if (ConstantFP *LHSC = dyn_cast<ConstantFP>(LHS->getOperand(1)))
if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {