Lines Matching refs:IVOperand
72 Value *foldIVUser(Instruction *UseInst, Instruction *IVOperand);
74 bool eliminateIVUser(Instruction *UseInst, Instruction *IVOperand);
75 void eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand);
76 void eliminateIVRemainder(BinaryOperator *Rem, Value *IVOperand,
84 /// IVOperand is guaranteed SCEVable, but UseInst may not be.
86 /// Return the operand of IVOperand for this induction variable if IVOperand can
89 Value *SimplifyIndvar::foldIVUser(Instruction *UseInst, Instruction *IVOperand) {
100 if (IVOperand != UseInst->getOperand(OperIdx) ||
106 if (!isa<BinaryOperator>(IVOperand)
107 || !isa<ConstantInt>(IVOperand->getOperand(1)))
110 IVSrc = IVOperand->getOperand(0);
134 DEBUG(dbgs() << "INDVARS: Eliminated IV operand: " << *IVOperand
142 if (IVOperand->use_empty())
143 DeadInsts.push_back(IVOperand);
149 void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) {
152 if (IVOperand != ICmp->getOperand(0)) {
154 assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand");
186 Value *IVOperand,
190 if (IVOperand != Rem->getOperand(0))
236 /// IVOperand is guaranteed SCEVable, but UseInst may not be.
238 Instruction *IVOperand) {
240 eliminateIVComparison(ICmp, IVOperand);
246 eliminateIVRemainder(Rem, IVOperand, IsSigned);
253 (UseInst->getType() != IVOperand->getType()) ||
254 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand)))
259 UseInst->replaceAllUsesWith(IVOperand);
340 Instruction *IVOperand = UseOper.second;
341 for (unsigned N = 0; IVOperand; ++N) {
344 Value *NewOper = foldIVUser(UseOper.first, IVOperand);
347 IVOperand = dyn_cast<Instruction>(NewOper);
349 if (!IVOperand)
352 if (eliminateIVUser(UseOper.first, IVOperand)) {
353 pushIVUsers(IVOperand, Simplified, SimpleIVUsers);