Home | History | Annotate | Download | only in Utils

Lines Matching defs:AI

60 bool llvm::isAllocaPromotable(const AllocaInst *AI) {
63 unsigned AS = AI->getType()->getAddressSpace();
66 for (const User *U : AI->users()) {
73 if (SI->getOperand(0) == AI)
74 return false; // Don't allow a store OF the AI, only INTO the AI.
128 void AnalyzeAlloca(AllocaInst *AI) {
134 for (auto UI = AI->user_begin(), E = AI->user_end(); UI != E;) {
158 DbgDeclare = FindAllocaDbgDeclare(AI);
302 void DetermineInsertionPoint(AllocaInst *AI, unsigned AllocaNum,
304 void ComputeLiveInBlocks(AllocaInst *AI, AllocaInfo &Info,
315 static void removeLifetimeIntrinsicUsers(AllocaInst *AI) {
319 for (auto UI = AI->user_begin(), UE = AI->user_end(); UI != UE;) {
347 static bool rewriteSingleStoreAlloca(AllocaInst *AI, AllocaInfo &Info,
359 for (auto UI = AI->user_begin(), E = AI->user_end(); UI != E;) {
415 DIBuilder DIB(*AI->getParent()->getParent()->getParent());
425 AST->deleteValue(AI);
426 AI->eraseFromParent();
427 LBI.deleteValue(AI);
444 static void promoteSingleBlockAlloca(AllocaInst *AI, const AllocaInfo &Info,
456 for (User *U : AI->users())
466 for (auto UI = AI->user_begin(), E = AI->user_end(); UI != E;) {
494 while (!AI->use_empty()) {
495 StoreInst *SI = cast<StoreInst>(AI->user_back());
498 DIBuilder DIB(*AI->getParent()->getParent()->getParent());
506 AST->deleteValue(AI);
507 AI->eraseFromParent();
508 LBI.deleteValue(AI);
530 AllocaInst *AI = Allocas[AllocaNum];
532 assert(isAllocaPromotable(AI) && "Cannot promote non-promotable alloca!");
533 assert(AI->getParent()->getParent() == &F &&
536 removeLifetimeIntrinsicUsers(AI);
538 if (AI->use_empty()) {
541 AST->deleteValue(AI);
542 AI->eraseFromParent();
552 Info.AnalyzeAlloca(AI);
557 if (rewriteSingleStoreAlloca(AI, Info, LBI, DT, AST)) {
568 promoteSingleBlockAlloca(AI, Info, LBI, AST);
618 DetermineInsertionPoint(AI, AllocaNum, Info);
768 AllocaInst *AI, AllocaInfo &Info,
790 if (SI->getOperand(1) != AI)
802 if (LI->getOperand(0) != AI)
842 void PromoteMem2Reg::DetermineInsertionPoint(AllocaInst *AI, unsigned AllocaNum,
851 ComputeLiveInBlocks(AI, Info, DefBlocks, LiveInBlocks);
1017 DenseMap<AllocaInst *, unsigned>::iterator AI = AllocaLookup.find(Src);
1018 if (AI == AllocaLookup.end())
1021 Value *V = IncomingVals[AI->second];
1035 DenseMap<AllocaInst *, unsigned>::iterator ai = AllocaLookup.find(Dest);
1036 if (ai == AllocaLookup.end())
1040 IncomingVals[ai->second] = SI->getOperand(0);
1042 if (DbgDeclareInst *DDI = AllocaDbgDeclares[ai->second])