Lines Matching defs:AI

65 bool llvm::isAllocaPromotable(const AllocaInst *AI) {
67 for (const User *U : AI->users()) {
71 if (LI->isVolatile() || LI->getType() != AI->getAllocatedType())
74 if (SI->getValueOperand() == AI ||
75 SI->getValueOperand()->getType() != AI->getAllocatedType())
76 return false; // Don't allow a store OF the AI, only INTO the AI.
132 void init(AllocaInst *AI) {
134 for (DbgAssignIntrinsic *DAI : at::getAssignmentMarkers(AI)) {
138 for (DbgVariableRecord *DVR : at::getDVRAssignmentMarkers(AI)) {
240 void AnalyzeAlloca(AllocaInst *AI) {
246 for (User *U : AI->users()) {
269 findDbgUsers(AllDbgUsers, AI, &AllDPUsers);
277 AssignmentTracking.init(AI);
423 void ComputeLiveInBlocks(AllocaInst *AI, AllocaInfo &Info,
479 static void removeIntrinsicUsers(AllocaInst *AI) {
483 for (Use &U : llvm::make_early_inc_range(AI->uses())) {
488 // Drop the use of AI in droppable instructions.
522 rewriteSingleStoreAlloca(AllocaInst *AI, AllocaInfo &Info, LargeBlockInfo &LBI,
541 for (User *U : make_early_inc_range(AI->users())) {
589 DIBuilder DIB(*AI->getModule(), /*AllowUnresolved*/ false);
610 at::deleteAssignmentMarkers(AI);
616 AI->eraseFromParent();
637 promoteSingleBlockAlloca(AllocaInst *AI, const AllocaInfo &Info,
651 for (User *U : AI->users())
661 for (User *U : make_early_inc_range(AI->users())) {
701 DIBuilder DIB(*AI->getModule(), /*AllowUnresolved*/ false);
702 while (!AI->use_empty()) {
703 StoreInst *SI = cast<StoreInst>(AI->user_back());
723 at::deleteAssignmentMarkers(AI);
724 AI->eraseFromParent();
754 AllocaInst *AI = Allocas[AllocaNum];
756 assert(isAllocaPromotable(AI) && "Cannot promote non-promotable alloca!");
757 assert(AI->getParent()->getParent() == &F &&
760 removeIntrinsicUsers(AI);
762 if (AI->use_empty()) {
764 AI->eraseFromParent();
774 Info.AnalyzeAlloca(AI);
779 if (rewriteSingleStoreAlloca(AI, Info, LBI, SQ.DL, DT, AC,
791 promoteSingleBlockAlloca(AI, Info, LBI, SQ.DL, DT, AC,
824 ComputeLiveInBlocks(AI, Info, DefBlocks, LiveInBlocks);
999 AllocaInst *AI, AllocaInfo &Info,
1020 if (SI->getOperand(1) != AI)
1035 if (LI->getOperand(0) == AI)
1179 DenseMap<AllocaInst *, unsigned>::iterator AI = AllocaLookup.find(Src);
1180 if (AI == AllocaLookup.end())
1183 Value *V = IncomingVals[AI->second];