Lines Matching refs:IVOperand
69 Value *foldIVUser(Instruction *UseInst, Instruction *IVOperand);
71 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);
90 Value *SimplifyIndvar::foldIVUser(Instruction *UseInst, Instruction *IVOperand) { in foldIVUser() argument
101 if (IVOperand != UseInst->getOperand(OperIdx) || in foldIVUser()
107 if (!isa<BinaryOperator>(IVOperand) in foldIVUser()
108 || !isa<ConstantInt>(IVOperand->getOperand(1))) in foldIVUser()
111 IVSrc = IVOperand->getOperand(0); in foldIVUser()
135 DEBUG(dbgs() << "INDVARS: Eliminated IV operand: " << *IVOperand in foldIVUser()
143 if (IVOperand->use_empty()) in foldIVUser()
144 DeadInsts.emplace_back(IVOperand); in foldIVUser()
150 void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) { in eliminateIVComparison() argument
153 if (IVOperand != ICmp->getOperand(0)) { in eliminateIVComparison()
155 assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand"); in eliminateIVComparison()
182 } else if (isa<PHINode>(IVOperand) && in eliminateIVComparison()
200 auto *PN = cast<PHINode>(IVOperand); in eliminateIVComparison()
271 Value *IVOperand, in eliminateIVRemainder() argument
275 if (IVOperand != Rem->getOperand(0)) in eliminateIVRemainder()
424 Instruction *IVOperand) { in eliminateIVUser() argument
426 eliminateIVComparison(ICmp, IVOperand); in eliminateIVUser()
432 eliminateIVRemainder(Rem, IVOperand, IsSigned); in eliminateIVUser()
441 if (eliminateIdentitySCEV(UseInst, IVOperand)) in eliminateIVUser()
449 Instruction *IVOperand) { in eliminateIdentitySCEV() argument
451 (UseInst->getType() != IVOperand->getType()) || in eliminateIdentitySCEV()
452 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand))) in eliminateIdentitySCEV()
474 if (!DT || !DT->dominates(IVOperand, UseInst)) in eliminateIdentitySCEV()
477 if (!LI->replacementPreservesLCSSAForm(UseInst, IVOperand)) in eliminateIdentitySCEV()
482 UseInst->replaceAllUsesWith(IVOperand); in eliminateIdentitySCEV()
492 Value *IVOperand) { in strengthenOverflowingOperation() argument
626 Instruction *IVOperand = UseOper.second; in simplifyUsers() local
627 for (unsigned N = 0; IVOperand; ++N) { in simplifyUsers()
630 Value *NewOper = foldIVUser(UseOper.first, IVOperand); in simplifyUsers()
633 IVOperand = dyn_cast<Instruction>(NewOper); in simplifyUsers()
635 if (!IVOperand) in simplifyUsers()
638 if (eliminateIVUser(UseOper.first, IVOperand)) { in simplifyUsers()
639 pushIVUsers(IVOperand, Simplified, SimpleIVUsers); in simplifyUsers()
645 strengthenOverflowingOperation(BO, IVOperand)) { in simplifyUsers()
648 pushIVUsers(IVOperand, Simplified, SimpleIVUsers); in simplifyUsers()