Lines Matching refs:AI

154 ConstantRange getStaticAllocaSizeRange(const AllocaInst &AI) {  in getStaticAllocaSizeRange()  argument
155 const DataLayout &DL = AI.getModule()->getDataLayout(); in getStaticAllocaSizeRange()
156 TypeSize TS = DL.getTypeAllocSize(AI.getAllocatedType()); in getStaticAllocaSizeRange()
157 unsigned PointerSize = DL.getPointerTypeSizeInBits(AI.getType()); in getStaticAllocaSizeRange()
165 if (AI.isArrayAllocation()) { in getStaticAllocaSizeRange()
166 const auto *C = dyn_cast<ConstantInt>(AI.getArraySize()); in getStaticAllocaSizeRange()
210 if (const AllocaInst *AI = dyn_cast<AllocaInst>(&I)) { in print() local
211 auto &AS = Allocas.find(AI)->second; in print()
212 O << " " << AI->getName() << "[" in print()
213 << getStaticAllocaSizeRange(*AI).getUpper() << "]: " << AS << "\n"; in print()
257 bool isSafeAccess(const Use &U, AllocaInst *AI, const SCEV *AccessSize);
258 bool isSafeAccess(const Use &U, AllocaInst *AI, Value *V);
259 bool isSafeAccess(const Use &U, AllocaInst *AI, TypeSize AccessSize);
341 bool StackSafetyLocalAnalysis::isSafeAccess(const Use &U, AllocaInst *AI, in isSafeAccess() argument
343 return isSafeAccess(U, AI, SE.getSCEV(V)); in isSafeAccess()
346 bool StackSafetyLocalAnalysis::isSafeAccess(const Use &U, AllocaInst *AI, in isSafeAccess() argument
352 return isSafeAccess(U, AI, SV); in isSafeAccess()
355 bool StackSafetyLocalAnalysis::isSafeAccess(const Use &U, AllocaInst *AI, in isSafeAccess() argument
358 if (!AI) in isSafeAccess()
371 const SCEV *BaseExp = ToCharPtr(SE.getSCEV(AI)); in isSafeAccess()
376 auto Size = getStaticAllocaSizeRange(*AI); in isSafeAccess()
399 AllocaInst *AI = dyn_cast<AllocaInst>(Ptr); in analyzeAllUses() local
417 if (AI && !SL.isAliveAfter(AI, I)) { in analyzeAllUses()
423 bool Safe = isSafeAccess(UI, AI, TypeSize); in analyzeAllUses()
430 if (AI && !SL.isAliveAfter(AI, I)) { in analyzeAllUses()
436 bool Safe = isSafeAccess(UI, AI, TypeSize); in analyzeAllUses()
466 if (AI && !SL.isAliveAfter(AI, I)) { in analyzeAllUses()
479 Safe = Safe || isSafeAccess(UI, AI, MI->getLength()); in analyzeAllUses()
499 bool Safe = isSafeAccess(UI, AI, TypeSize); in analyzeAllUses()
540 if (auto *AI = dyn_cast<AllocaInst>(&I)) in run() local
541 Allocas.push_back(AI); in run()
545 for (auto *AI : Allocas) { in run() local
546 auto &UI = Info.Allocas.emplace(AI, PointerSize).first->second; in run()
547 analyzeAllUses(AI, UI, SL); in run()
901 const AllocaInst *AI = KV.first; in getInfo() local
902 auto AIRange = getStaticAllocaSizeRange(*AI); in getInfo()
904 Info->SafeAllocas.insert(AI); in getInfo()
976 bool StackSafetyGlobalInfo::isSafe(const AllocaInst &AI) const { in isSafe()
978 return Info.SafeAllocas.count(&AI); in isSafe()