summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-13 08:33:33 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-13 08:33:33 +0000
commit612683b0d736f9b807b57d8783f29273fc4c9435 (patch)
treea5528b183451bed703c818a26349948dbb5ededa /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parent799b5bfc71e9f0de3d0c3539a1554813e4c2658a (diff)
downloadbcm5719-llvm-612683b0d736f9b807b57d8783f29273fc4c9435.tar.gz
bcm5719-llvm-612683b0d736f9b807b57d8783f29273fc4c9435.zip
For mul transforms, when checking for a cast from bool as either operand,
make sure to also check that it is a zext from bool, not any other cast operation type. llvm-svn: 32539
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 232e504971c..68089c2dd36 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2172,11 +2172,13 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
// formed.
CastInst *BoolCast = 0;
if (CastInst *CI = dyn_cast<CastInst>(I.getOperand(0)))
- if (CI->getOperand(0)->getType() == Type::BoolTy)
+ if (CI->getOperand(0)->getType() == Type::BoolTy &&
+ CI->getOpcode() == Instruction::ZExt)
BoolCast = CI;
if (!BoolCast)
if (CastInst *CI = dyn_cast<CastInst>(I.getOperand(1)))
- if (CI->getOperand(0)->getType() == Type::BoolTy)
+ if (CI->getOperand(0)->getType() == Type::BoolTy &&
+ CI->getOpcode() == Instruction::ZExt)
BoolCast = CI;
if (BoolCast) {
if (SetCondInst *SCI = dyn_cast<SetCondInst>(BoolCast->getOperand(0))) {
OpenPOWER on IntegriCloud