Lines Matching defs:AI
66 bool llvm::isAllocaPromotable(const AllocaInst *AI) {
68 for (const User *U : AI->users()) {
72 if (LI->isVolatile() || LI->getType() != AI->getAllocatedType())
75 if (SI->getValueOperand() == AI ||
76 SI->getValueOperand()->getType() != AI->getAllocatedType())
77 return false; // Don't allow a store OF the AI, only INTO the AI.
134 void init(AllocaInst *AI) {
136 for (DbgAssignIntrinsic *DAI : at::getAssignmentMarkers(AI)) {
140 for (DbgVariableRecord *DVR : at::getDVRAssignmentMarkers(AI)) {
242 void AnalyzeAlloca(AllocaInst *AI) {
248 for (User *U : AI->users()) {
271 findDbgUsers(AllDbgUsers, AI, &AllDPUsers);
279 AssignmentTracking.init(AI);
422 void ComputeLiveInBlocks(AllocaInst *AI, AllocaInfo &Info,
478 static void removeIntrinsicUsers(AllocaInst *AI) {
482 for (Use &U : llvm::make_early_inc_range(AI->uses())) {
487 // Drop the use of AI in droppable instructions.
521 rewriteSingleStoreAlloca(AllocaInst *AI, AllocaInfo &Info, LargeBlockInfo &LBI,
540 for (User *U : make_early_inc_range(AI->users())) {
588 DIBuilder DIB(*AI->getModule(), /*AllowUnresolved*/ false);
613 at::deleteAssignmentMarkers(AI);
619 AI->eraseFromParent();
640 promoteSingleBlockAlloca(AllocaInst *AI, const AllocaInfo &Info,
654 for (User *U : AI->users())
664 for (User *U : make_early_inc_range(AI->users())) {
704 DIBuilder DIB(*AI->getModule(), /*AllowUnresolved*/ false);
705 while (!AI->use_empty()) {
706 StoreInst *SI = cast<StoreInst>(AI->user_back());
726 at::deleteAssignmentMarkers(AI);
727 AI->eraseFromParent();
757 AllocaInst *AI = Allocas[AllocaNum];
759 assert(isAllocaPromotable(AI) && "Cannot promote non-promotable alloca!");
760 assert(AI->getParent()->getParent() == &F &&
763 removeIntrinsicUsers(AI);
765 if (AI->use_empty()) {
767 AI->eraseFromParent();
777 Info.AnalyzeAlloca(AI);
782 if (rewriteSingleStoreAlloca(AI, Info, LBI, SQ.DL, DT, AC,
794 promoteSingleBlockAlloca(AI, Info, LBI, SQ.DL, DT, AC,
823 ComputeLiveInBlocks(AI, Info, DefBlocks, LiveInBlocks);
998 AllocaInst *AI, AllocaInfo &Info,
1019 if (SI->getOperand(1) != AI)
1034 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];