Home | History | Annotate | Download | only in Scalar

Lines Matching refs:AI

216   AllocaSlices(const DataLayout &DL, AllocaInst &AI);
276 AllocaInst &AI;
346 SliceBuilder(const DataLayout &DL, AllocaInst &AI, AllocaSlices &S)
348 AllocSize(DL.getTypeAllocSize(AI.getAllocatedType())), S(S) {}
364 << " alloca: " << S.AI << "\n"
382 << " alloca: " << S.AI << "\n"
488 << " alloca: " << S.AI << "\n"
723 AllocaSlices::AllocaSlices(const DataLayout &DL, AllocaInst &AI)
726 AI(AI),
729 SliceBuilder PB(DL, AI, *this);
730 SliceBuilder::PtrInfo PtrI = PB.visitPtr(AI);
778 OS << "Can't analyze slices for alloca: " << AI << "\n"
784 OS << "Slices of alloca: " << AI << "\n";
805 AllocaInst &AI;
813 AllocaInst &AI, DIBuilder &DIB)
814 : LoadAndStorePromoter(Insts, S), AI(AI), DIB(DIB) {}
819 if (MDNode *DebugNode = MDNode::getIfExists(AI.getContext(), &AI)) {
850 if (Ptr == &AI)
986 bool rewritePartition(AllocaInst &AI, AllocaSlices &S,
990 bool splitAlloca(AllocaInst &AI, AllocaSlices &S);
991 bool runOnAlloca(AllocaInst &AI);
2314 if (AllocaInst *AI = dyn_cast<AllocaInst>(V->stripInBoundsOffsets()))
2315 Pass.PostPromotionWorklist.insert(AI);
2562 if (AllocaInst *AI
2564 assert(AI != &OldAI && AI != &NewAI &&
2566 Pass.Worklist.insert(AI);
3107 bool SROA::rewritePartition(AllocaInst &AI, AllocaSlices &S,
3122 if (Type *TypePartitionTy = getTypePartition(*DL, AI.getAllocatedType(),
3145 if (SliceTy == AI.getAllocatedType()) {
3148 NewAI = &AI;
3152 unsigned Alignment = AI.getAlignment();
3157 Alignment = DL->getABITypeAlignment(AI.getAllocatedType());
3165 AI.getName() + ".sroa." + Twine(B - S.begin()), &AI);
3181 AllocaSliceRewriter Rewriter(*DL, S, *this, AI, *NewAI, BeginOffset,
3247 if (NewAI != &AI)
3287 bool SROA::splitAlloca(AllocaInst &AI, AllocaSlices &S) {
3337 rewritePartition(AI, S, SI, SJ, BeginOffset, MaxEndOffset, SplitUses);
3376 Changed |= rewritePartition(AI, S, SJ, SJ, MaxEndOffset, PostSplitEndOffset,
3417 bool SROA::runOnAlloca(AllocaInst &AI) {
3418 DEBUG(dbgs() << "SROA alloca: " << AI << "\n");
3422 if (AI.use_empty()) {
3423 AI.eraseFromParent();
3428 if (AI.isArrayAllocation() || !AI.getAllocatedType()->isSized() ||
3429 DL->getTypeAllocSize(AI.getAllocatedType()) == 0)
3437 Changed |= AggRewriter.rewrite(AI);
3440 AllocaSlices S(*DL, AI);
3471 Changed |= splitAlloca(AI, S);
3508 if (AllocaInst *AI = dyn_cast<AllocaInst>(I))
3509 DeletedAllocas.insert(AI);
3556 AllocaInst *AI = PromotableAllocas[Idx];
3561 enqueueUsersInWorklist(*AI, Worklist, Visited);
3581 assert(LI->getType() == AI->getAllocatedType());
3586 assert(SI->getValueOperand()->getType() == AI->getAllocatedType());
3597 AllocaPromoter(Insts, SSA, *AI, DIB).run(Insts);
3600 AI->eraseFromParent();
3626 if (AllocaInst *AI = dyn_cast<AllocaInst>(I))
3627 Worklist.insert(AI);
3642 auto IsInSet = [&](AllocaInst *AI) {
3643 return DeletedAllocas.count(AI);