Lines Matching refs:IVOperand
70 Value *foldIVUser(Instruction *UseInst, Instruction *IVOperand);
72 bool eliminateIdentitySCEV(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,
78 bool strengthenOverflowingOperation(BinaryOperator *OBO, Value *IVOperand);
93 Value *SimplifyIndvar::foldIVUser(Instruction *UseInst, Instruction *IVOperand) { in foldIVUser() argument
104 if (IVOperand != UseInst->getOperand(OperIdx) || in foldIVUser()
110 if (!isa<BinaryOperator>(IVOperand) in foldIVUser()
111 || !isa<ConstantInt>(IVOperand->getOperand(1))) in foldIVUser()
114 IVSrc = IVOperand->getOperand(0); in foldIVUser()
138 DEBUG(dbgs() << "INDVARS: Eliminated IV operand: " << *IVOperand in foldIVUser()
146 if (IVOperand->use_empty()) in foldIVUser()
147 DeadInsts.emplace_back(IVOperand); in foldIVUser()
153 void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) { in eliminateIVComparison() argument
156 if (IVOperand != ICmp->getOperand(0)) { in eliminateIVComparison()
158 assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand"); in eliminateIVComparison()
185 } else if (isa<PHINode>(IVOperand) && in eliminateIVComparison()
204 for (Value *Incoming : cast<PHINode>(IVOperand)->incoming_values()) { in eliminateIVComparison()
236 Value *IVOperand, in eliminateIVRemainder() argument
240 if (IVOperand != Rem->getOperand(0)) in eliminateIVRemainder()
287 Instruction *IVOperand) { in eliminateIVUser() argument
289 eliminateIVComparison(ICmp, IVOperand); in eliminateIVUser()
295 eliminateIVRemainder(Rem, IVOperand, IsSigned); in eliminateIVUser()
300 if (eliminateIdentitySCEV(UseInst, IVOperand)) in eliminateIVUser()
308 Instruction *IVOperand) { in eliminateIdentitySCEV() argument
310 (UseInst->getType() != IVOperand->getType()) || in eliminateIdentitySCEV()
311 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand))) in eliminateIdentitySCEV()
333 if (!DT || !DT->dominates(IVOperand, UseInst)) in eliminateIdentitySCEV()
336 if (!LI->replacementPreservesLCSSAForm(UseInst, IVOperand)) in eliminateIdentitySCEV()
341 UseInst->replaceAllUsesWith(IVOperand); in eliminateIdentitySCEV()
351 Value *IVOperand) { in strengthenOverflowingOperation() argument
554 Instruction *IVOperand = UseOper.second; in simplifyUsers() local
555 for (unsigned N = 0; IVOperand; ++N) { in simplifyUsers()
558 Value *NewOper = foldIVUser(UseOper.first, IVOperand); in simplifyUsers()
561 IVOperand = dyn_cast<Instruction>(NewOper); in simplifyUsers()
563 if (!IVOperand) in simplifyUsers()
566 if (eliminateIVUser(UseOper.first, IVOperand)) { in simplifyUsers()
567 pushIVUsers(IVOperand, Simplified, SimpleIVUsers); in simplifyUsers()
573 strengthenOverflowingOperation(BO, IVOperand)) { in simplifyUsers()
576 pushIVUsers(IVOperand, Simplified, SimpleIVUsers); in simplifyUsers()