Lines Matching refs:AI
65 bool llvm::isAllocaPromotable(const AllocaInst *AI) { in isAllocaPromotable() argument
68 unsigned AS = AI->getType()->getAddressSpace(); in isAllocaPromotable()
71 for (const User *U : AI->users()) { in isAllocaPromotable()
78 if (SI->getOperand(0) == AI) in isAllocaPromotable()
132 void AnalyzeAlloca(AllocaInst *AI) { in AnalyzeAlloca()
138 for (auto UI = AI->user_begin(), E = AI->user_end(); UI != E;) { in AnalyzeAlloca()
162 DbgDeclares = FindDbgAddrUses(AI); in AnalyzeAlloca()
301 void ComputeLiveInBlocks(AllocaInst *AI, AllocaInfo &Info,
325 static void removeLifetimeIntrinsicUsers(AllocaInst *AI) { in removeLifetimeIntrinsicUsers() argument
329 for (auto UI = AI->user_begin(), UE = AI->user_end(); UI != UE;) { in removeLifetimeIntrinsicUsers()
357 static bool rewriteSingleStoreAlloca(AllocaInst *AI, AllocaInfo &Info, in rewriteSingleStoreAlloca() argument
368 for (auto UI = AI->user_begin(), E = AI->user_end(); UI != E;) { in rewriteSingleStoreAlloca()
429 DIBuilder DIB(*AI->getModule(), /*AllowUnresolved*/ false); in rewriteSingleStoreAlloca()
438 AI->eraseFromParent(); in rewriteSingleStoreAlloca()
439 LBI.deleteValue(AI); in rewriteSingleStoreAlloca()
459 static bool promoteSingleBlockAlloca(AllocaInst *AI, const AllocaInfo &Info, in promoteSingleBlockAlloca() argument
473 for (User *U : AI->users()) in promoteSingleBlockAlloca()
483 for (auto UI = AI->user_begin(), E = AI->user_end(); UI != E;) { in promoteSingleBlockAlloca()
526 while (!AI->use_empty()) { in promoteSingleBlockAlloca()
527 StoreInst *SI = cast<StoreInst>(AI->user_back()); in promoteSingleBlockAlloca()
530 DIBuilder DIB(*AI->getModule(), /*AllowUnresolved*/ false); in promoteSingleBlockAlloca()
537 AI->eraseFromParent(); in promoteSingleBlockAlloca()
538 LBI.deleteValue(AI); in promoteSingleBlockAlloca()
560 AllocaInst *AI = Allocas[AllocaNum]; in run() local
562 assert(isAllocaPromotable(AI) && "Cannot promote non-promotable alloca!"); in run()
563 assert(AI->getParent()->getParent() == &F && in run()
566 removeLifetimeIntrinsicUsers(AI); in run()
568 if (AI->use_empty()) { in run()
570 AI->eraseFromParent(); in run()
580 Info.AnalyzeAlloca(AI); in run()
585 if (rewriteSingleStoreAlloca(AI, Info, LBI, SQ.DL, DT, AC)) { in run()
596 promoteSingleBlockAlloca(AI, Info, LBI, SQ.DL, DT, AC)) { in run()
629 ComputeLiveInBlocks(AI, Info, DefBlocks, LiveInBlocks); in run()
795 AllocaInst *AI, AllocaInfo &Info, in ComputeLiveInBlocks() argument
816 if (SI->getOperand(1) != AI) in ComputeLiveInBlocks()
829 if (LI->getOperand(0) != AI) in ComputeLiveInBlocks()
964 DenseMap<AllocaInst *, unsigned>::iterator AI = AllocaLookup.find(Src); in RenamePass() local
965 if (AI == AllocaLookup.end()) in RenamePass()
968 Value *V = IncomingVals[AI->second]; in RenamePass()