Lines Matching refs:UserInst
1028 /// UserInst - The instruction which will be updated.
1029 Instruction *UserInst;
1061 : UserInst(0), OperandValToReplace(0), LUIdx(~size_t(0)), Offset(0) {}
1067 if (const PHINode *PN = dyn_cast<PHINode>(UserInst)) {
1075 return !L->contains(UserInst);
1079 OS << "UserInst=";
1081 if (StoreInst *Store = dyn_cast<StoreInst>(UserInst)) {
1084 } else if (UserInst->getType()->isVoidTy())
1085 OS << UserInst->getOpcodeName();
1087 WriteAsOperand(OS, UserInst, /*PrintType=*/false);
1181 /// used to formulate a replacement for OperandValToReplace in UserInst.
1530 Instruction *UserInst;
1535 UserInst(U), IVOperand(O), IncExpr(E) {}
1566 // tailUserInst - Returns the last UserInst in the chain.
1567 Instruction *tailUserInst() const { return Incs.back().UserInst; }
1632 void ChainInstruction(Instruction *UserInst, Instruction *IVOper,
2488 DEBUG(dbgs() << "Chain: " << *Chain.Incs[0].UserInst << " users:\n";
2547 DEBUG(dbgs() << "Chain: " << *Chain.Incs[0].UserInst << " Cost: " << cost
2555 void LSRInstance::ChainInstruction(Instruction *UserInst, Instruction *IVOper,
2582 if (isa<PHINode>(UserInst) && isa<PHINode>(Chain.tailUserInst()))
2599 if (isa<PHINode>(UserInst))
2612 IVChainVec.push_back(IVChain(IVInc(UserInst, IVOper, LastIncExpr),
2615 DEBUG(dbgs() << "IV Chain#" << ChainIdx << " Head: (" << *UserInst
2618 DEBUG(dbgs() << "IV Chain#" << ChainIdx << " Inc: (" << *UserInst
2621 IVChainVec[ChainIdx].add(IVInc(UserInst, IVOper, LastIncExpr));
2648 if (IncIter->UserInst == OtherUse)
2664 ChainUsersVec[ChainIdx].FarUsers.erase(UserInst);
2763 DEBUG(dbgs() << "Final Chain: " << *Chain.Incs[0].UserInst << "\n");
2767 DEBUG(dbgs() << " Inc: " << *I->UserInst << "\n");
2769 std::find(I->UserInst->op_begin(), I->UserInst->op_end(), I->IVOperand);
2770 assert(UseI != I->UserInst->op_end() && "cannot find IV operand");
2776 static bool canFoldIVIncExpr(const SCEV *IncExpr, Instruction *UserInst,
2779 if (!IncConst || !isAddressUse(UserInst, Operand))
2787 getAccessType(UserInst), /*BaseGV=*/ 0,
2801 User::op_iterator IVOpEnd = Head.UserInst->op_end();
2803 User::op_iterator IVOpIter = findIVOperand(Head.UserInst->op_begin(),
2825 DEBUG(dbgs() << "Concealed chain head: " << *Head.UserInst << "\n");
2836 Instruction *InsertPt = IncI->UserInst;
2859 if (!canFoldIVIncExpr(LeftOverExpr, IncI->UserInst, IncI->IVOperand,
2873 IncI->UserInst->replaceUsesOfWith(IncI->IVOperand, IVOper);
2903 Instruction *UserInst = UI->getUser();
2905 User::op_iterator UseI = std::find(UserInst->op_begin(), UserInst->op_end(),
2907 assert(UseI != UserInst->op_end() && "cannot find IV operand");
2913 LF.UserInst = UserInst;
2919 if (isAddressUse(LF.UserInst, LF.OperandValToReplace)) {
2921 AccessTy = getAccessType(LF.UserInst);
2932 if (ICmpInst *CI = dyn_cast<ICmpInst>(LF.UserInst))
3058 const Instruction *UserInst = dyn_cast<Instruction>(*UI);
3060 if (!UserInst)
3064 if (UserInst->getParent()->getParent() != L->getHeader()->getParent())
3067 const BasicBlock *UseBB = !isa<PHINode>(UserInst) ?
3068 UserInst->getParent() :
3069 cast<PHINode>(UserInst)->getIncomingBlock(
3075 if (SE.isSCEVable(UserInst->getType())) {
3076 const SCEV *UserS = SE.getSCEV(const_cast<Instruction *>(UserInst));
3082 SE.getUnknown(const_cast<Instruction *>(UserInst)));
3087 if (const ICmpInst *ICI = dyn_cast<ICmpInst>(UserInst)) {
3095 LF.UserInst = const_cast<Instruction *>(UserInst);
4297 dyn_cast<Instruction>(cast<ICmpInst>(LF.UserInst)->getOperand(1)))
4390 LF.UserInst, LF.OperandValToReplace,
4404 LF.UserInst, LF.OperandValToReplace,
4490 ICmpInst *CI = cast<ICmpInst>(LF.UserInst);
4596 /// LSRUse (this is called "expanding"), and update the UserInst to reference
4603 // First, find an insertion point that dominates UserInst. For PHI nodes,
4605 if (PHINode *PN = dyn_cast<PHINode>(LF.UserInst)) {
4608 Value *FullV = Expand(LF, F, LF.UserInst, Rewriter, DeadInsts);
4615 FullV, OpTy, "tmp", LF.UserInst);
4625 LF.UserInst->setOperand(0, FullV);
4627 LF.UserInst->replaceUsesOfWith(LF.OperandValToReplace, FullV);