summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-29 06:09:11 +0000
committerChris Lattner <sabre@nondot.org>2008-02-29 06:09:11 +0000
commitc6125715552a744c5cbc993b1a7c29f0c81fe129 (patch)
treeb52522d16aef6482e848ba1bdce8b0d8ef245d8c /llvm/lib/Transforms
parentca7c61e79a0dccb00e4c70f6e8a8a2e21c891049 (diff)
downloadbcm5719-llvm-c6125715552a744c5cbc993b1a7c29f0c81fe129.tar.gz
bcm5719-llvm-c6125715552a744c5cbc993b1a7c29f0c81fe129.zip
Folding or(fcmp,fcmp) only works if the operands of the fcmps are the same fp type.
llvm-svn: 47750
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 1614d23d988..1000ba60367 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -4287,7 +4287,8 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
if (FCmpInst *LHS = dyn_cast<FCmpInst>(I.getOperand(0))) {
if (FCmpInst *RHS = dyn_cast<FCmpInst>(I.getOperand(1))) {
if (LHS->getPredicate() == FCmpInst::FCMP_UNO &&
- RHS->getPredicate() == FCmpInst::FCMP_UNO)
+ RHS->getPredicate() == FCmpInst::FCMP_UNO &&
+ LHS->getOperand(0)->getType() == RHS->getOperand(0)->getType())
if (ConstantFP *LHSC = dyn_cast<ConstantFP>(LHS->getOperand(1)))
if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
// If either of the constants are nans, then the whole thing returns
OpenPOWER on IntegriCloud