Lines Matching refs:AI

195   bool isInterestingAlloca(const AllocaInst &AI);
196 bool tagAlloca(IRBuilder<> &IRB, AllocaInst *AI, Value *Tag);
203 Value *getAllocaTag(IRBuilder<> &IRB, Value *StackTag, AllocaInst *AI,
634 static uint64_t getAllocaSizeInBytes(const AllocaInst &AI) { in getAllocaSizeInBytes() argument
636 if (AI.isArrayAllocation()) { in getAllocaSizeInBytes()
637 const ConstantInt *CI = dyn_cast<ConstantInt>(AI.getArraySize()); in getAllocaSizeInBytes()
641 Type *Ty = AI.getAllocatedType(); in getAllocaSizeInBytes()
642 uint64_t SizeInBytes = AI.getModule()->getDataLayout().getTypeAllocSize(Ty); in getAllocaSizeInBytes()
646 bool HWAddressSanitizer::tagAlloca(IRBuilder<> &IRB, AllocaInst *AI, in tagAlloca() argument
648 size_t Size = (getAllocaSizeInBytes(*AI) + Mapping.getAllocaAlignment() - 1) & in tagAlloca()
654 {IRB.CreatePointerCast(AI, Int8PtrTy), JustTag, in tagAlloca()
659 memToShadow(IRB.CreatePointerCast(AI, IntptrTy), AI->getType(), IRB), in tagAlloca()
710 AllocaInst *AI, unsigned AllocaNo) { in getAllocaTag() argument
783 for (auto AI : Allocas) in createFrameString() local
784 Descr << getAllocaSizeInBytes(*AI) << " " << AI->getName().str() << "; "; in createFrameString()
899 auto *AI = Allocas[N]; in instrumentStack() local
900 IRBuilder<> IRB(AI->getNextNode()); in instrumentStack()
903 Value *Tag = getAllocaTag(IRB, StackTag, AI, N); in instrumentStack()
904 Value *AILong = IRB.CreatePointerCast(AI, IntptrTy); in instrumentStack()
905 Value *Replacement = tagPointer(IRB, AI->getType(), AILong, Tag); in instrumentStack()
907 AI->hasName() ? AI->getName().str() : "alloca." + itostr(N); in instrumentStack()
910 for (auto UI = AI->use_begin(), UE = AI->use_end(); UI != UE;) { in instrumentStack()
916 tagAlloca(IRB, AI, Tag); in instrumentStack()
923 tagAlloca(IRB, AI, Tag); in instrumentStack()
930 bool HWAddressSanitizer::isInterestingAlloca(const AllocaInst &AI) { in isInterestingAlloca() argument
931 return (AI.getAllocatedType()->isSized() && in isInterestingAlloca()
933 AI.isStaticAlloca() && in isInterestingAlloca()
935 getAllocaSizeInBytes(AI) > 0 && in isInterestingAlloca()
938 !isAllocaPromotable(&AI) && in isInterestingAlloca()
941 !AI.isUsedWithInAlloca() && in isInterestingAlloca()
943 !AI.isSwiftError()); in isInterestingAlloca()
961 if (AllocaInst *AI = dyn_cast<AllocaInst>(&Inst)) { in runOnFunction() local
964 if (AI->getAlignment() < Mapping.getAllocaAlignment()) in runOnFunction()
965 AI->setAlignment(Mapping.getAllocaAlignment()); in runOnFunction()
967 if (isInterestingAlloca(*AI)) in runOnFunction()
968 AllocasToInstrument.push_back(AI); in runOnFunction()