51 #define DEBUG_TYPE "memory-builtins" 77 {LibFunc_ZnwjRKSt9nothrow_t, {
MallocLike, 2, 0, -1}},
78 {LibFunc_ZnwjSt11align_val_t, {
OpNewLike, 2, 0, -1}},
79 {LibFunc_ZnwjSt11align_val_tRKSt9nothrow_t,
82 {LibFunc_ZnwmRKSt9nothrow_t, {
MallocLike, 2, 0, -1}},
83 {LibFunc_ZnwmSt11align_val_t, {
OpNewLike, 2, 0, -1}},
84 {LibFunc_ZnwmSt11align_val_tRKSt9nothrow_t,
87 {LibFunc_ZnajRKSt9nothrow_t, {
MallocLike, 2, 0, -1}},
88 {LibFunc_ZnajSt11align_val_t, {
OpNewLike, 2, 0, -1}},
89 {LibFunc_ZnajSt11align_val_tRKSt9nothrow_t,
92 {LibFunc_ZnamRKSt9nothrow_t, {
MallocLike, 2, 0, -1}},
93 {LibFunc_ZnamSt11align_val_t, {
OpNewLike, 2, 0, -1}},
94 {LibFunc_ZnamSt11align_val_tRKSt9nothrow_t,
96 {LibFunc_msvc_new_int, {
OpNewLike, 1, 0, -1}},
97 {LibFunc_msvc_new_int_nothrow, {
MallocLike, 2, 0, -1}},
98 {LibFunc_msvc_new_longlong, {
OpNewLike, 1, 0, -1}},
99 {LibFunc_msvc_new_longlong_nothrow, {
MallocLike, 2, 0, -1}},
100 {LibFunc_msvc_new_array_int, {
OpNewLike, 1, 0, -1}},
101 {LibFunc_msvc_new_array_int_nothrow, {
MallocLike, 2, 0, -1}},
102 {LibFunc_msvc_new_array_longlong, {
OpNewLike, 1, 0, -1}},
103 {LibFunc_msvc_new_array_longlong_nothrow, {
MallocLike, 2, 0, -1}},
115 if (isa<IntrinsicInst>(V))
118 if (LookThroughBitCast)
141 if (!TLI || !TLI->
getLibFunc(FnName, TLIFn) || !TLI->
has(TLIFn))
146 return P.first == TLIFn;
175 bool LookThroughBitCast =
false) {
176 bool IsNoBuiltinCall;
179 if (!IsNoBuiltinCall)
186 bool IsNoBuiltinCall;
194 if (!IsNoBuiltinCall)
211 Result.
SndParam = Args.second.getValueOr(-1);
224 bool LookThroughBitCast) {
231 bool LookThroughBitCast) {
241 bool LookThroughBitCast) {
248 bool LookThroughBitCast) {
255 bool LookThroughBitCast) {
257 LookThroughBitCast).hasValue();
263 bool LookThroughBitCast) {
277 bool LookThroughSExt =
false) {
293 Value *Multiple =
nullptr;
294 if (
ComputeMultiple(MallocArg, ElementSize, Multiple, LookThroughSExt))
310 unsigned NumOfBitCastUses = 0;
315 if (
const BitCastInst *BCI = dyn_cast<BitCastInst>(*UI++)) {
316 MallocType = cast<PointerType>(BCI->getDestTy());
321 if (NumOfBitCastUses == 1)
325 if (NumOfBitCastUses == 0)
326 return cast<PointerType>(CI->
getType());
350 bool LookThroughSExt) {
364 bool IsNoBuiltinCall;
367 if (Callee ==
nullptr || IsNoBuiltinCall)
372 if (!TLI || !TLI->
getLibFunc(FnName, TLIFn) || !TLI->
has(TLIFn))
375 unsigned ExpectedNumParams;
376 if (TLIFn == LibFunc_free ||
377 TLIFn == LibFunc_ZdlPv ||
378 TLIFn == LibFunc_ZdaPv ||
379 TLIFn == LibFunc_msvc_delete_ptr32 ||
380 TLIFn == LibFunc_msvc_delete_ptr64 ||
381 TLIFn == LibFunc_msvc_delete_array_ptr32 ||
382 TLIFn == LibFunc_msvc_delete_array_ptr64)
383 ExpectedNumParams = 1;
384 else if (TLIFn == LibFunc_ZdlPvj ||
385 TLIFn == LibFunc_ZdlPvm ||
386 TLIFn == LibFunc_ZdlPvRKSt9nothrow_t ||
387 TLIFn == LibFunc_ZdlPvSt11align_val_t ||
388 TLIFn == LibFunc_ZdaPvj ||
389 TLIFn == LibFunc_ZdaPvm ||
390 TLIFn == LibFunc_ZdaPvRKSt9nothrow_t ||
391 TLIFn == LibFunc_ZdaPvSt11align_val_t ||
392 TLIFn == LibFunc_msvc_delete_ptr32_int ||
393 TLIFn == LibFunc_msvc_delete_ptr64_longlong ||
394 TLIFn == LibFunc_msvc_delete_ptr32_nothrow ||
395 TLIFn == LibFunc_msvc_delete_ptr64_nothrow ||
396 TLIFn == LibFunc_msvc_delete_array_ptr32_int ||
397 TLIFn == LibFunc_msvc_delete_array_ptr64_longlong ||
398 TLIFn == LibFunc_msvc_delete_array_ptr32_nothrow ||
399 TLIFn == LibFunc_msvc_delete_array_ptr64_nothrow)
400 ExpectedNumParams = 2;
401 else if (TLIFn == LibFunc_ZdaPvSt11align_val_tRKSt9nothrow_t ||
402 TLIFn == LibFunc_ZdlPvSt11align_val_tRKSt9nothrow_t)
403 ExpectedNumParams = 3;
425 if (Data.second.isNegative() || Data.first.ult(Data.second))
426 return APInt(Data.first.getBitWidth(), 0);
427 return Data.first - Data.second;
438 if (!Visitor.bothKnown(Data))
450 "ObjectSize must be a call to llvm.objectsize!");
468 auto *ResultType = cast<IntegerType>(ObjectSize->
getType());
480 "Number of arguments with unsolved size and offset");
482 "Number of load instructions with unsolved size and offset");
485 if (Options.RoundToAlign && Align)
494 : DL(DL), TLI(TLI), Options(Options) {
507 if (!SeenInsts.insert(
I).second)
514 if (
Argument *A = dyn_cast<Argument>(V))
525 if (CE->getOpcode() == Instruction::IntToPtr)
527 if (CE->getOpcode() == Instruction::GetElementPtr)
531 LLVM_DEBUG(
dbgs() <<
"ObjectSizeOffsetVisitor::compute() unhandled value: " 541 bool ObjectSizeOffsetVisitor::CheckedZextOrTrunc(
APInt &
I) {
558 return std::make_pair(align(Size, I.
getAlignment()), Zero);
561 if (
const ConstantInt *
C = dyn_cast<ConstantInt>(ArraySize)) {
562 APInt NumElems =
C->getValue();
563 if (!CheckedZextOrTrunc(NumElems))
567 Size = Size.
umul_ov(NumElems, Overflow);
568 return Overflow ? unknown() : std::make_pair(align(Size, I.
getAlignment()),
577 ++ObjectVisitorArgument;
604 if (Size.
ugt(MaxSize))
607 return std::make_pair(Size, Zero);
615 if (!CheckedZextOrTrunc(Size))
620 return std::make_pair(Size, Zero);
627 if (!CheckedZextOrTrunc(NumElems))
631 Size = Size.
umul_ov(NumElems, Overflow);
632 return Overflow ? unknown() : std::make_pair(Size, Zero);
654 return std::make_pair(Zero, Zero);
674 return std::make_pair(PtrData.first, PtrData.second + Offset);
688 return std::make_pair(align(Size, GV.
getAlignment()), Zero);
710 if (TrueSide == FalseSide) {
717 if (TrueResult == FalseResult) {
721 if (TrueResult.
slt(FalseResult))
726 if (TrueResult.
sgt(FalseResult))
735 return std::make_pair(Zero, Zero);
739 LLVM_DEBUG(
dbgs() <<
"ObjectSizeOffsetVisitor unknown instruction:" << I
747 : DL(DL), TLI(TLI), Context(Context), Builder(Context,
TargetFolder(DL)),
748 RoundToAlign(RoundToAlign) {
764 for (
const Value *SeenVal : SeenVals) {
767 if (CacheIt != CacheMap.
end() &&
anyKnown(CacheIt->second))
768 CacheMap.
erase(CacheIt);
790 if (CacheIt != CacheMap.
end())
791 return CacheIt->second;
805 if (!SeenVals.
insert(V).second) {
809 }
else if (
Instruction *I = dyn_cast<Instruction>(V)) {
811 }
else if (isa<Argument>(V) ||
812 (isa<ConstantExpr>(V) &&
813 cast<ConstantExpr>(V)->
getOpcode() == Instruction::IntToPtr) ||
814 isa<GlobalAlias>(V) ||
815 isa<GlobalVariable>(V)) {
820 dbgs() <<
"ObjectSizeOffsetEvaluator::compute() unhandled value: " << *V
826 CacheMap[V] = Result;
839 Size = Builder.
CreateMul(Size, ArraySize);
840 return std::make_pair(Size, Zero);
855 FirstArg = Builder.
CreateZExt(FirstArg, IntTy);
857 return std::make_pair(FirstArg, Zero);
860 SecondArg = Builder.
CreateZExt(SecondArg, IntTy);
862 return std::make_pair(Size, Zero);
890 Offset = Builder.
CreateAdd(PtrData.second, Offset);
891 return std::make_pair(PtrData.first, Offset);
909 CacheMap[&PHI] = std::make_pair(SizePHI, OffsetPHI);
938 return std::make_pair(Size, Offset);
947 if (TrueSide == FalseSide)
954 return std::make_pair(Size, Offset);
958 LLVM_DEBUG(
dbgs() <<
"ObjectSizeOffsetEvaluator unknown instruction:" << I
bool getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout &DL, const TargetLibraryInfo *TLI, ObjectSizeOpts Opts={})
Compute the size of the object pointed by Ptr.
Value * EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &DL, User *GEP, bool NoAssumptions=false)
Given a getelementptr instruction/constantexpr, emit the code necessary to compute the offset from th...
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
unsigned getAlignment() const
bool isAllocationFn(const Value *V, const TargetLibraryInfo *TLI, bool LookThroughBitCast=false)
Tests if a value is a call or invoke to a library function that allocates or reallocates memory (eith...
A parsed version of the target data layout string in and methods for querying it. ...
const_iterator end(StringRef path)
Get end iterator over path.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
bool hasDefinitiveInitializer() const
hasDefinitiveInitializer - Whether the global variable has an initializer, and any other instances of...
static const std::pair< LibFunc, AllocFnsTy > AllocationFnData[]
void addIncoming(Value *V, BasicBlock *BB)
Add an incoming value to the end of the PHI list.
uint64_t getZExtValue() const
Get zero extended value.
This class represents an incoming formal argument to a Function.
This class represents lattice values for constants.
Type * getParamType(unsigned i) const
Parameter type accessors.
bool isSized(SmallPtrSetImpl< Type *> *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
const CallInst * extractCallocCall(const Value *I, const TargetLibraryInfo *TLI)
extractCallocCall - Returns the corresponding CallInst if the instruction is a calloc call...
const StructLayout * getStructLayout(StructType *Ty) const
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of i...
bool hasByValOrInAllocaAttr() const
Return true if this argument has the byval attribute or inalloca attribute.
std::pair< Value *, Value * > SizeOffsetEvalType
bool NullIsUnknownSize
If this is true, null pointers in address space 0 will be treated as though they can't be evaluated...
bool slt(const APInt &RHS) const
Signed less than comparison.
This class represents a function call, abstracting a target machine's calling convention.
static Optional< AllocFnsTy > getAllocationDataForFunction(const Function *Callee, AllocType AllocTy, const TargetLibraryInfo *TLI)
Returns the allocation data for the given value if it's either a call to a known allocation function...
const Value * getTrueValue() const
bool RoundToAlign
Whether to round the result up to the alignment of allocas, byval arguments, and global variables...
LLVMContext & getContext() const
All values hold a context through their type.
SizeOffsetType visitAllocaInst(AllocaInst &I)
bool isInterposable() const
Return true if this global's definition can be substituted with an arbitrary definition at link time...
bool sgt(const APInt &RHS) const
Signed greather than comparison.
STATISTIC(NumFunctions, "Total number of functions")
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
An instruction for reading from memory.
APInt zextOrTrunc(unsigned width) const
Zero extend or truncate to width.
SizeOffsetType visitArgument(Argument &A)
unsigned getBitWidth() const
Return the number of bits in the APInt.
bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const
Accumulate the constant address offset of this GEP if possible.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
const CallInst * isFreeCall(const Value *I, const TargetLibraryInfo *TLI)
isFreeCall - Returns non-null if the value is a call to the builtin free()
Value * getArgOperand(unsigned i) const
This class represents the LLVM 'select' instruction.
unsigned getAlignment() const
Return the alignment of the memory that is being allocated by the instruction.
SizeOffsetEvalType visitGEPOperator(GEPOperator &GEP)
SizeOffsetType visitExtractValueInst(ExtractValueInst &I)
SizeOffsetType visitGEPOperator(GEPOperator &GEP)
unsigned getPointerTypeSizeInBits(Type *) const
Layout pointer size, in bits, based on the type.
'undef' values are things that do not have specified contents.
static Optional< AllocFnsTy > getAllocationSize(const Value *V, const TargetLibraryInfo *TLI)
Class to represent struct types.
APInt zextOrSelf(unsigned width) const
Zero extend or truncate to width.
static Optional< unsigned > getOpcode(ArrayRef< VPValue *> Values)
Returns the opcode of Values or ~0 if they do not all agree.
bool isIntegerTy() const
True if this is an instance of IntegerType.
SizeOffsetEvalType visitCallSite(CallSite CS)
SizeOffsetType visitIntToPtrInst(IntToPtrInst &)
This file contains the simple types necessary to represent the attributes associated with functions a...
InstrTy * getInstruction() const
Value * CreateAdd(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
This file implements a class to represent arbitrary precision integral constant values and operations...
ObjectSizeOffsetEvaluator(const DataLayout &DL, const TargetLibraryInfo *TLI, LLVMContext &Context, bool RoundToAlign=false)
void visit(Iterator Start, Iterator End)
unsigned getActiveBits() const
Compute the number of active bits in the value.
bool isNoAliasFn(const Value *V, const TargetLibraryInfo *TLI, bool LookThroughBitCast=false)
Tests if a value is a call or invoke to a function that returns a NoAlias pointer (including malloc/c...
Same as Min, except we pick the maximum size of all of the branches.
A constant value that is initialized with an expression using other constant values.
Class to represent function types.
Type * getType() const
All values are typed, get the type of this value.
Evaluate all branches of an unknown condition.
bool isNoBuiltin() const
Return true if the call should not be treated as a call to a builtin.
bool has(LibFunc F) const
Tests whether a library function is available.
This class represents a no-op cast from one type to another.
const APInt & getValue() const
Return the constant as an APInt value reference.
TargetFolder - Create constants with target dependent folding.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
std::pair< unsigned, Optional< unsigned > > getAllocSizeArgs() const
Returns the argument numbers for the allocsize attribute (or pair(0, 0) if not known).
Value * CreateZExt(Value *V, Type *DestTy, const Twine &Name="")
uint64_t GetStringLength(const Value *V, unsigned CharSize=8)
If we can compute the length of the string pointed to by the specified pointer, return 'len+1'...
SizeOffsetType visitInstruction(Instruction &I)
amdgpu Simplify well known AMD library false Value * Callee
void SetInsertPoint(BasicBlock *TheBB)
This specifies that created instructions should be appended to the end of the specified block...
Class to represent pointers.
iterator find(const_arg_type_t< KeyT > Val)
Value * getMallocArraySize(CallInst *CI, const DataLayout &DL, const TargetLibraryInfo *TLI, bool LookThroughSExt=false)
getMallocArraySize - Returns the array size of a malloc call.
SizeOffsetType visitGlobalVariable(GlobalVariable &GV)
bool isVoidTy() const
Return true if this is 'void'.
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
bool erase(const KeyT &Val)
SizeOffsetEvalType visitSelectInst(SelectInst &I)
const_iterator getFirstInsertionPt() const
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI i...
ConstantInt * lowerObjectSizeCall(IntrinsicInst *ObjectSize, const DataLayout &DL, const TargetLibraryInfo *TLI, bool MustSucceed)
Try to turn a call to @llvm.objectsize into an integer value of the given Type.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
const CallInst * extractMallocCall(const Value *I, const TargetLibraryInfo *TLI)
extractMallocCall - Returns the corresponding CallInst if the instruction is a malloc call...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Value * CreateSelect(Value *C, Value *True, Value *False, const Twine &Name="", Instruction *MDFrom=nullptr)
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
static Value * computeArraySize(const CallInst *CI, const DataLayout &DL, const TargetLibraryInfo *TLI, bool LookThroughSExt=false)
static APInt getSizeWithOverflow(const SizeOffsetType &Data)
Value * getPointerOperand()
static bool hasNoAliasAttr(const Value *V, bool LookThroughBitCast)
unsigned getAddressSpace() const
Return the address space of the Pointer type.
static Optional< AllocFnsTy > getAllocationData(const Value *V, AllocType AllocTy, const TargetLibraryInfo *TLI, bool LookThroughBitCast=false)
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
This class represents a cast from an integer to a pointer.
const Value * getCondition() const
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs, and aliases.
SizeOffsetType visitCallSite(CallSite CS)
const Value * getArraySize() const
Get the number of elements allocated.
std::pair< APInt, APInt > SizeOffsetType
Value * getIncomingValue(unsigned i) const
Return incoming value number x.
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
PointerType * getMallocType(const CallInst *CI, const TargetLibraryInfo *TLI)
getMallocType - Returns the PointerType resulting from the malloc call.
Value * CreateMul(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
Type * getAllocatedType() const
Return the type that is being allocated by the instruction.
SizeOffsetType visitSelectInst(SelectInst &I)
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
SizeOffsetType visitExtractElementInst(ExtractElementInst &I)
SizeOffsetType visitGlobalAlias(GlobalAlias &GA)
PHINode * CreatePHI(Type *Ty, unsigned NumReservedValues, const Twine &Name="")
SizeOffsetEvalType visitInstruction(Instruction &I)
Value * hasConstantValue() const
If the specified PHI node always merges together the same value, return the value, otherwise return null.
unsigned getNumOperands() const
Mode EvalMode
How we want to evaluate this object's size.
This is the shared class of boolean and integer constants.
ValTy * getArgument(unsigned ArgNo) const
Evaluate the size and offset of an object pointed to by a Value* statically.
unsigned getParamAlignment() const
If this is a byval or inalloca argument, return its alignment.
Provides information about what library functions are available for the current target.
SizeOffsetType visitPHINode(PHINode &)
A constant pointer value that points to null.
Type * getReturnType() const
uint64_t getSizeInBytes() const
SizeOffsetType visitUndefValue(UndefValue &)
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
unsigned getNumIncomingValues() const
Return the number of incoming edges.
static const Function * getCalledFunction(const Value *V, bool LookThroughBitCast, bool &IsNoBuiltin)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
SizeOffsetType compute(Value *V)
FunctionType * getFunctionType() const
Returns the FunctionType for me.
Class for arbitrary precision integers.
SizeOffsetEvalType visitIntToPtrInst(IntToPtrInst &)
Type * getMallocAllocatedType(const CallInst *CI, const TargetLibraryInfo *TLI)
getMallocAllocatedType - Returns the Type allocated by malloc call.
SizeOffsetEvalType visitPHINode(PHINode &PHI)
bool getLibFunc(StringRef funcName, LibFunc &F) const
Searches for a particular function name.
bool isMallocLikeFn(const Value *V, const TargetLibraryInfo *TLI, bool LookThroughBitCast=false)
Tests if a value is a call or invoke to a library function that allocates uninitialized memory (such ...
const Value * getFalseValue() const
user_iterator_impl< const User > const_user_iterator
amdgpu Simplify well known AMD library false Value Value * Arg
Fail to evaluate an unknown condition.
SizeOffsetEvalType compute(Value *V)
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
bool ugt(const APInt &RHS) const
Unsigned greather than comparison.
static bool isZero(Value *V, const DataLayout &DL, DominatorTree *DT, AssumptionCache *AC)
ObjectSizeOffsetVisitor(const DataLayout &DL, const TargetLibraryInfo *TLI, LLVMContext &Context, ObjectSizeOpts Options={})
SizeOffsetEvalType visitLoadInst(LoadInst &I)
bool isMallocOrCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI, bool LookThroughBitCast=false)
Tests if a value is a call or invoke to a library function that allocates memory similar to malloc or...
StringRef getName() const
Return a constant reference to the value's name.
Establish a view to a call site for examination.
BasicBlock * getIncomingBlock(unsigned i) const
Return incoming basic block number i.
bool isCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI, bool LookThroughBitCast=false)
Tests if a value is a call or invoke to a library function that allocates zero-filled memory (such as...
PointerType * getType() const
Specialize the getType() method to always return an PointerType, which reduces the amount of casting ...
bool isAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI, bool LookThroughBitCast=false)
Tests if a value is a call or invoke to a library function that allocates memory (either malloc...
bool ComputeMultiple(Value *V, unsigned Base, Value *&Multiple, bool LookThroughSExt=false, unsigned Depth=0)
This function computes the integer multiple of Base that equals V.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool anyKnown(SizeOffsetEvalType SizeOffset)
APInt umul_ov(const APInt &RHS, bool &Overflow) const
FunTy * getCalledFunction() const
Return the function being called if this is a direct call, otherwise return null (if it's an indirect...
bool isArrayAllocation() const
Return true if there is an allocation size parameter to the allocation instruction that is not 1...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
user_iterator user_begin()
static bool bothKnown(const SizeOffsetType &SizeOffset)
bool hasRetAttr(Attribute::AttrKind Kind) const
Return true if this return value has the given attribute.
LLVM Value Representation.
SizeOffsetEvalType visitExtractElementInst(ExtractElementInst &I)
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
StringRef - Represent a constant reference to a string, i.e.
Various options to control the behavior of getObjectSize.
static APInt getNullValue(unsigned numBits)
Get the '0' value.
bool isUIntN(unsigned N, uint64_t x)
Checks if an unsigned integer fits into the given (dynamic) bit width.
SizeOffsetType visitLoadInst(LoadInst &I)
SizeOffsetEvalType visitAllocaInst(AllocaInst &I)
bool bothKnown(SizeOffsetEvalType SizeOffset)
SizeOffsetType visitConstantPointerNull(ConstantPointerNull &)
SizeOffsetEvalType visitExtractValueInst(ExtractValueInst &I)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Type * getElementType() const
PointerType * getType() const
Global values are always pointers.
A wrapper class for inspecting calls to intrinsic functions.
an instruction to allocate memory on the stack
const Constant * getAliasee() const