Lines Matching refs:UseInst
69 Value *foldIVUser(Instruction *UseInst, Instruction *IVOperand);
71 bool eliminateIVUser(Instruction *UseInst, Instruction *IVOperand);
90 Value *SimplifyIndvar::foldIVUser(Instruction *UseInst, Instruction *IVOperand) { in foldIVUser() argument
94 switch (UseInst->getOpcode()) { in foldIVUser()
101 if (IVOperand != UseInst->getOperand(OperIdx) || in foldIVUser()
102 !isa<ConstantInt>(UseInst->getOperand(1))) in foldIVUser()
115 ConstantInt *D = cast<ConstantInt>(UseInst->getOperand(1)); in foldIVUser()
116 if (UseInst->getOpcode() == Instruction::LShr) { in foldIVUser()
118 uint32_t BitWidth = cast<IntegerType>(UseInst->getType())->getBitWidth(); in foldIVUser()
122 D = ConstantInt::get(UseInst->getContext(), in foldIVUser()
128 if (!SE->isSCEVable(UseInst->getType())) in foldIVUser()
132 if (SE->getSCEV(UseInst) != FoldedExpr) in foldIVUser()
136 << " -> " << *UseInst << '\n'); in foldIVUser()
138 UseInst->setOperand(OperIdx, IVSrc); in foldIVUser()
139 assert(SE->getSCEV(UseInst) == FoldedExpr && "bad SCEV with folded oper"); in foldIVUser()
238 bool SimplifyIndvar::eliminateIVUser(Instruction *UseInst, in eliminateIVUser() argument
240 if (ICmpInst *ICmp = dyn_cast<ICmpInst>(UseInst)) { in eliminateIVUser()
244 if (BinaryOperator *Rem = dyn_cast<BinaryOperator>(UseInst)) { in eliminateIVUser()
253 if (!SE->isSCEVable(UseInst->getType()) || in eliminateIVUser()
254 (UseInst->getType() != IVOperand->getType()) || in eliminateIVUser()
255 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand))) in eliminateIVUser()
258 DEBUG(dbgs() << "INDVARS: Eliminated identity: " << *UseInst << '\n'); in eliminateIVUser()
260 UseInst->replaceAllUsesWith(IVOperand); in eliminateIVUser()
263 DeadInsts.emplace_back(UseInst); in eliminateIVUser()
364 if (Instruction *UseInst = dyn_cast<Instruction>(U.getUser())) { in splitOverflowIntrinsic() local
365 BasicBlock *UseBB = UseInst->getParent(); in splitOverflowIntrinsic()
366 if (PHINode *PHI = dyn_cast<PHINode>(UseInst)) in splitOverflowIntrinsic()
462 Instruction *UseInst = UseOper.first; in simplifyUsers() local
465 if (UseInst == CurrIV) continue; in simplifyUsers()
468 UseInst = splitOverflowIntrinsic(UseInst, V->getDomTree()); in simplifyUsers()
469 if (!UseInst) in simplifyUsers()