Lines Matching refs:UseInst
70 Value *foldIVUser(Instruction *UseInst, Instruction *IVOperand);
72 bool eliminateIVUser(Instruction *UseInst, Instruction *IVOperand);
91 Value *SimplifyIndvar::foldIVUser(Instruction *UseInst, Instruction *IVOperand) { in foldIVUser() argument
95 switch (UseInst->getOpcode()) { in foldIVUser()
102 if (IVOperand != UseInst->getOperand(OperIdx) || in foldIVUser()
103 !isa<ConstantInt>(UseInst->getOperand(1))) in foldIVUser()
116 ConstantInt *D = cast<ConstantInt>(UseInst->getOperand(1)); in foldIVUser()
117 if (UseInst->getOpcode() == Instruction::LShr) { in foldIVUser()
119 uint32_t BitWidth = cast<IntegerType>(UseInst->getType())->getBitWidth(); in foldIVUser()
123 D = ConstantInt::get(UseInst->getContext(), in foldIVUser()
129 if (!SE->isSCEVable(UseInst->getType())) in foldIVUser()
133 if (SE->getSCEV(UseInst) != FoldedExpr) in foldIVUser()
137 << " -> " << *UseInst << '\n'); in foldIVUser()
139 UseInst->setOperand(OperIdx, IVSrc); in foldIVUser()
140 assert(SE->getSCEV(UseInst) == FoldedExpr && "bad SCEV with folded oper"); in foldIVUser()
239 bool SimplifyIndvar::eliminateIVUser(Instruction *UseInst, in eliminateIVUser() argument
241 if (ICmpInst *ICmp = dyn_cast<ICmpInst>(UseInst)) { in eliminateIVUser()
245 if (BinaryOperator *Rem = dyn_cast<BinaryOperator>(UseInst)) { in eliminateIVUser()
254 if (!SE->isSCEVable(UseInst->getType()) || in eliminateIVUser()
255 (UseInst->getType() != IVOperand->getType()) || in eliminateIVUser()
256 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand))) in eliminateIVUser()
259 DEBUG(dbgs() << "INDVARS: Eliminated identity: " << *UseInst << '\n'); in eliminateIVUser()
261 UseInst->replaceAllUsesWith(IVOperand); in eliminateIVUser()
264 DeadInsts.push_back(UseInst); in eliminateIVUser()
365 if (Instruction *UseInst = dyn_cast<Instruction>(U.getUser())) { in splitOverflowIntrinsic() local
366 BasicBlock *UseBB = UseInst->getParent(); in splitOverflowIntrinsic()
367 if (PHINode *PHI = dyn_cast<PHINode>(UseInst)) in splitOverflowIntrinsic()
463 Instruction *UseInst = UseOper.first; in simplifyUsers() local
466 if (UseInst == CurrIV) continue; in simplifyUsers()
469 UseInst = splitOverflowIntrinsic(UseInst, V->getDomTree()); in simplifyUsers()
470 if (!UseInst) in simplifyUsers()