[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Reid Spencer
reid at x10sys.com
Wed Dec 13 00:33:48 PST 2006
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.567 -> 1.568
---
Log message:
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.
---
Diffs of the changes: (+4 -2)
InstructionCombining.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.568
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567 Wed Dec 13 02:27:15 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Dec 13 02:33:33 2006
@@ -2172,11 +2172,13 @@
// 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))) {
More information about the llvm-commits
mailing list