Lines Matching defs:AI
154 ConstantRange getStaticAllocaSizeRange(const AllocaInst &AI) {
155 const DataLayout &DL = AI.getDataLayout();
156 TypeSize TS = DL.getTypeAllocSize(AI.getAllocatedType());
157 unsigned PointerSize = DL.getPointerTypeSizeInBits(AI.getType());
165 if (AI.isArrayAllocation()) {
166 const auto *C = dyn_cast<ConstantInt>(AI.getArraySize());
210 if (const AllocaInst *AI = dyn_cast<AllocaInst>(&I)) {
211 auto &AS = Allocas.find(AI)->second;
212 O << " " << AI->getName() << "["
213 << getStaticAllocaSizeRange(*AI).getUpper() << "]: " << AS << "\n";
265 bool isSafeAccess(const Use &U, AllocaInst *AI, const SCEV *AccessSize);
266 bool isSafeAccess(const Use &U, AllocaInst *AI, Value *V);
267 bool isSafeAccess(const Use &U, AllocaInst *AI, TypeSize AccessSize);
365 bool StackSafetyLocalAnalysis::isSafeAccess(const Use &U, AllocaInst *AI,
367 return isSafeAccess(U, AI, SE.getSCEV(V));
370 bool StackSafetyLocalAnalysis::isSafeAccess(const Use &U, AllocaInst *AI,
376 return isSafeAccess(U, AI, SV);
379 bool StackSafetyLocalAnalysis::isSafeAccess(const Use &U, AllocaInst *AI,
382 if (!AI)
390 const SCEV *BaseExp = getSCEVAsPointer(AI);
398 auto Size = getStaticAllocaSizeRange(*AI);
421 AllocaInst *AI = dyn_cast<AllocaInst>(Ptr);
439 if (AI && !SL.isAliveAfter(AI, I)) {
445 bool Safe = isSafeAccess(UI, AI, TypeSize);
452 if (AI && !SL.isAliveAfter(AI, I)) {
458 bool Safe = isSafeAccess(UI, AI, TypeSize);
488 if (AI && !SL.isAliveAfter(AI, I)) {
501 Safe = Safe || isSafeAccess(UI, AI, MI->getLength());
521 bool Safe = isSafeAccess(UI, AI, TypeSize);
562 if (auto *AI = dyn_cast<AllocaInst>(&I))
563 Allocas.push_back(AI);
567 for (auto *AI : Allocas) {
568 auto &UI = Info.Allocas.emplace(AI, PointerSize).first->second;
569 analyzeAllUses(AI, UI, SL);
923 const AllocaInst *AI = KV.first;
924 auto AIRange = getStaticAllocaSizeRange(*AI);
926 Info->SafeAllocas.insert(AI);
998 bool StackSafetyGlobalInfo::isSafe(const AllocaInst &AI) const {
1000 return Info.SafeAllocas.count(&AI);