Lines Matching refs:AI

219   AllocaSlices(const DataLayout &DL, AllocaInst &AI);
561 AllocaInst &AI; member in __anoncadf9e170311::AllocaSlices
640 SliceBuilder(const DataLayout &DL, AllocaInst &AI, AllocaSlices &AS) in SliceBuilder() argument
642 AllocSize(DL.getTypeAllocSize(AI.getAllocatedType())), AS(AS) {} in SliceBuilder()
658 << " alloca: " << AS.AI << "\n" in insertUse()
676 << " alloca: " << AS.AI << "\n" in insertUse()
780 << " alloca: " << AS.AI << "\n" in visitStoreInst()
999 AllocaSlices::AllocaSlices(const DataLayout &DL, AllocaInst &AI) in AllocaSlices() argument
1002 AI(AI), in AllocaSlices()
1005 SliceBuilder PB(DL, AI, *this); in AllocaSlices()
1006 SliceBuilder::PtrInfo PtrI = PB.visitPtr(AI); in AllocaSlices()
1057 OS << "Can't analyze slices for alloca: " << AI << "\n" in print()
1063 OS << "Slices of alloca: " << AI << "\n"; in print()
1084 AllocaInst &AI; member in __anoncadf9e170811::AllocaPromoter
1093 AllocaInst &AI, DIBuilder &DIB) in AllocaPromoter() argument
1094 : LoadAndStorePromoter(Insts, S), AI(AI), DIB(DIB) {} in AllocaPromoter()
1099 if (auto *L = LocalAsMetadata::getIfExists(&AI)) { in run()
1100 if (auto *DINode = MetadataAsValue::getIfExists(AI.getContext(), L)) { in run()
1133 if (Ptr == &AI) in isInstInList()
1262 bool presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS);
1263 AllocaInst *rewritePartition(AllocaInst &AI, AllocaSlices &AS,
1265 bool splitAlloca(AllocaInst &AI, AllocaSlices &AS);
1266 bool runOnAlloca(AllocaInst &AI);
2727 if (AllocaInst *AI = dyn_cast<AllocaInst>(V->stripInBoundsOffsets())) in visitStoreInst() local
2728 Pass.PostPromotionWorklist.insert(AI); in visitStoreInst()
2992 if (AllocaInst *AI = in visitMemTransferInst() local
2994 assert(AI != &OldAI && AI != &NewAI && in visitMemTransferInst()
2996 Pass.Worklist.insert(AI); in visitMemTransferInst()
3557 bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) { in presplitLoadsAndStores() argument
3741 IRBuilderTy IRB(&AI); in presplitLoadsAndStores()
3760 const DataLayout &DL = AI.getModule()->getDataLayout(); in presplitLoadsAndStores()
3963 assert(OtherAI != &AI && "We can't re-split our own alloca!"); in presplitLoadsAndStores()
3968 assert(OtherAI != &AI && "We can't re-split our own alloca!"); in presplitLoadsAndStores()
4010 [&](AllocaInst *AI) { return ResplitPromotableAllocas.count(AI); }), in presplitLoadsAndStores() argument
4026 AllocaInst *SROA::rewritePartition(AllocaInst &AI, AllocaSlices &AS, in rewritePartition() argument
4032 const DataLayout &DL = AI.getModule()->getDataLayout(); in rewritePartition()
4037 if (Type *TypePartitionTy = getTypePartition(DL, AI.getAllocatedType(), in rewritePartition()
4060 if (SliceTy == AI.getAllocatedType()) { in rewritePartition()
4063 NewAI = &AI; in rewritePartition()
4068 unsigned Alignment = AI.getAlignment(); in rewritePartition()
4073 Alignment = DL.getABITypeAlignment(AI.getAllocatedType()); in rewritePartition()
4082 AI.getName() + ".sroa." + Twine(P.begin() - AS.begin()), &AI); in rewritePartition()
4098 AllocaSliceRewriter Rewriter(DL, AS, *this, AI, *NewAI, P.beginOffset(), in rewritePartition()
4154 if (NewAI != &AI) in rewritePartition()
4167 bool SROA::splitAlloca(AllocaInst &AI, AllocaSlices &AS) { in splitAlloca() argument
4173 const DataLayout &DL = AI.getModule()->getDataLayout(); in splitAlloca()
4176 Changed |= presplitLoadsAndStores(AI, AS); in splitAlloca()
4191 S.endOffset() >= DL.getTypeAllocSize(AI.getAllocatedType())) in splitAlloca()
4208 Piece(AllocaInst *AI, uint64_t O, uint64_t S) in splitAlloca()
4209 : Alloca(AI), Offset(O), Size(S) {} in splitAlloca()
4215 if (AllocaInst *NewAI = rewritePartition(AI, AS, P)) { in splitAlloca()
4217 if (NewAI != &AI) { in splitAlloca()
4234 if (DbgDeclareInst *DbgDecl = FindAllocaDbgDeclare(&AI)) { in splitAlloca()
4237 DIBuilder DIB(*AI.getParent()->getParent()->getParent(), in splitAlloca()
4265 &AI); in splitAlloca()
4291 bool SROA::runOnAlloca(AllocaInst &AI) { in runOnAlloca() argument
4292 DEBUG(dbgs() << "SROA alloca: " << AI << "\n"); in runOnAlloca()
4296 if (AI.use_empty()) { in runOnAlloca()
4297 AI.eraseFromParent(); in runOnAlloca()
4300 const DataLayout &DL = AI.getModule()->getDataLayout(); in runOnAlloca()
4303 if (AI.isArrayAllocation() || !AI.getAllocatedType()->isSized() || in runOnAlloca()
4304 DL.getTypeAllocSize(AI.getAllocatedType()) == 0) in runOnAlloca()
4312 Changed |= AggRewriter.rewrite(AI); in runOnAlloca()
4315 AllocaSlices AS(DL, AI); in runOnAlloca()
4342 Changed |= splitAlloca(AI, AS); in runOnAlloca()
4380 if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) { in deleteDeadInstructions() local
4381 DeletedAllocas.insert(AI); in deleteDeadInstructions()
4382 if (DbgDeclareInst *DbgDecl = FindAllocaDbgDeclare(AI)) in deleteDeadInstructions()
4431 AllocaInst *AI = PromotableAllocas[Idx]; in promoteAllocas() local
4436 enqueueUsersInWorklist(*AI, Worklist, Visited); in promoteAllocas()
4456 assert(LI->getType() == AI->getAllocatedType()); in promoteAllocas()
4461 assert(SI->getValueOperand()->getType() == AI->getAllocatedType()); in promoteAllocas()
4472 AllocaPromoter(Insts, SSA, *AI, DIB).run(Insts); in promoteAllocas()
4475 AI->eraseFromParent(); in promoteAllocas()
4496 if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) in runOnFunction() local
4497 Worklist.insert(AI); in runOnFunction()
4513 auto IsInSet = [&](AllocaInst *AI) { return DeletedAllocas.count(AI); }; in runOnFunction() argument