Lines Matching full:icmp
75 void eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand);
149 void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) {
151 ICmpInst::Predicate Pred = ICmp->getPredicate();
152 if (IVOperand != ICmp->getOperand(0)) {
154 assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand");
159 // Get the SCEVs for the ICmp operands.
160 const SCEV *S = SE->getSCEV(ICmp->getOperand(IVOperIdx));
161 const SCEV *X = SE->getSCEV(ICmp->getOperand(1 - IVOperIdx));
164 const Loop *ICmpLoop = LI->getLoopFor(ICmp->getParent());
171 ICmp->replaceAllUsesWith(ConstantInt::getTrue(ICmp->getContext()));
173 ICmp->replaceAllUsesWith(ConstantInt::getFalse(ICmp->getContext()));
177 DEBUG(dbgs() << "INDVARS: Eliminated comparison: " << *ICmp << '\n');
180 DeadInsts.push_back(ICmp);
193 // Get the SCEVs for the ICmp operands.
219 ICmpInst *ICmp = new ICmpInst(Rem, ICmpInst::ICMP_EQ,
222 SelectInst::Create(ICmp,
239 if (ICmpInst *ICmp = dyn_cast<ICmpInst>(UseInst)) {
240 eliminateIVComparison(ICmp, IVOperand);