mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +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.
|
// formed.
|
||||||
CastInst *BoolCast = 0;
|
CastInst *BoolCast = 0;
|
||||||
if (CastInst *CI = dyn_cast<CastInst>(I.getOperand(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;
|
BoolCast = CI;
|
||||||
if (!BoolCast)
|
if (!BoolCast)
|
||||||
if (CastInst *CI = dyn_cast<CastInst>(I.getOperand(1)))
|
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;
|
BoolCast = CI;
|
||||||
if (BoolCast) {
|
if (BoolCast) {
|
||||||
if (SetCondInst *SCI = dyn_cast<SetCondInst>(BoolCast->getOperand(0))) {
|
if (SetCondInst *SCI = dyn_cast<SetCondInst>(BoolCast->getOperand(0))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user