Lines Matching defs:IVOperand

77     Value *foldIVUser(Instruction *UseInst, Instruction *IVOperand);
79 bool eliminateIVUser(Instruction *UseInst, Instruction *IVOperand);
80 void eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand);
81 void eliminateIVRemainder(BinaryOperator *Rem, Value *IVOperand,
92 /// IVOperand is guaranteed SCEVable, but UseInst may not be.
94 /// Return the operand of IVOperand for this induction variable if IVOperand can
97 Value *SimplifyIndvar::foldIVUser(Instruction *UseInst, Instruction *IVOperand) {
108 if (IVOperand != UseInst->getOperand(OperIdx) ||
114 if (!isa<BinaryOperator>(IVOperand)
115 || !isa<ConstantInt>(IVOperand->getOperand(1)))
118 IVSrc = IVOperand->getOperand(0);
142 DEBUG(dbgs() << "INDVARS: Eliminated IV operand: " << *IVOperand
150 if (IVOperand->use_empty())
151 DeadInsts.push_back(IVOperand);
157 void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) {
160 if (IVOperand != ICmp->getOperand(0)) {
162 assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand");
194 Value *IVOperand,
198 if (IVOperand != Rem->getOperand(0))
244 /// IVOperand is guaranteed SCEVable, but UseInst may not be.
246 Instruction *IVOperand) {
248 eliminateIVComparison(ICmp, IVOperand);
254 eliminateIVRemainder(Rem, IVOperand, IsSigned);
261 (UseInst->getType() != IVOperand->getType()) ||
262 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand)))
267 UseInst->replaceAllUsesWith(IVOperand);
418 Instruction *IVOperand = UseOper.second;
419 for (unsigned N = 0; IVOperand; ++N) {
422 Value *NewOper = foldIVUser(UseOper.first, IVOperand);
425 IVOperand = dyn_cast<Instruction>(NewOper);
427 if (!IVOperand)
430 if (eliminateIVUser(UseOper.first, IVOperand)) {
431 pushIVUsers(IVOperand, Simplified, SimpleIVUsers);