make sure to also check that it is a zext from bool, not any other cast
operation type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32539
91177308-0d34-0410-b5e6-
96231b3b80d8
// 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))) {