Lines Matching refs:Value
83 const Value *AllocaPtr;
86 AllocaOffsetRewriter(ScalarEvolution &SE, const Value *AllocaPtr)
112 Value *UnsafeStackPtr = nullptr;
115 /// aligned to this value. We need to re-align the unsafe stack if the
116 /// alignment of any object on the stack exceeds this value.
122 /// \brief Build a value representing a pointer to the unsafe stack pointer.
123 Value *getOrCreateUnsafeStackPtr(IRBuilder<> &IRB, Function &F);
144 Value *moveStaticAllocasToUnsafeStack(IRBuilder<> &IRB, Function &F,
157 Value *StaticTop, bool NeedDynamicTop);
162 void moveDynamicAllocasToUnsafeStack(Function &F, Value *UnsafeStackPtr,
166 bool IsSafeStackAlloca(const Value *AllocaPtr, uint64_t AllocaSize);
169 const Value *AllocaPtr, uint64_t AllocaSize);
170 bool IsAccessSafe(Value *Addr, uint64_t Size, const Value *AllocaPtr,
210 bool SafeStack::IsAccessSafe(Value *Addr, uint64_t AccessSize,
211 const Value *AllocaPtr, uint64_t AllocaSize) {
239 const Value *AllocaPtr,
252 bool SafeStack::IsSafeStackAlloca(const Value *AllocaPtr, uint64_t AllocaSize) {
256 SmallPtrSet<const Value *, 16> Visited;
257 SmallVector<const Value *, 8> WorkList;
262 const Value *V = WorkList.pop_back_val();
345 Value *SafeStack::getOrCreateUnsafeStackPtr(IRBuilder<> &IRB, Function &F) {
348 if (Value *V = TL->getSafeStackPointerLocation(IRB))
433 Value *StaticTop, bool NeedDynamicTop) {
437 // We need the current value of the shadow stack pointer to restore
445 // If we also have dynamic alloca's, the stack pointer value changes
451 // We need the original unsafe stack pointer value, even if there are
463 Value *CurrentTop = DynamicTop ? IRB.CreateLoad(DynamicTop) : StaticTop;
470 Value *SafeStack::moveStaticAllocasToUnsafeStack(
539 Value *Off = IRB.CreateGEP(BasePointer, // BasePointer is i8*
541 Value *NewArg = IRB.CreateBitCast(Off, Arg->getType(),
570 Value *Off = IRB.CreateGEP(BasePointer, // BasePointer is i8*
572 Value *NewAI = IRB.CreateBitCast(Off, AI->getType(), AI->getName());
590 Value *StaticTop =
598 Function &F, Value *UnsafeStackPtr, AllocaInst *DynamicTop,
605 // Compute the new SP value (after AI).
606 Value *ArraySize = AI->getArraySize();
612 Value *Size = IRB.CreateMul(ArraySize, ConstantInt::get(IntPtrTy, TySize));
614 Value *SP = IRB.CreatePtrToInt(IRB.CreateLoad(UnsafeStackPtr), IntPtrTy);
617 // Align the SP value to satisfy the AllocaInst, type and stack alignments.
623 Value *NewTop = IRB.CreateIntToPtr(
632 Value *NewAI = IRB.CreatePointerCast(NewTop, AI->getType());
730 Value *StaticTop = moveStaticAllocasToUnsafeStack(IRB, F, StaticAllocas,