mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-04 16:47:41 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32539 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5ae9cebef5
commit
21a55c9f08
@ -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))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user