Make sure that we're dealing with a binary SCEVExpr when simplifying.

llvm-svn: 157704
This commit is contained in:
Benjamin Kramer 2012-05-30 18:42:43 +00:00
parent 2dca201f54
commit 3fecff028d

View File

@ -5654,7 +5654,8 @@ bool ScalarEvolution::SimplifyICmpOperands(ICmpInst::Predicate &Pred,
if (!RA)
if (const SCEVAddExpr *AE = dyn_cast<SCEVAddExpr>(LHS))
if (const SCEVMulExpr *ME = dyn_cast<SCEVMulExpr>(AE->getOperand(0)))
if (ME->getOperand(0)->isAllOnesValue()) {
if (AE->getNumOperands() == 2 && ME->getNumOperands() == 2 &&
ME->getOperand(0)->isAllOnesValue()) {
RHS = AE->getOperand(1);
LHS = ME->getOperand(1);
Changed = true;