Lines Matching refs:AI
154 ConstantRange getStaticAllocaSizeRange(const AllocaInst &AI) { in getStaticAllocaSizeRange() argument
155 const DataLayout &DL = AI.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()
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, in isSafeAccess() argument
367 return isSafeAccess(U, AI, SE.getSCEV(V)); in isSafeAccess()
370 bool StackSafetyLocalAnalysis::isSafeAccess(const Use &U, AllocaInst *AI, in isSafeAccess() argument
376 return isSafeAccess(U, AI, SV); in isSafeAccess()
379 bool StackSafetyLocalAnalysis::isSafeAccess(const Use &U, AllocaInst *AI, in isSafeAccess() argument
382 if (!AI) in isSafeAccess()
390 const SCEV *BaseExp = getSCEVAsPointer(AI); in isSafeAccess()
398 auto Size = getStaticAllocaSizeRange(*AI); in isSafeAccess()
421 AllocaInst *AI = dyn_cast<AllocaInst>(Ptr); in analyzeAllUses() local
439 if (AI && !SL.isAliveAfter(AI, I)) { in analyzeAllUses()
445 bool Safe = isSafeAccess(UI, AI, TypeSize); in analyzeAllUses()
452 if (AI && !SL.isAliveAfter(AI, I)) { in analyzeAllUses()
458 bool Safe = isSafeAccess(UI, AI, TypeSize); in analyzeAllUses()
488 if (AI && !SL.isAliveAfter(AI, I)) { in analyzeAllUses()
501 Safe = Safe || isSafeAccess(UI, AI, MI->getLength()); in analyzeAllUses()
521 bool Safe = isSafeAccess(UI, AI, TypeSize); in analyzeAllUses()
562 if (auto *AI = dyn_cast<AllocaInst>(&I)) in run() local
563 Allocas.push_back(AI); in run()
567 for (auto *AI : Allocas) { in run() local
568 auto &UI = Info.Allocas.emplace(AI, PointerSize).first->second; in run()
569 analyzeAllUses(AI, UI, SL); in run()
923 const AllocaInst *AI = KV.first; in getInfo() local
924 auto AIRange = getStaticAllocaSizeRange(*AI); in getInfo()
926 Info->SafeAllocas.insert(AI); in getInfo()
998 bool StackSafetyGlobalInfo::isSafe(const AllocaInst &AI) const { in isSafe()
1000 return Info.SafeAllocas.count(&AI); in isSafe()