PR7750: !CExpr->isNullValue() only properly computes whether CExpr is nonnull
if CExpr is a ConstantInt. llvm-svn: 109773
This commit is contained in:
parent
b2c657c618
commit
0428a61e45
|
@ -1374,7 +1374,7 @@ Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI,
|
||||||
case Instruction::Or:
|
case Instruction::Or:
|
||||||
// If bits are being or'd in that are not present in the constant we
|
// If bits are being or'd in that are not present in the constant we
|
||||||
// are comparing against, then the comparison could never succeed!
|
// are comparing against, then the comparison could never succeed!
|
||||||
if (Constant *BOC = dyn_cast<Constant>(BO->getOperand(1))) {
|
if (ConstantInt *BOC = dyn_cast<ConstantInt>(BO->getOperand(1))) {
|
||||||
Constant *NotCI = ConstantExpr::getNot(RHS);
|
Constant *NotCI = ConstantExpr::getNot(RHS);
|
||||||
if (!ConstantExpr::getAnd(BOC, NotCI)->isNullValue())
|
if (!ConstantExpr::getAnd(BOC, NotCI)->isNullValue())
|
||||||
return ReplaceInstUsesWith(ICI,
|
return ReplaceInstUsesWith(ICI,
|
||||||
|
|
Loading…
Reference in New Issue