if (!isa<ConstantInt>(InitV) || !cast<ConstantInt>(InitV)->isZero())
continue;
Value *IterV = PN->getIncomingValueForBlock(BB);
- if (!isa<BinaryOperator>(IterV))
- continue;
auto *BO = dyn_cast<BinaryOperator>(IterV);
+ if (!BO)
+ continue;
if (BO->getOpcode() != Instruction::Add)
continue;
Value *IncV = nullptr;
// See if the pointer expression is an AddRec like {base,+,1} on the current
// loop, which indicates a strided load. If we have something else, it's a
// random load we can't handle.
- LoadInst *LI = dyn_cast<LoadInst>(SI->getValueOperand());
+ auto *LI = cast<LoadInst>(SI->getValueOperand());
auto *LoadEv = cast<SCEVAddRecExpr>(SE->getSCEV(LI->getPointerOperand()));
// The trip count of the loop and the base pointer of the addrec SCEV is