LLVM 20.0.0git
|
#include "llvm/IR/Function.h"
Classes | |
class | ProfileCount |
Class to represent profile counts. More... | |
Public Member Functions | |
bool | hasLazyArguments () const |
hasLazyArguments/CheckLazyArguments - The argument list of a function is built on demand, so that the list isn't allocated until the first client needs it. | |
void | convertToNewDbgValues () |
void | convertFromNewDbgValues () |
void | setIsNewDbgInfoFormat (bool NewVal) |
void | setNewDbgInfoFormatFlag (bool NewVal) |
Function (const Function &)=delete | |
void | operator= (const Function &)=delete |
~Function () | |
const Function & | getFunction () const |
DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
unsigned | getInstructionCount () const |
Returns the number of non-debug IR instructions in this function. | |
FunctionType * | getFunctionType () const |
Returns the FunctionType for me. | |
Type * | getReturnType () const |
Returns the type of the ret val. | |
LLVMContext & | getContext () const |
getContext - Return a reference to the LLVMContext associated with this function. | |
const DataLayout & | getDataLayout () const |
Get the data layout of the module this function belongs to. | |
bool | isVarArg () const |
isVarArg - Return true if this function takes a variable number of arguments. | |
bool | isMaterializable () const |
void | setIsMaterializable (bool V) |
Intrinsic::ID | getIntrinsicID () const LLVM_READONLY |
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intrinsic if the function is not an intrinsic, or if the pointer is null. | |
bool | isIntrinsic () const |
isIntrinsic - Returns true if the function's name starts with "llvm.". | |
bool | isTargetIntrinsic () const |
isTargetIntrinsic - Returns true if this function is an intrinsic and the intrinsic is specific to a certain target. | |
bool | isConstrainedFPIntrinsic () const |
Returns true if the function is one of the "Constrained Floating-Point
Intrinsics". | |
void | updateAfterNameChange () |
Update internal caches that depend on the function name (such as the intrinsic ID and libcall cache). | |
CallingConv::ID | getCallingConv () const |
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this function. | |
void | setCallingConv (CallingConv::ID CC) |
void | setEntryCount (ProfileCount Count, const DenseSet< GlobalValue::GUID > *Imports=nullptr) |
Set the entry count for this function. | |
void | setEntryCount (uint64_t Count, ProfileCountType Type=PCT_Real, const DenseSet< GlobalValue::GUID > *Imports=nullptr) |
A convenience wrapper for setting entry count. | |
std::optional< ProfileCount > | getEntryCount (bool AllowSynthetic=false) const |
Get the entry count for this function. | |
bool | hasProfileData (bool IncludeSynthetic=false) const |
Return true if the function is annotated with profile data. | |
DenseSet< GlobalValue::GUID > | getImportGUIDs () const |
Returns the set of GUIDs that needs to be imported to the function for sample PGO, to enable the same inlines as the profiled optimized binary. | |
void | setSectionPrefix (StringRef Prefix) |
Set the section prefix for this function. | |
std::optional< StringRef > | getSectionPrefix () const |
Get the section prefix for this function. | |
bool | hasGC () const |
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generation. | |
const std::string & | getGC () const |
void | setGC (std::string Str) |
void | clearGC () |
AttributeList | getAttributes () const |
Return the attribute list for this Function. | |
void | setAttributes (AttributeList Attrs) |
Set the attribute list for this Function. | |
void | addAttributeAtIndex (unsigned i, Attribute Attr) |
adds the attribute to the list of attributes. | |
void | addFnAttr (Attribute::AttrKind Kind) |
Add function attributes to this function. | |
void | addFnAttr (StringRef Kind, StringRef Val=StringRef()) |
Add function attributes to this function. | |
void | addFnAttr (Attribute Attr) |
Add function attributes to this function. | |
void | addFnAttrs (const AttrBuilder &Attrs) |
Add function attributes to this function. | |
void | addRetAttr (Attribute::AttrKind Kind) |
Add return value attributes to this function. | |
void | addRetAttr (Attribute Attr) |
Add return value attributes to this function. | |
void | addRetAttrs (const AttrBuilder &Attrs) |
Add return value attributes to this function. | |
void | addParamAttr (unsigned ArgNo, Attribute::AttrKind Kind) |
adds the attribute to the list of attributes for the given arg. | |
void | addParamAttr (unsigned ArgNo, Attribute Attr) |
adds the attribute to the list of attributes for the given arg. | |
void | addParamAttrs (unsigned ArgNo, const AttrBuilder &Attrs) |
adds the attributes to the list of attributes for the given arg. | |
void | removeAttributeAtIndex (unsigned i, Attribute::AttrKind Kind) |
removes the attribute from the list of attributes. | |
void | removeAttributeAtIndex (unsigned i, StringRef Kind) |
removes the attribute from the list of attributes. | |
void | removeFnAttr (Attribute::AttrKind Kind) |
Remove function attributes from this function. | |
void | removeFnAttr (StringRef Kind) |
Remove function attribute from this function. | |
void | removeFnAttrs (const AttributeMask &Attrs) |
void | removeRetAttr (Attribute::AttrKind Kind) |
removes the attribute from the return value list of attributes. | |
void | removeRetAttr (StringRef Kind) |
removes the attribute from the return value list of attributes. | |
void | removeRetAttrs (const AttributeMask &Attrs) |
removes the attributes from the return value list of attributes. | |
void | removeParamAttr (unsigned ArgNo, Attribute::AttrKind Kind) |
removes the attribute from the list of attributes. | |
void | removeParamAttr (unsigned ArgNo, StringRef Kind) |
removes the attribute from the list of attributes. | |
void | removeParamAttrs (unsigned ArgNo, const AttributeMask &Attrs) |
removes the attribute from the list of attributes. | |
bool | hasFnAttribute (Attribute::AttrKind Kind) const |
Return true if the function has the attribute. | |
bool | hasFnAttribute (StringRef Kind) const |
Return true if the function has the attribute. | |
bool | hasRetAttribute (Attribute::AttrKind Kind) const |
check if an attribute is in the list of attributes for the return value. | |
bool | hasParamAttribute (unsigned ArgNo, Attribute::AttrKind Kind) const |
check if an attributes is in the list of attributes. | |
Attribute | getAttributeAtIndex (unsigned i, Attribute::AttrKind Kind) const |
gets the attribute from the list of attributes. | |
Attribute | getAttributeAtIndex (unsigned i, StringRef Kind) const |
gets the attribute from the list of attributes. | |
Attribute | getFnAttribute (Attribute::AttrKind Kind) const |
Return the attribute for the given attribute kind. | |
Attribute | getFnAttribute (StringRef Kind) const |
Return the attribute for the given attribute kind. | |
Attribute | getRetAttribute (Attribute::AttrKind Kind) const |
Return the attribute for the given attribute kind for the return value. | |
uint64_t | getFnAttributeAsParsedInteger (StringRef Kind, uint64_t Default=0) const |
For a string attribute Kind , parse attribute as an integer. | |
Attribute | getParamAttribute (unsigned ArgNo, Attribute::AttrKind Kind) const |
gets the specified attribute from the list of attributes. | |
MaybeAlign | getFnStackAlign () const |
Return the stack alignment for the function. | |
bool | hasStackProtectorFnAttr () const |
Returns true if the function has ssp, sspstrong, or sspreq fn attrs. | |
void | addDereferenceableParamAttr (unsigned ArgNo, uint64_t Bytes) |
adds the dereferenceable attribute to the list of attributes for the given arg. | |
void | addDereferenceableOrNullParamAttr (unsigned ArgNo, uint64_t Bytes) |
adds the dereferenceable_or_null attribute to the list of attributes for the given arg. | |
void | addRangeRetAttr (const ConstantRange &CR) |
adds the range attribute to the list of attributes for the return value. | |
MaybeAlign | getParamAlign (unsigned ArgNo) const |
MaybeAlign | getParamStackAlign (unsigned ArgNo) const |
Type * | getParamByValType (unsigned ArgNo) const |
Extract the byval type for a parameter. | |
Type * | getParamStructRetType (unsigned ArgNo) const |
Extract the sret type for a parameter. | |
Type * | getParamInAllocaType (unsigned ArgNo) const |
Extract the inalloca type for a parameter. | |
Type * | getParamByRefType (unsigned ArgNo) const |
Extract the byref type for a parameter. | |
Type * | getParamPreallocatedType (unsigned ArgNo) const |
Extract the preallocated type for a parameter. | |
uint64_t | getParamDereferenceableBytes (unsigned ArgNo) const |
Extract the number of dereferenceable bytes for a parameter. | |
uint64_t | getParamDereferenceableOrNullBytes (unsigned ArgNo) const |
Extract the number of dereferenceable_or_null bytes for a parameter. | |
FPClassTest | getParamNoFPClass (unsigned ArgNo) const |
Extract the nofpclass attribute for a parameter. | |
bool | isPresplitCoroutine () const |
Determine if the function is presplit coroutine. | |
void | setPresplitCoroutine () |
void | setSplittedCoroutine () |
bool | isCoroOnlyDestroyWhenComplete () const |
void | setCoroDestroyOnlyWhenComplete () |
MemoryEffects | getMemoryEffects () const |
void | setMemoryEffects (MemoryEffects ME) |
bool | doesNotAccessMemory () const |
Determine if the function does not access memory. | |
void | setDoesNotAccessMemory () |
bool | onlyReadsMemory () const |
Determine if the function does not access or only reads memory. | |
void | setOnlyReadsMemory () |
bool | onlyWritesMemory () const |
Determine if the function does not access or only writes memory. | |
void | setOnlyWritesMemory () |
bool | onlyAccessesArgMemory () const |
Determine if the call can access memmory only using pointers based on its arguments. | |
void | setOnlyAccessesArgMemory () |
bool | onlyAccessesInaccessibleMemory () const |
Determine if the function may only access memory that is inaccessible from the IR. | |
void | setOnlyAccessesInaccessibleMemory () |
bool | onlyAccessesInaccessibleMemOrArgMem () const |
Determine if the function may only access memory that is either inaccessible from the IR or pointed to by its arguments. | |
void | setOnlyAccessesInaccessibleMemOrArgMem () |
bool | doesNotReturn () const |
Determine if the function cannot return. | |
void | setDoesNotReturn () |
bool | doesNoCfCheck () const |
Determine if the function should not perform indirect branch tracking. | |
bool | doesNotThrow () const |
Determine if the function cannot unwind. | |
void | setDoesNotThrow () |
bool | cannotDuplicate () const |
Determine if the call cannot be duplicated. | |
void | setCannotDuplicate () |
bool | isConvergent () const |
Determine if the call is convergent. | |
void | setConvergent () |
void | setNotConvergent () |
bool | isSpeculatable () const |
Determine if the call has sideeffects. | |
void | setSpeculatable () |
bool | doesNotFreeMemory () const |
Determine if the call might deallocate memory. | |
void | setDoesNotFreeMemory () |
bool | hasNoSync () const |
Determine if the call can synchroize with other threads. | |
void | setNoSync () |
bool | doesNotRecurse () const |
Determine if the function is known not to recurse, directly or indirectly. | |
void | setDoesNotRecurse () |
bool | mustProgress () const |
Determine if the function is required to make forward progress. | |
void | setMustProgress () |
bool | willReturn () const |
Determine if the function will return. | |
void | setWillReturn () |
UWTableKind | getUWTableKind () const |
Get what kind of unwind table entry to generate for this function. | |
bool | hasUWTable () const |
True if the ABI mandates (or the user requested) that this function be in a unwind table. | |
void | setUWTableKind (UWTableKind K) |
bool | needsUnwindTableEntry () const |
True if this function needs an unwind table. | |
bool | hasStructRetAttr () const |
Determine if the function returns a structure through first or second pointer argument. | |
bool | returnDoesNotAlias () const |
Determine if the parameter or return value is marked with NoAlias attribute. | |
void | setReturnDoesNotAlias () |
bool | hasOptNone () const |
Do not optimize this function (-O0). | |
bool | hasMinSize () const |
Optimize this function for minimum size (-Oz). | |
bool | hasOptSize () const |
Optimize this function for size (-Os) or minimum size (-Oz). | |
DenormalMode | getDenormalMode (const fltSemantics &FPType) const |
Returns the denormal handling type for the default rounding mode of the function. | |
DenormalMode | getDenormalModeRaw () const |
Return the representational value of "denormal-fp-math". | |
DenormalMode | getDenormalModeF32Raw () const |
Return the representational value of "denormal-fp-math-f32". | |
void | copyAttributesFrom (const Function *Src) |
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the Function Src to this one. | |
void | deleteBody () |
deleteBody - This method deletes the body of the function, and converts the linkage to external. | |
void | removeFromParent () |
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it. | |
void | eraseFromParent () |
eraseFromParent - This method unlinks 'this' from the containing module and deletes it. | |
void | stealArgumentListFrom (Function &Src) |
Steal arguments from another function. | |
Function::iterator | insert (Function::iterator Position, BasicBlock *BB) |
Insert BB in the basic block list at Position . | |
void | splice (Function::iterator ToIt, Function *FromF) |
Transfer all blocks from FromF to this function at ToIt . | |
void | splice (Function::iterator ToIt, Function *FromF, Function::iterator FromIt) |
Transfer one BasicBlock from FromF at FromIt to this function at ToIt . | |
void | splice (Function::iterator ToIt, Function *FromF, Function::iterator FromBeginIt, Function::iterator FromEndIt) |
Transfer a range of basic blocks that belong to FromF from FromBeginIt to FromEndIt , to this function at ToIt . | |
Function::iterator | erase (Function::iterator FromIt, Function::iterator ToIt) |
Erases a range of BasicBlocks from FromIt to (not including) ToIt . | |
const BasicBlock & | getEntryBlock () const |
BasicBlock & | getEntryBlock () |
ValueSymbolTable * | getValueSymbolTable () |
getSymbolTable() - Return the symbol table if any, otherwise nullptr. | |
const ValueSymbolTable * | getValueSymbolTable () const |
unsigned | getMaxBlockNumber () const |
Return a value larger than the largest block number. | |
void | renumberBlocks () |
Renumber basic blocks into a dense value range starting from 0. | |
unsigned | getBlockNumberEpoch () const |
Return the "epoch" of current block numbers. | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
size_t | size () const |
bool | empty () const |
const BasicBlock & | front () const |
BasicBlock & | front () |
const BasicBlock & | back () const |
BasicBlock & | back () |
size_t | arg_size () const |
bool | arg_empty () const |
bool | hasPersonalityFn () const |
Check whether this function has a personality function. | |
Constant * | getPersonalityFn () const |
Get the personality function associated with this function. | |
void | setPersonalityFn (Constant *Fn) |
bool | hasPrefixData () const |
Check whether this function has prefix data. | |
Constant * | getPrefixData () const |
Get the prefix data associated with this function. | |
void | setPrefixData (Constant *PrefixData) |
bool | hasPrologueData () const |
Check whether this function has prologue data. | |
Constant * | getPrologueData () const |
Get the prologue data associated with this function. | |
void | setPrologueData (Constant *PrologueData) |
void | print (raw_ostream &OS, AssemblyAnnotationWriter *AAW=nullptr, bool ShouldPreserveUseListOrder=false, bool IsForDebug=false) const |
Print the function to an output stream with an optional AssemblyAnnotationWriter. | |
void | viewCFG () const |
viewCFG - This function is meant for use from the debugger. | |
void | viewCFG (bool ViewCFGOnly, const BlockFrequencyInfo *BFI, const BranchProbabilityInfo *BPI) const |
Extended form to print edge weights. | |
void | viewCFGOnly () const |
viewCFGOnly - This function is meant for use from the debugger. | |
void | viewCFGOnly (const BlockFrequencyInfo *BFI, const BranchProbabilityInfo *BPI) const |
Extended form to print edge weights. | |
void | dropAllReferences () |
dropAllReferences() - This method causes all the subinstructions to "let
go" of all references that they are maintaining. | |
bool | hasAddressTaken (const User **=nullptr, bool IgnoreCallbackUses=false, bool IgnoreAssumeLikeCalls=true, bool IngoreLLVMUsed=false, bool IgnoreARCAttachedCall=false, bool IgnoreCastedDirectCall=false) const |
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invokes to it, or blockaddress expressions. | |
bool | isDefTriviallyDead () const |
isDefTriviallyDead - Return true if it is trivially safe to remove this function definition from the module (because it isn't externally visible, does not have its address taken, and has no callers). | |
bool | callsFunctionThatReturnsTwice () const |
callsFunctionThatReturnsTwice - Return true if the function has a call to setjmp or other function that gcc recognizes as "returning twice". | |
void | setSubprogram (DISubprogram *SP) |
Set the attached subprogram. | |
DISubprogram * | getSubprogram () const |
Get the attached subprogram. | |
bool | shouldEmitDebugInfoForProfiling () const |
Returns true if we should emit debug info for profiling. | |
bool | nullPointerIsDefined () const |
Check if null pointer dereferencing is considered undefined behavior for the function. | |
Function Argument Iteration | |
arg_iterator | arg_begin () |
const_arg_iterator | arg_begin () const |
arg_iterator | arg_end () |
const_arg_iterator | arg_end () const |
Argument * | getArg (unsigned i) const |
iterator_range< arg_iterator > | args () |
iterator_range< const_arg_iterator > | args () const |
Public Member Functions inherited from llvm::GlobalObject | |
GlobalObject (const GlobalObject &)=delete | |
uint64_t | getAlignment () const |
FIXME: Remove this function once transition to Align is over. | |
MaybeAlign | getAlign () const |
Returns the alignment of the given variable or function. | |
void | setAlignment (Align Align) |
Sets the alignment attribute of the GlobalObject. | |
void | setAlignment (MaybeAlign Align) |
Sets the alignment attribute of the GlobalObject. | |
unsigned | getGlobalObjectSubClassData () const |
void | setGlobalObjectSubClassData (unsigned Val) |
bool | hasSection () const |
Check if this global has a custom object file section. | |
StringRef | getSection () const |
Get the custom section of this global if it has one. | |
void | setSection (StringRef S) |
Change the section for this global. | |
bool | hasComdat () const |
const Comdat * | getComdat () const |
Comdat * | getComdat () |
void | setComdat (Comdat *C) |
void | copyMetadata (const GlobalObject *Src, unsigned Offset) |
Copy metadata from Src, adjusting offsets by Offset. | |
void | addTypeMetadata (unsigned Offset, Metadata *TypeID) |
void | setVCallVisibilityMetadata (VCallVisibility Visibility) |
VCallVisibility | getVCallVisibility () const |
bool | canIncreaseAlignment () const |
Returns true if the alignment of the value can be unilaterally increased. | |
void | addMetadata (unsigned KindID, MDNode &MD) |
Add a metadata attachment. | |
void | addMetadata (StringRef Kind, MDNode &MD) |
void | clearMetadata () |
Erase all metadata attached to this Value. | |
bool | eraseMetadata (unsigned KindID) |
Erase all metadata attachments with the given kind. | |
void | eraseMetadataIf (function_ref< bool(unsigned, MDNode *)> Pred) |
Erase all metadata attachments matching the given predicate. | |
void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const |
Appends all metadata attached to this value to MDs , sorting by KindID. | |
MDNode * | getMetadata (unsigned KindID) const |
Get the current metadata attachments for the given kind, if any. | |
MDNode * | getMetadata (StringRef Kind) const |
void | getMetadata (unsigned KindID, SmallVectorImpl< MDNode * > &MDs) const |
Appends all attachments with the given ID to MDs in insertion order. | |
void | getMetadata (StringRef Kind, SmallVectorImpl< MDNode * > &MDs) const |
bool | hasMetadata () const |
Return true if this value has any metadata attached to it. | |
bool | hasMetadata (unsigned KindID) const |
Return true if this value has the given type of metadata attached. | |
bool | hasMetadata (StringRef Kind) const |
void | setMetadata (unsigned KindID, MDNode *Node) |
Set a particular kind of metadata attachment. | |
void | setMetadata (StringRef Kind, MDNode *Node) |
Public Member Functions inherited from llvm::GlobalValue | |
GlobalValue (const GlobalValue &)=delete | |
unsigned | getAddressSpace () const |
bool | hasGlobalUnnamedAddr () const |
bool | hasAtLeastLocalUnnamedAddr () const |
Returns true if this value's address is not significant in this module. | |
UnnamedAddr | getUnnamedAddr () const |
void | setUnnamedAddr (UnnamedAddr Val) |
bool | hasComdat () const |
const Comdat * | getComdat () const |
Comdat * | getComdat () |
VisibilityTypes | getVisibility () const |
bool | hasDefaultVisibility () const |
bool | hasHiddenVisibility () const |
bool | hasProtectedVisibility () const |
void | setVisibility (VisibilityTypes V) |
bool | isThreadLocal () const |
If the value is "Thread Local", its value isn't shared by the threads. | |
void | setThreadLocal (bool Val) |
void | setThreadLocalMode (ThreadLocalMode Val) |
ThreadLocalMode | getThreadLocalMode () const |
DLLStorageClassTypes | getDLLStorageClass () const |
bool | hasDLLImportStorageClass () const |
bool | hasDLLExportStorageClass () const |
void | setDLLStorageClass (DLLStorageClassTypes C) |
bool | hasSection () const |
StringRef | getSection () const |
PointerType * | getType () const |
Global values are always pointers. | |
Type * | getValueType () const |
bool | isImplicitDSOLocal () const |
void | setDSOLocal (bool Local) |
bool | isDSOLocal () const |
bool | hasPartition () const |
StringRef | getPartition () const |
void | setPartition (StringRef Part) |
bool | hasSanitizerMetadata () const |
const SanitizerMetadata & | getSanitizerMetadata () const |
void | setSanitizerMetadata (SanitizerMetadata Meta) |
void | removeSanitizerMetadata () |
void | setNoSanitizeMetadata () |
bool | isTagged () const |
bool | isDefinitionExact () const |
Return true if the currently visible definition of this global (if any) is exactly the definition we will see at runtime. | |
bool | hasExactDefinition () const |
Return true if this global has an exact defintion. | |
bool | isInterposable () const |
Return true if this global's definition can be substituted with an arbitrary definition at link time or load time. | |
bool | canBenefitFromLocalAlias () const |
bool | hasExternalLinkage () const |
bool | hasAvailableExternallyLinkage () const |
bool | hasLinkOnceLinkage () const |
bool | hasLinkOnceAnyLinkage () const |
bool | hasLinkOnceODRLinkage () const |
bool | hasWeakLinkage () const |
bool | hasWeakAnyLinkage () const |
bool | hasWeakODRLinkage () const |
bool | hasAppendingLinkage () const |
bool | hasInternalLinkage () const |
bool | hasPrivateLinkage () const |
bool | hasLocalLinkage () const |
bool | hasExternalWeakLinkage () const |
bool | hasCommonLinkage () const |
bool | hasValidDeclarationLinkage () const |
void | setLinkage (LinkageTypes LT) |
LinkageTypes | getLinkage () const |
bool | isDiscardableIfUnused () const |
bool | isWeakForLinker () const |
std::string | getGlobalIdentifier () const |
Return the modified name for this global value suitable to be used as the key for a global lookup (e.g. | |
GUID | getGUID () const |
Return a 64-bit global unique ID constructed from global value name (i.e. | |
bool | isDeclaration () const |
Return true if the primary definition of this global value is outside of the current translation unit. | |
bool | isDeclarationForLinker () const |
bool | isStrongDefinitionForLinker () const |
Returns true if this global's definition will be the one chosen by the linker. | |
const GlobalObject * | getAliaseeObject () const |
GlobalObject * | getAliaseeObject () |
bool | isAbsoluteSymbolRef () const |
Returns whether this is a reference to an absolute symbol. | |
std::optional< ConstantRange > | getAbsoluteSymbolRange () const |
If this is an absolute symbol reference, returns the range of the symbol, otherwise returns std::nullopt. | |
void | removeFromParent () |
This method unlinks 'this' from the containing module, but does not delete it. | |
void | eraseFromParent () |
This method unlinks 'this' from the containing module and deletes it. | |
Module * | getParent () |
Get the module that this global value is contained inside of... | |
const Module * | getParent () const |
const DataLayout & | getDataLayout () const |
Get the data layout of the module this global belongs to. | |
bool | canBeOmittedFromSymbolTable () const |
True if GV can be left out of the object symbol table. | |
bool | isMaterializable () const |
If this function's Module is being lazily streamed in functions from disk or some other source, this method can be used to check to see if the function has been read in yet or not. | |
Error | materialize () |
Make sure this GlobalValue is fully read. | |
Public Member Functions inherited from llvm::Constant | |
void | operator= (const Constant &)=delete |
Constant (const Constant &)=delete | |
bool | isNullValue () const |
Return true if this is the value that would be returned by getNullValue. | |
bool | isOneValue () const |
Returns true if the value is one. | |
bool | isNotOneValue () const |
Return true if the value is not the one value, or, for vectors, does not contain one value elements. | |
bool | isAllOnesValue () const |
Return true if this is the value that would be returned by getAllOnesValue. | |
bool | isNegativeZeroValue () const |
Return true if the value is what would be returned by getZeroValueForNegation. | |
bool | isZeroValue () const |
Return true if the value is negative zero or null value. | |
bool | isNotMinSignedValue () const |
Return true if the value is not the smallest signed value, or, for vectors, does not contain smallest signed value elements. | |
bool | isMinSignedValue () const |
Return true if the value is the smallest signed value. | |
bool | isFiniteNonZeroFP () const |
Return true if this is a finite and non-zero floating-point scalar constant or a fixed width vector constant with all finite and non-zero elements. | |
bool | isNormalFP () const |
Return true if this is a normal (as opposed to denormal, infinity, nan, or zero) floating-point scalar constant or a vector constant with all normal elements. | |
bool | hasExactInverseFP () const |
Return true if this scalar has an exact multiplicative inverse or this vector has an exact multiplicative inverse for each element in the vector. | |
bool | isNaN () const |
Return true if this is a floating-point NaN constant or a vector floating-point constant with all NaN elements. | |
bool | isElementWiseEqual (Value *Y) const |
Return true if this constant and a constant 'Y' are element-wise equal. | |
bool | containsUndefOrPoisonElement () const |
Return true if this is a vector constant that includes any undef or poison elements. | |
bool | containsPoisonElement () const |
Return true if this is a vector constant that includes any poison elements. | |
bool | containsUndefElement () const |
Return true if this is a vector constant that includes any strictly undef (not poison) elements. | |
bool | containsConstantExpression () const |
Return true if this is a fixed width vector constant that includes any constant expressions. | |
bool | isThreadDependent () const |
Return true if the value can vary between threads. | |
bool | isDLLImportDependent () const |
Return true if the value is dependent on a dllimport variable. | |
bool | isConstantUsed () const |
Return true if the constant has users other than constant expressions and other dangling things. | |
bool | needsRelocation () const |
This method classifies the entry according to whether or not it may generate a relocation entry (either static or dynamic). | |
bool | needsDynamicRelocation () const |
Constant * | getAggregateElement (unsigned Elt) const |
For aggregates (struct/array/vector) return the constant that corresponds to the specified element if possible, or null if not. | |
Constant * | getAggregateElement (Constant *Elt) const |
Constant * | getSplatValue (bool AllowPoison=false) const |
If all elements of the vector constant have the same value, return that value. | |
const APInt & | getUniqueInteger () const |
If C is a constant integer then return its value, otherwise C must be a vector of constant integers, all equal, and the common value is returned. | |
ConstantRange | toConstantRange () const |
Convert constant to an approximate constant range. | |
void | destroyConstant () |
Called if some element of this constant is no longer valid. | |
void | handleOperandChange (Value *, Value *) |
This method is a special form of User::replaceUsesOfWith (which does not work on constants) that does work on constants. | |
void | removeDeadConstantUsers () const |
If there are any dead constant users dangling off of this constant, remove them. | |
bool | hasOneLiveUse () const |
Return true if the constant has exactly one live use. | |
bool | hasZeroLiveUses () const |
Return true if the constant has no live uses. | |
const Constant * | stripPointerCasts () const |
Constant * | stripPointerCasts () |
bool | isManifestConstant () const |
Return true if a constant is ConstantData or a ConstantAggregate or ConstantExpr that contain only ConstantData. | |
Public Member Functions inherited from llvm::User | |
User (const User &)=delete | |
void | operator delete (void *Usr) |
Free memory allocated for User and Use objects. | |
void | operator delete (void *Usr, unsigned) |
Placement delete - required by std, called if the ctor throws. | |
void | operator delete (void *Usr, unsigned, unsigned) |
Placement delete - required by std, called if the ctor throws. | |
const Use * | getOperandList () const |
Use * | getOperandList () |
Value * | getOperand (unsigned i) const |
void | setOperand (unsigned i, Value *Val) |
const Use & | getOperandUse (unsigned i) const |
Use & | getOperandUse (unsigned i) |
unsigned | getNumOperands () const |
ArrayRef< const uint8_t > | getDescriptor () const |
Returns the descriptor co-allocated with this User instance. | |
MutableArrayRef< uint8_t > | getDescriptor () |
Returns the descriptor co-allocated with this User instance. | |
void | setGlobalVariableNumOperands (unsigned NumOps) |
Set the number of operands on a GlobalVariable. | |
void | setNumHungOffUseOperands (unsigned NumOps) |
Subclasses with hung off uses need to manage the operand count themselves. | |
bool | isDroppable () const |
A droppable user is a user for which uses can be dropped without affecting correctness and should be dropped rather than preventing a transformation from happening. | |
op_iterator | op_begin () |
const_op_iterator | op_begin () const |
op_iterator | op_end () |
const_op_iterator | op_end () const |
op_range | operands () |
const_op_range | operands () const |
value_op_iterator | value_op_begin () |
value_op_iterator | value_op_end () |
iterator_range< value_op_iterator > | operand_values () |
const_value_op_iterator | value_op_begin () const |
const_value_op_iterator | value_op_end () const |
iterator_range< const_value_op_iterator > | operand_values () const |
void | dropAllReferences () |
Drop all references to operands. | |
bool | replaceUsesOfWith (Value *From, Value *To) |
Replace uses of one Value with another. | |
Public Member Functions inherited from llvm::Value | |
Value (const Value &)=delete | |
Value & | operator= (const Value &)=delete |
void | deleteValue () |
Delete a pointer to a generic Value. | |
void | dump () const |
Support for debugging, callable in GDB: V->dump() | |
Type * | getType () const |
All values are typed, get the type of this value. | |
LLVMContext & | getContext () const |
All values hold a context through their type. | |
bool | hasName () const |
ValueName * | getValueName () const |
void | setValueName (ValueName *VN) |
StringRef | getName () const |
Return a constant reference to the value's name. | |
void | setName (const Twine &Name) |
Change the name of the value. | |
void | takeName (Value *V) |
Transfer the name from V to this value. | |
std::string | getNameOrAsOperand () const |
void | replaceAllUsesWith (Value *V) |
Change all uses of this to point to a new Value. | |
void | replaceNonMetadataUsesWith (Value *V) |
Change non-metadata uses of this to point to a new Value. | |
void | replaceUsesWithIf (Value *New, llvm::function_ref< bool(Use &U)> ShouldReplace) |
Go through the uses list for this definition and make each use point to "V" if the callback ShouldReplace returns true for the given Use. | |
void | replaceUsesOutsideBlock (Value *V, BasicBlock *BB) |
replaceUsesOutsideBlock - Go through the uses list for this definition and make each use point to "V" instead of "this" when the use is outside the block. | |
void | assertModuleIsMaterializedImpl () const |
void | assertModuleIsMaterialized () const |
bool | use_empty () const |
bool | materialized_use_empty () const |
use_iterator | materialized_use_begin () |
const_use_iterator | materialized_use_begin () const |
use_iterator | use_begin () |
const_use_iterator | use_begin () const |
use_iterator | use_end () |
const_use_iterator | use_end () const |
iterator_range< use_iterator > | materialized_uses () |
iterator_range< const_use_iterator > | materialized_uses () const |
iterator_range< use_iterator > | uses () |
iterator_range< const_use_iterator > | uses () const |
bool | user_empty () const |
user_iterator | materialized_user_begin () |
const_user_iterator | materialized_user_begin () const |
user_iterator | user_begin () |
const_user_iterator | user_begin () const |
user_iterator | user_end () |
const_user_iterator | user_end () const |
User * | user_back () |
const User * | user_back () const |
iterator_range< user_iterator > | materialized_users () |
iterator_range< const_user_iterator > | materialized_users () const |
iterator_range< user_iterator > | users () |
iterator_range< const_user_iterator > | users () const |
bool | hasOneUse () const |
Return true if there is exactly one use of this value. | |
bool | hasNUses (unsigned N) const |
Return true if this Value has exactly N uses. | |
bool | hasNUsesOrMore (unsigned N) const |
Return true if this value has N uses or more. | |
bool | hasOneUser () const |
Return true if there is exactly one user of this value. | |
Use * | getSingleUndroppableUse () |
Return true if there is exactly one use of this value that cannot be dropped. | |
const Use * | getSingleUndroppableUse () const |
User * | getUniqueUndroppableUser () |
Return true if there is exactly one unique user of this value that cannot be dropped (that user can have multiple uses of this value). | |
const User * | getUniqueUndroppableUser () const |
bool | hasNUndroppableUses (unsigned N) const |
Return true if there this value. | |
bool | hasNUndroppableUsesOrMore (unsigned N) const |
Return true if this value has N uses or more. | |
void | dropDroppableUses (llvm::function_ref< bool(const Use *)> ShouldDrop=[](const Use *) { return true;}) |
Remove every uses that can safely be removed. | |
void | dropDroppableUsesIn (User &Usr) |
Remove every use of this value in User that can safely be removed. | |
bool | isUsedInBasicBlock (const BasicBlock *BB) const |
Check if this value is used in the specified basic block. | |
unsigned | getNumUses () const |
This method computes the number of uses of this Value. | |
void | addUse (Use &U) |
This method should only be used by the Use class. | |
unsigned | getValueID () const |
Return an ID for the concrete type of this object. | |
unsigned | getRawSubclassOptionalData () const |
Return the raw optional flags value contained in this value. | |
void | clearSubclassOptionalData () |
Clear the optional flags contained in this value. | |
bool | hasSameSubclassOptionalData (const Value *V) const |
Check the optional flags for equality. | |
bool | hasValueHandle () const |
Return true if there is a value handle associated with this value. | |
bool | isUsedByMetadata () const |
Return true if there is metadata referencing this value. | |
bool | isSwiftError () const |
Return true if this value is a swifterror value. | |
const Value * | stripPointerCasts () const |
Strip off pointer casts, all-zero GEPs and address space casts. | |
Value * | stripPointerCasts () |
const Value * | stripPointerCastsAndAliases () const |
Strip off pointer casts, all-zero GEPs, address space casts, and aliases. | |
Value * | stripPointerCastsAndAliases () |
const Value * | stripPointerCastsSameRepresentation () const |
Strip off pointer casts, all-zero GEPs and address space casts but ensures the representation of the result stays the same. | |
Value * | stripPointerCastsSameRepresentation () |
const Value * | stripPointerCastsForAliasAnalysis () const |
Strip off pointer casts, all-zero GEPs, single-argument phi nodes and invariant group info. | |
Value * | stripPointerCastsForAliasAnalysis () |
const Value * | stripInBoundsConstantOffsets () const |
Strip off pointer casts and all-constant inbounds GEPs. | |
Value * | stripInBoundsConstantOffsets () |
const Value * | stripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds, bool AllowInvariantGroup=false, function_ref< bool(Value &Value, APInt &Offset)> ExternalAnalysis=nullptr) const |
Accumulate the constant offset this value has compared to a base pointer. | |
Value * | stripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds, bool AllowInvariantGroup=false) |
const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
This is a wrapper around stripAndAccumulateConstantOffsets with the in-bounds requirement set to false. | |
Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
const Value * | stripInBoundsOffsets (function_ref< void(const Value *)> Func=[](const Value *) {}) const |
Strip off pointer casts and inbounds GEPs. | |
Value * | stripInBoundsOffsets (function_ref< void(const Value *)> Func=[](const Value *) {}) |
std::optional< int64_t > | getPointerOffsetFrom (const Value *Other, const DataLayout &DL) const |
If this ptr is provably equal to Other plus a constant offset, return that offset in bytes. | |
bool | canBeFreed () const |
Return true if the memory object referred to by V can by freed in the scope for which the SSA value defining the allocation is statically defined. | |
uint64_t | getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull, bool &CanBeFreed) const |
Returns the number of bytes known to be dereferenceable for the pointer value. | |
Align | getPointerAlignment (const DataLayout &DL) const |
Returns an alignment of the pointer value. | |
const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
Translate PHI node to its predecessor from the given basic block. | |
Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
void | mutateType (Type *Ty) |
Mutate the type of this Value to be of the specified type. | |
template<class Compare > | |
void | sortUseList (Compare Cmp) |
Sort the use-list. | |
void | reverseUseList () |
Reverse the use-list. | |
void | print (raw_ostream &O, bool IsForDebug=false) const |
Implement operator<< on Value. | |
void | print (raw_ostream &O, ModuleSlotTracker &MST, bool IsForDebug=false) const |
void | printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const |
Print the name of this Value out to the specified raw_ostream. | |
void | printAsOperand (raw_ostream &O, bool PrintType, ModuleSlotTracker &MST) const |
Public Member Functions inherited from llvm::ilist_node_impl< OptionsT > | |
self_iterator | getIterator () |
const_self_iterator | getIterator () const |
reverse_self_iterator | getReverseIterator () |
const_reverse_self_iterator | getReverseIterator () const |
bool | isSentinel () const |
Check whether this is the sentinel node. | |
Public Member Functions inherited from llvm::ilist_detail::node_parent_access< ilist_node_impl< OptionsT >, OptionsT::parent_ty > | |
const OptionsT::parent_ty * | getParent () const |
OptionsT::parent_ty * | getParent () |
void | setParent (OptionsT::parent_ty *Parent) |
Static Public Member Functions | |
static Function * | Create (FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr) |
static Function * | Create (FunctionType *Ty, LinkageTypes Linkage, const Twine &N="", Module *M=nullptr) |
static Function * | Create (FunctionType *Ty, LinkageTypes Linkage, const Twine &N, Module &M) |
Creates a new function and attaches it to a module. | |
static Function * | createWithDefaultAttr (FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr) |
Creates a function with some attributes recorded in llvm.module.flags and the LLVMContext applied. | |
static bool | isTargetIntrinsic (Intrinsic::ID IID) |
isTargetIntrinsic - Returns true if IID is an intrinsic specific to a certain target. | |
static Intrinsic::ID | lookupIntrinsicID (StringRef Name) |
This does the actual lookup of an intrinsic ID which matches the given function name. | |
static bool | classof (const Value *V) |
Methods for support type inquiry through isa, cast, and dyn_cast: | |
Static Public Member Functions inherited from llvm::GlobalObject | |
static bool | classof (const Value *V) |
Static Public Member Functions inherited from llvm::GlobalValue | |
static UnnamedAddr | getMinUnnamedAddr (UnnamedAddr A, UnnamedAddr B) |
static LinkageTypes | getLinkOnceLinkage (bool ODR) |
static LinkageTypes | getWeakLinkage (bool ODR) |
static bool | isExternalLinkage (LinkageTypes Linkage) |
static bool | isAvailableExternallyLinkage (LinkageTypes Linkage) |
static bool | isLinkOnceAnyLinkage (LinkageTypes Linkage) |
static bool | isLinkOnceODRLinkage (LinkageTypes Linkage) |
static bool | isLinkOnceLinkage (LinkageTypes Linkage) |
static bool | isWeakAnyLinkage (LinkageTypes Linkage) |
static bool | isWeakODRLinkage (LinkageTypes Linkage) |
static bool | isWeakLinkage (LinkageTypes Linkage) |
static bool | isAppendingLinkage (LinkageTypes Linkage) |
static bool | isInternalLinkage (LinkageTypes Linkage) |
static bool | isPrivateLinkage (LinkageTypes Linkage) |
static bool | isLocalLinkage (LinkageTypes Linkage) |
static bool | isExternalWeakLinkage (LinkageTypes Linkage) |
static bool | isCommonLinkage (LinkageTypes Linkage) |
static bool | isValidDeclarationLinkage (LinkageTypes Linkage) |
static bool | isInterposableLinkage (LinkageTypes Linkage) |
Whether the definition of this global may be replaced by something non-equivalent at link time. | |
static bool | isDiscardableIfUnused (LinkageTypes Linkage) |
Whether the definition of this global may be discarded if it is not used in its compilation unit. | |
static bool | isWeakForLinker (LinkageTypes Linkage) |
Whether the definition of this global may be replaced at link time. | |
static StringRef | dropLLVMManglingEscape (StringRef Name) |
If the given string begins with the GlobalValue name mangling escape character '\1', drop it. | |
static std::string | getGlobalIdentifier (StringRef Name, GlobalValue::LinkageTypes Linkage, StringRef FileName) |
Return the modified name for a global value suitable to be used as the key for a global lookup (e.g. | |
static GUID | getGUID (StringRef GlobalName) |
Return a 64-bit global unique ID constructed from global value name (i.e. | |
static bool | classof (const Value *V) |
Static Public Member Functions inherited from llvm::Constant | |
static bool | classof (const Value *V) |
static Constant * | getNullValue (Type *Ty) |
Constructor to create a '0' constant of arbitrary type. | |
static Constant * | getAllOnesValue (Type *Ty) |
static Constant * | getIntegerValue (Type *Ty, const APInt &V) |
Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value. | |
static Constant * | replaceUndefsWith (Constant *C, Constant *Replacement) |
Try to replace undefined constant C or undefined elements in C with Replacement. | |
static Constant * | mergeUndefsWith (Constant *C, Constant *Other) |
Merges undefs of a Constant with another Constant, along with the undefs already present. | |
Static Public Member Functions inherited from llvm::User | |
static bool | classof (const Value *V) |
Static Public Member Functions inherited from llvm::Value | |
static void | dropDroppableUse (Use &U) |
Remove the droppable use U . | |
Public Attributes | |
bool | IsNewDbgInfoFormat |
Is this function using intrinsics to record the position of debugging information, or non-intrinsic records? See IsNewDbgInfoFormat in BasicBlock. | |
Friends | |
class | SymbolTableListTraits< Function > |
class | TargetLibraryInfoImpl |
template<class BB_t , class BB_i_t , class BI_t , class II_t > | |
class | InstIterator |
class | llvm::SymbolTableListTraits< llvm::BasicBlock > |
class | llvm::ilist_node_with_parent< llvm::BasicBlock, llvm::Function > |
void | BasicBlock::setParent (Function *) |
void | BasicBlock::removeFromParent () |
iplist< BasicBlock >::iterator | BasicBlock::eraseFromParent () |
Additional Inherited Members | |
Static Public Attributes inherited from llvm::Value | |
static constexpr unsigned | MaxAlignmentExponent = 32 |
The maximum alignment for instructions. | |
static constexpr uint64_t | MaximumAlignment = 1ULL << MaxAlignmentExponent |
Protected Types inherited from llvm::GlobalObject | |
enum | { LastAlignmentBit = 5 , LastCodeModelBit = 8 , HasSectionHashEntryBit , GlobalObjectBits } |
Protected Types inherited from llvm::Value | |
enum | : unsigned { NumUserOperandsBits = 27 } |
The number of operands in the subclass. More... | |
Protected Types inherited from llvm::ilist_node_impl< OptionsT > | |
using | self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, false >::type |
using | const_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, true >::type |
using | reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, false >::type |
using | const_reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, true >::type |
Protected Member Functions inherited from llvm::GlobalObject | |
GlobalObject (Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace=0) | |
~GlobalObject () | |
void | copyAttributesFrom (const GlobalObject *Src) |
Protected Member Functions inherited from llvm::GlobalValue | |
GlobalValue (Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace) | |
unsigned | getGlobalValueSubClassData () const |
void | setGlobalValueSubClassData (unsigned V) |
void | setParent (Module *parent) |
~GlobalValue () | |
void | copyAttributesFrom (const GlobalValue *Src) |
Copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to this one. | |
Protected Member Functions inherited from llvm::Constant | |
Constant (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps) | |
~Constant ()=default | |
Protected Member Functions inherited from llvm::User | |
void * | operator new (size_t Size) |
Allocate a User with an operand pointer co-allocated. | |
void * | operator new (size_t Size, unsigned Us) |
Allocate a User with the operands co-allocated. | |
void * | operator new (size_t Size, unsigned Us, unsigned DescBytes) |
Allocate a User with the operands co-allocated. | |
User (Type *ty, unsigned vty, Use *, unsigned NumOps) | |
void | allocHungoffUses (unsigned N, bool IsPhi=false) |
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User. | |
void | growHungoffUses (unsigned N, bool IsPhi=false) |
Grow the number of hung off uses. | |
~User ()=default | |
template<int Idx> | |
Use & | Op () |
template<int Idx> | |
const Use & | Op () const |
Protected Member Functions inherited from llvm::Value | |
Value (Type *Ty, unsigned scid) | |
~Value () | |
Value's destructor should be virtual by design, but that would require that Value and all of its subclasses have a vtable that effectively duplicates the information in the value ID. | |
void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const |
Appends all metadata attached to this value to MDs , sorting by KindID. | |
bool | hasMetadata () const |
Return true if this value has any metadata attached to it. | |
bool | eraseMetadata (unsigned KindID) |
Erase all metadata attachments with the given kind. | |
void | eraseMetadataIf (function_ref< bool(unsigned, MDNode *)> Pred) |
Erase all metadata attachments matching the given predicate. | |
void | clearMetadata () |
Erase all metadata attached to this Value. | |
MDNode * | getMetadataImpl (unsigned KindID) const |
Get metadata for the given kind, if any. | |
unsigned short | getSubclassDataFromValue () const |
void | setValueSubclassData (unsigned short D) |
MDNode * | getMetadata (unsigned KindID) const |
Get the current metadata attachments for the given kind, if any. | |
MDNode * | getMetadata (StringRef Kind) const |
void | getMetadata (unsigned KindID, SmallVectorImpl< MDNode * > &MDs) const |
Appends all attachments with the given ID to MDs in insertion order. | |
void | getMetadata (StringRef Kind, SmallVectorImpl< MDNode * > &MDs) const |
bool | hasMetadata (unsigned KindID) const |
Return true if this value has the given type of metadata attached. | |
bool | hasMetadata (StringRef Kind) const |
void | setMetadata (unsigned KindID, MDNode *Node) |
Set a particular kind of metadata attachment. | |
void | setMetadata (StringRef Kind, MDNode *Node) |
void | addMetadata (unsigned KindID, MDNode &MD) |
Add a metadata attachment. | |
void | addMetadata (StringRef Kind, MDNode &MD) |
Protected Member Functions inherited from llvm::ilist_node_impl< OptionsT > | |
ilist_node_impl ()=default | |
Static Protected Member Functions inherited from llvm::User | |
template<int Idx, typename U > | |
static Use & | OpFrom (const U *that) |
Protected Attributes inherited from llvm::GlobalObject | |
Comdat * | ObjComdat = nullptr |
Protected Attributes inherited from llvm::GlobalValue | |
Type * | ValueType |
unsigned | Linkage: 4 |
unsigned | Visibility: 2 |
unsigned | UnnamedAddrVal: 2 |
unsigned | DllStorageClass: 2 |
unsigned | ThreadLocal: 3 |
unsigned | HasLLVMReservedName: 1 |
True if the function's name starts with "llvm.". | |
unsigned | IsDSOLocal: 1 |
If true then there is a definition within the same linkage unit and that definition cannot be runtime preempted. | |
unsigned | HasPartition: 1 |
True if this symbol has a partition name assigned (see https://lld.llvm.org/Partitions.html). | |
unsigned | HasSanitizerMetadata: 1 |
True if this symbol has sanitizer metadata available. | |
Intrinsic::ID | IntID = (Intrinsic::ID)0U |
The intrinsic ID for this subclass (which must be a Function). | |
Module * | Parent = nullptr |
Protected Attributes inherited from llvm::Value | |
unsigned char | SubclassOptionalData: 7 |
Hold subclass data that can be dropped. | |
unsigned | NumUserOperands: NumUserOperandsBits |
unsigned | IsUsedByMD: 1 |
unsigned | HasName: 1 |
unsigned | HasMetadata: 1 |
unsigned | HasHungOffUses: 1 |
unsigned | HasDescriptor: 1 |
Static Protected Attributes inherited from llvm::GlobalObject | |
static const unsigned | GlobalObjectSubClassDataBits |
Static Protected Attributes inherited from llvm::GlobalValue | |
static const unsigned | GlobalValueSubClassDataBits = 15 |
Definition at line 63 of file Function.h.
using llvm::Function::arg_iterator = Argument * |
Definition at line 72 of file Function.h.
Definition at line 66 of file Function.h.
using llvm::Function::const_arg_iterator = const Argument * |
Definition at line 73 of file Function.h.
Definition at line 70 of file Function.h.
Definition at line 69 of file Function.h.
Enumerator | |
---|---|
PCT_Real | |
PCT_Synthetic |
Definition at line 291 of file Function.h.
Function::~Function | ( | ) |
Definition at line 533 of file Function.cpp.
References clearGC(), and dropAllReferences().
adds the attribute to the list of attributes.
Definition at line 649 of file Function.cpp.
References llvm::AttributeList::addAttributeAtIndex(), and getContext().
adds the dereferenceable_or_null attribute to the list of attributes for the given arg.
Definition at line 800 of file Function.cpp.
References llvm::AttributeList::addDereferenceableOrNullParamAttr(), and getContext().
adds the dereferenceable attribute to the list of attributes for the given arg.
Definition at line 738 of file Function.cpp.
References llvm::AttributeList::addDereferenceableParamAttr(), and getContext().
void Function::addFnAttr | ( | Attribute | Attr | ) |
Add function attributes to this function.
Definition at line 661 of file Function.cpp.
References llvm::AttributeList::addFnAttribute(), and getContext().
void Function::addFnAttr | ( | Attribute::AttrKind | Kind | ) |
Add function attributes to this function.
Definition at line 653 of file Function.cpp.
References llvm::AttributeList::addFnAttribute(), and getContext().
Referenced by assureFPCallStub(), createFPFnStub(), llvm::OpenMPIRBuilder::createOffloadEntry(), llvm::createSanitizerCtor(), doPromotion(), fillOverallFunction(), llvm::OpenMPIRBuilder::finalize(), hostParallelCallback(), llvm::NVPTXTargetLowering::LowerCall(), EnumAttr::set(), StrBoolAttr::set(), setMemoryEffects(), targetParallelCallback(), llvm::AttributeFuncs::updateMinLegalVectorWidthAttr(), llvm::OpenMPIRBuilder::writeTeamsForKernel(), and llvm::OpenMPIRBuilder::writeThreadBoundsForKernel().
Add function attributes to this function.
Definition at line 657 of file Function.cpp.
References llvm::AttributeList::addFnAttribute(), and getContext().
void Function::addFnAttrs | ( | const AttrBuilder & | Attrs | ) |
Add function attributes to this function.
Definition at line 665 of file Function.cpp.
References llvm::AttributeList::addFnAttributes(), and getContext().
adds the attribute to the list of attributes for the given arg.
Definition at line 685 of file Function.cpp.
References llvm::AttributeList::addParamAttribute(), and getContext().
void Function::addParamAttr | ( | unsigned | ArgNo, |
Attribute::AttrKind | Kind | ||
) |
adds the attribute to the list of attributes for the given arg.
Definition at line 681 of file Function.cpp.
References llvm::AttributeList::addParamAttribute(), and getContext().
Referenced by llvm::Argument::addAttr(), hostParallelCallback(), and targetParallelCallback().
void Function::addParamAttrs | ( | unsigned | ArgNo, |
const AttrBuilder & | Attrs | ||
) |
adds the attributes to the list of attributes for the given arg.
Definition at line 689 of file Function.cpp.
References llvm::AttributeList::addParamAttributes(), and getContext().
void Function::addRangeRetAttr | ( | const ConstantRange & | CR | ) |
adds the range attribute to the list of attributes for the return value.
Definition at line 806 of file Function.cpp.
References llvm::AttributeList::addRangeRetAttr(), and getContext().
void Function::addRetAttr | ( | Attribute | Attr | ) |
Add return value attributes to this function.
Definition at line 673 of file Function.cpp.
References llvm::AttributeList::addRetAttribute(), and getContext().
void Function::addRetAttr | ( | Attribute::AttrKind | Kind | ) |
Add return value attributes to this function.
Definition at line 669 of file Function.cpp.
References llvm::AttributeList::addRetAttribute(), and getContext().
void Function::addRetAttrs | ( | const AttrBuilder & | Attrs | ) |
Add return value attributes to this function.
Definition at line 677 of file Function.cpp.
References llvm::AttributeList::addRetAttributes(), and getContext().
|
inline |
Definition at line 866 of file Function.h.
References Arguments.
Referenced by llvm::CloneFunction(), llvm::orc::cloneFunctionDecl(), llvm::FunctionComparator::compareSignature(), doPromotion(), hasSameArgumentList(), hostParallelCallback(), llvm::InlineFunction(), llvm::Attributor::internalizeFunctions(), LLVMGetNextParam(), LLVMGetParam(), llvm::FastISel::lowerArguments(), llvm::SwiftErrorValueTracking::setFunction(), and targetParallelCallback().
|
inline |
Definition at line 870 of file Function.h.
References Arguments.
|
inline |
Definition at line 900 of file Function.h.
|
inline |
Definition at line 875 of file Function.h.
References Arguments.
Referenced by llvm::FunctionComparator::compareSignature(), llvm::InlineFunction(), llvm::FastISel::lowerArguments(), and llvm::SwiftErrorValueTracking::setFunction().
|
inline |
Definition at line 879 of file Function.h.
References Arguments.
|
inline |
Definition at line 899 of file Function.h.
Referenced by llvm::OpenMPIRBuilder::addAttributes(), llvm::X86FrameLowering::adjustForHiPEPrologue(), CC_X86_Intr(), llvm::Attributor::checkForAllCallSites(), llvm::CloneFunctionInto(), llvm::FunctionComparator::compareSignature(), createSwitchStatement(), llvm::OpenMPIRBuilder::createTeams(), llvm::X86FrameLowering::emitPrologue(), findArgumentCopyElisionCandidates(), llvm::IRPosition::getAssociatedArgument(), llvm::IRPosition::getNumArgs(), hasSameArgumentList(), hostParallelCallback(), llvm::Attributor::isValidFunctionSignatureRewrite(), LLVMGetNextParam(), llvm::Attributor::registerFunctionSignatureRewrite(), replaceCalledFunction(), stealArgumentListFrom(), targetParallelCallback(), and llvm::UpgradeIntrinsicCall().
|
inline |
Definition at line 890 of file Function.h.
References llvm::make_range().
Referenced by AddAliasScopeMetadata(), AddAlignmentAssumptions(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), llvm::computeSignatureVTs(), dontUseFastISelFor(), llvm::HexagonEvaluator::HexagonEvaluator(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), llvm::AMDGPUCallLowering::isEligibleForTailCallOptimization(), llvm::SITargetLowering::isEligibleForTailCallOptimization(), LLVMGetParams(), llvm::SPIRVCallLowering::lowerCall(), and moveFunctionAdaptingType().
|
inline |
Definition at line 893 of file Function.h.
References llvm::make_range().
|
inline |
Definition at line 861 of file Function.h.
|
inline |
Definition at line 860 of file Function.h.
Referenced by llvm::MachO::DylibReader::readFile(), and llvm::OutlinableRegion::splitCandidate().
|
inline |
Definition at line 851 of file Function.h.
Referenced by doPromotion(), llvm::FunctionPropertiesUpdater::finish(), llvm::FunctionPropertiesUpdater::FunctionPropertiesUpdater(), initializeUniqueCases(), llvm::MemorySSA::MemorySSA(), llvm::GraphTraits< DOTFuncInfo * >::nodes_begin(), llvm::GraphTraits< DOTFuncMSSAInfo * >::nodes_begin(), raiseUserConstantDataAllocasToEntryBlock(), splice(), and llvm::MemorySSA::verifyMemorySSA().
|
inline |
Definition at line 852 of file Function.h.
bool Function::callsFunctionThatReturnsTwice | ( | ) | const |
callsFunctionThatReturnsTwice - Return true if the function has a call to setjmp or other function that gcc recognizes as "returning twice".
Definition at line 1984 of file Function.cpp.
References I, and instructions.
|
inline |
Determine if the call cannot be duplicated.
Definition at line 601 of file Function.h.
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 959 of file Function.h.
void Function::clearGC | ( | ) |
Definition at line 848 of file Function.cpp.
References llvm::LLVMContext::deleteGC(), getContext(), and hasGC().
Referenced by copyAttributesFrom(), and ~Function().
void Function::convertFromNewDbgValues | ( | ) |
Definition at line 117 of file Function.cpp.
References IsNewDbgInfoFormat.
Referenced by setIsNewDbgInfoFormat().
void Function::convertToNewDbgValues | ( | ) |
Definition at line 110 of file Function.cpp.
References IsNewDbgInfoFormat.
Referenced by setIsNewDbgInfoFormat().
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the Function Src to this one.
Copy all additional attributes (those not needed to create a Function) from the Function Src to this one.
Definition at line 863 of file Function.cpp.
References clearGC(), llvm::GlobalObject::copyAttributesFrom(), setAttributes(), setCallingConv(), setGC(), setPersonalityFn(), setPrefixData(), and setPrologueData().
Referenced by addVariantDeclaration(), llvm::orc::cloneFunctionDecl(), llvm::CloneFunctionInto(), llvm::CloneModule(), doPromotion(), getTLIFunction(), and moveFunctionAdaptingType().
|
static |
Creates a new function and attaches it to a module.
Places the function in the program address space as specified by the module's data layout.
Definition at line 396 of file Function.cpp.
References Create(), llvm::GlobalValue::Linkage, and N.
|
inlinestatic |
Definition at line 179 of file Function.h.
References N.
|
inlinestatic |
Definition at line 172 of file Function.h.
References N.
Referenced by addVariantDeclaration(), assureFPCallStub(), llvm::CloneFunction(), llvm::orc::cloneFunctionDecl(), llvm::CloneModule(), llvm::convertToDeclaration(), convertToLocalCopy(), Create(), createCloneDeclaration(), llvm::MIRParserImpl::createDummyFunction(), createFPFnStub(), createFrameHelperMachineFunction(), llvm::RandomIRBuilder::createFunctionDeclaration(), createOutlinedFunction(), llvm::Attributor::createShallowWrapper(), llvm::ThunkInserter< Derived, InsertedThunksTy >::createThunkFunction(), createWrapper(), doPromotion(), llvm::orc::IRSpeculationLayer::emit(), emitTargetTaskProxyFunction(), llvm::SanitizerStatReport::finish(), generateReproducer(), getEmscriptenFunction(), getFreshReductionFunc(), getOrCreateFunction(), llvm::Module::getOrInsertFunction(), getTLIFunction(), llvm::Attributor::internalizeFunctions(), LLVMAddFunction(), llvm::lowerGlobalIFuncUsersAsGlobalCtor(), moveFunctionAdaptingType(), llvm::ExtractGVPass::run(), and runImpl().
|
static |
Creates a function with some attributes recorded in llvm.module.flags and the LLVMContext applied.
Use this when synthesizing new functions that need attributes that would have been set by command line options.
This function should not be called from backends or the LTO pipeline. If it is called from one of those places, some default attributes will not be applied to the function.
Definition at line 401 of file Function.cpp.
References llvm::All, B, llvm::StringRef::empty(), F, llvm::GlobalValue::Linkage, N, llvm::None, llvm::NonLeaf, and llvm::Reserved.
Referenced by llvm::createSanitizerCtor().
llvm::Function::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
|
inline |
deleteBody - This method deletes the body of the function, and converts the linkage to external.
Definition at line 729 of file Function.h.
Referenced by llvm::CallGraphUpdater::removeFunction().
|
inline |
Determine if the function should not perform indirect branch tracking.
Definition at line 590 of file Function.h.
bool Function::doesNotAccessMemory | ( | ) | const |
Determine if the function does not access memory.
Definition at line 887 of file Function.cpp.
References llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), and getMemoryEffects().
|
inline |
Determine if the call might deallocate memory.
Definition at line 628 of file Function.h.
|
inline |
Determine if the function is known not to recurse, directly or indirectly.
Definition at line 645 of file Function.h.
|
inline |
Determine if the function cannot return.
Definition at line 582 of file Function.h.
|
inline |
Determine if the function cannot unwind.
Definition at line 593 of file Function.h.
Referenced by llvm::VPRecipeBase::mayHaveSideEffects(), llvm::EscapeEnumerator::Next(), and llvm::InstCombinerImpl::visitCallInst().
|
inline |
dropAllReferences() - This method causes all the subinstructions to "let go" of all references that they are maintaining.
This allows one to 'delete' a whole module at a time, even though there may be circular references... first all references are dropped, and all use counts go to zero. Then everything is deleted for real. Note that no operations are valid on an object that has "dropped all references", except operator delete.
Since no other object in the module can have references into the body of a function, dropping all references deletes the entire body of the function, including any contained basic blocks.
Definition at line 975 of file Function.h.
Referenced by ~Function().
|
inline |
Definition at line 857 of file Function.h.
Referenced by buildUMulWithOverflowFunc(), createTblForTrunc(), llvm::PMDataManager::emitInstrCountChangedRemark(), llvm::OpenMPIRBuilder::getOrCreateSrcLocStr(), lowerFunnelShifts(), llvm::HexagonTargetLowering::LowerOperationWrapper(), moveFunctionAdaptingType(), llvm::MachO::DylibReader::readFile(), and llvm::HexagonTargetLowering::ReplaceNodeResults().
|
inline |
Definition at line 853 of file Function.h.
Referenced by llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), llvm::OpenMPIRBuilder::emitBlock(), fixupLineNumbers(), llvm::BasicBlock::insertInto(), llvm::MemorySSA::MemorySSA(), llvm::GraphTraits< DOTFuncInfo * >::nodes_end(), llvm::GraphTraits< DOTFuncMSSAInfo * >::nodes_end(), placeSplitBlockCarefully(), raiseUserConstantDataAllocasToEntryBlock(), splice(), and llvm::MemorySSA::verifyMemorySSA().
|
inline |
Definition at line 854 of file Function.h.
Function::iterator Function::erase | ( | Function::iterator | FromIt, |
Function::iterator | ToIt | ||
) |
Erases a range of BasicBlocks from FromIt
to (not including) ToIt
.
\Returns ToIt
.
Definition at line 485 of file Function.cpp.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase().
void Function::eraseFromParent | ( | ) |
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
Definition at line 469 of file Function.cpp.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase(), llvm::Module::getFunctionList(), llvm::ilist_node_impl< OptionsT >::getIterator(), and llvm::GlobalValue::getParent().
Referenced by llvm::ArgumentPromotionPass::run(), stripDebugDeclareImpl(), llvm::stripDebugifyMetadata(), llvm::UpgradeARCRuntime(), and llvm::PredicateInfo::~PredicateInfo().
|
inline |
Definition at line 859 of file Function.h.
|
inline |
Definition at line 858 of file Function.h.
Referenced by llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), llvm::InlineFunction(), insertCallAtFunctionEntryPoint(), and moveFunctionAdaptingType().
Definition at line 884 of file Function.h.
References Arguments, and assert().
Referenced by buildUMulWithOverflowFunc(), llvm::Attributor::checkForAllCallSites(), llvm::OpenMPIRBuilder::createReductions(), createSwitchStatement(), llvm::OpenMPIRBuilder::createTargetInit(), llvm::OpenMPIRBuilder::createTeams(), findOrCreatePHIInBlock(), llvm::IRPosition::getArg(), llvm::IRPosition::getAssociatedArgument(), lowerFunnelShifts(), replaceArgumentUses(), replaceCalledFunction(), replaceConstants(), unpackFromRegLoc(), and llvm::UpgradeIntrinsicCall().
Attribute Function::getAttributeAtIndex | ( | unsigned | i, |
Attribute::AttrKind | Kind | ||
) | const |
gets the attribute from the list of attributes.
Definition at line 760 of file Function.cpp.
References llvm::AttributeList::getAttributeAtIndex().
gets the attribute from the list of attributes.
Definition at line 765 of file Function.cpp.
References llvm::AttributeList::getAttributeAtIndex().
|
inline |
Return the attribute list for this Function.
Definition at line 357 of file Function.h.
Referenced by llvm::OpenMPIRBuilder::addAttributes(), llvm::Argument::addAttrs(), llvm::TargetLowering::BuildSDIVPow2(), llvm::TargetLowering::BuildSREMPow2(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), llvm::FunctionComparator::compareSignature(), llvm::OpenMPIRBuilder::createReductionsGPU(), doPromotion(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), fillOverallFunction(), llvm::IRPosition::getAttrList(), llvm::SystemZELFRegisters::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::SystemZELFRegisters::getCallPreservedMask(), llvm::AArch64RegisterInfo::getCallPreservedMask(), llvm::ARMBaseRegisterInfo::getCallPreservedMask(), getCopyFromParts(), llvm::AArch64RegisterInfo::getDarwinCalleeSavedRegs(), llvm::AArch64RegisterInfo::getDarwinCallPreservedMask(), getFixedObjectSize(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), getMemoryEffects(), getMemsetStores(), llvm::Argument::getPassPointeeByValueCopySize(), llvm::Argument::getPointeeInMemoryValueType(), llvm::Argument::hasPassPointeeByValueCopyAttr(), llvm::Argument::hasPointeeInMemoryValueAttr(), insertSinCosCall(), llvm::PPCInstrInfo::isSignOrZeroExtended(), llvm::Attributor::isValidFunctionSignatureRewrite(), moveFunctionAdaptingType(), llvm::Argument::onlyReadsMemory(), optimizeDoubleFP(), llvm::BasicTTIImplBase< T >::preferToKeepConstantsAttached(), produceCompactUnwindFrame(), llvm::Argument::removeAttrs(), llvm::RISCVTargetLowering::ReplaceNodeResults(), llvm::TLSVariableHoistPass::runImpl(), llvm::FunctionLoweringInfo::set(), llvm::TargetLowering::SimplifySetCC(), and llvm::PPCTargetLowering::supportsTailCallFor().
|
inline |
Return the "epoch" of current block numbers.
This will return a different value after every renumbering. The intention is: if something (e.g., an analysis) uses block numbers, it also stores the number epoch and then can assert later on that the epoch didn't change (indicating that the numbering is still valid). If the epoch changed, blocks might have been assigned new numbers and previous uses of the numbers needs to be invalidated. This is solely intended as a debugging feature.
Definition at line 840 of file Function.h.
|
inline |
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this function.
The enum values for the known calling conventions are defined in CallingConv.h.
Definition at line 281 of file Function.h.
Referenced by llvm::SIMachineFunctionInfo::allocateVGPRSpillToAGPR(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::AMDGPUCallLowering::areCalleeOutgoingArgsTailCallable(), llvm::FunctionComparator::compareSignature(), computeCalleeSaveRegisterPairs(), llvm::computeSignatureVTs(), llvm::coro::createMustTailCall(), llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::AMDGPUCallLowering::doCallerAndCalleePassArgsTheSameWay(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::LoongArchFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::SystemZELFFrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::LoongArchFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::X86FrameLowering::enableShrinkWrapping(), findScratchNonCalleeSaveRegister(), llvm::SystemZELFRegisters::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::SIRegisterInfo::getCalleeSavedRegs(), llvm::LoongArchRegisterInfo::getCalleeSavedRegs(), llvm::PPCRegisterInfo::getCalleeSavedRegs(), llvm::RISCVRegisterInfo::getCalleeSavedRegs(), llvm::VERegisterInfo::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCalleeSavedRegsViaCopy(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegsViaCopy(), llvm::X86RegisterInfo::getCalleeSavedRegsViaCopy(), llvm::AArch64RegisterInfo::getDarwinCalleeSavedRegs(), llvm::SIInstrInfo::getDSShaderTypeValue(), llvm::X86FrameLowering::getFrameIndexReference(), llvm::SIMachineFunctionInfo::getGITPtrLoReg(), llvm::Mangler::getNameWithPrefix(), llvm::M68kRegisterInfo::getReservedRegs(), llvm::RISCVRegisterInfo::getReservedRegs(), llvm::X86RegisterInfo::getReservedRegs(), GetScratchRegister(), llvm::AArch64RegisterInfo::getStrictlyReservedRegs(), llvm::X86FrameLowering::has128ByteRedZone(), llvm::InlineFunction(), llvm::AArch64RegisterInfo::isArgumentRegister(), llvm::X86RegisterInfo::isArgumentRegister(), isCallableFunction(), llvm::TargetRegisterInfo::isCalleeSavedPhysReg(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), llvm::AMDGPUCallLowering::isEligibleForTailCallOptimization(), llvm::HexagonTargetLowering::IsEligibleForTailCallOptimization(), llvm::SITargetLowering::isEligibleForTailCallOptimization(), llvm::SIInstrInfo::legalizeOperands(), LowerVACOPY(), llvm::SITargetLowering::mayBeEmittedAsTailCall(), produceCompactUnwindFrame(), reservePrivateMemoryRegs(), llvm::AArch64FrameLowering::resolveFrameOffsetReference(), llvm::FunctionLoweringInfo::set(), llvm::X86RegisterInfo::shouldRealignStack(), llvm::AArch64TargetLowering::supportSplitCSR(), llvm::PPCTargetLowering::supportsTailCallFor(), llvm::SystemZELFFrameLowering::usePackedStack(), llvm::SIMachineFunctionInfo::usesAGPRs(), llvm::R600InstrInfo::usesTextureCache(), and llvm::R600InstrInfo::usesVertexCache().
LLVMContext & Function::getContext | ( | ) | const |
getContext - Return a reference to the LLVMContext associated with this function.
Definition at line 380 of file Function.cpp.
References llvm::Type::getContext(), and llvm::GlobalValue::getType().
Referenced by AddAliasScopeMetadata(), addAttributeAtIndex(), llvm::OpenMPIRBuilder::addAttributes(), llvm::Argument::addAttrs(), addBoundsChecking(), addDereferenceableOrNullParamAttr(), addDereferenceableParamAttr(), addFnAttr(), addFnAttrs(), AddParamAndFnBasicAttributes(), addParamAttr(), addParamAttrs(), addRangeRetAttr(), addRetAttr(), addRetAttrs(), AddReturnAttributes(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::MachineOptimizationRemarkEmitter::allowExtraAnalysis(), llvm::AMDGPUCallLowering::areCalleeOutgoingArgsTailCallable(), llvm::MachineIRBuilder::buildFConstant(), llvm::buildNDRange(), llvm::AArch64CallLowering::canLowerReturn(), llvm::X86CallLowering::canLowerReturn(), clearGC(), llvm::CloneFunctionInto(), collectCallSiteParameters(), llvm::SITargetLowering::computeKnownAlignForTargetInstr(), convertImplicitDefToConstZero(), createAndInsertBasicBlocks(), createAtomicLibcall(), createFPFnStub(), llvm::createMemLibcall(), llvm::TargetInstrInfo::describeLoadedValue(), duplicateCPV(), llvm::OptimizationRemarkEmitter::emit(), llvm::MachineOptimizationRemarkEmitter::emit(), llvm::MachineInstr::emitError(), emitErrorMsg(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), llvm::RISCVFrameLowering::emitPrologue(), emitThumb1LoadConstPool(), emitThumb2LoadConstPool(), llvm::OptimizationRemarkEmitter::enabled(), llvm::GIMatchTableExecutor::executeMatchTable(), llvm::FastISel::fastEmit_ri_(), fixupDebugInfoPostExtraction(), fixupLineNumbers(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::MachineIRBuilder::getContext(), getFnAttributeAsParsedInteger(), getFuncAddrForProfData(), getGC(), llvm::CSKYInstrInfo::getGlobalBaseReg(), llvm::OpenMPIRBuilder::getOrCreateRuntimeFunction(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVBoolType(), llvm::getOrCreateSPIRVDeviceEventPointer(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVFloatType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVIntegerType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(), getPointeeTypeByCallInst(), getRegistersForValue(), llvm::FunctionLoweringInfo::getValueFromVirtualReg(), llvm::SelectionDAG::init(), INITIALIZE_PASS(), insertCallBeforeInstruction(), insertInlineAsmProcess(), interpretValues(), llvm::MachineOptimizationRemark::isEnabled(), llvm::MachineOptimizationRemarkMissed::isEnabled(), llvm::MachineOptimizationRemarkAnalysis::isEnabled(), llvm::OptimizationRemark::isEnabled(), llvm::OptimizationRemarkMissed::isEnabled(), llvm::OptimizationRemarkAnalysis::isEnabled(), llvm::PPCTargetLowering::isFMAFasterThanFMulAndFAdd(), llvm::AMDGPULegalizerInfo::legalizeAddrSpaceCast(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::AMDGPULegalizerInfo::legalizeGlobalValue(), llvm::RISCVLegalizerInfo::legalizeIntrinsic(), llvm::AMDGPULegalizerInfo::legalizeSBufferLoad(), llvm::LegalizerHelper::libcall(), llvm::XtensaInstrInfo::loadImmediate(), llvm::XCoreInstrInfo::loadImmediate(), llvm::AArch64CallLowering::lowerCall(), llvm::RISCVTargetLowering::LowerCall(), LowerFPToInt(), llvm::LegalizerHelper::lowerLoad(), llvm::lowerObjectSizeCall(), llvm::RISCVTargetLowering::LowerReturn(), llvm::LegalizerHelper::lowerStore(), llvm::LegalizerHelper::lowerVAArg(), llvm::CombinerHelper::matchCombineExtractedVectorLoad(), llvm::CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(), llvm::CombinerHelper::matchLoadOrCombine(), moveFunctionAdaptingType(), llvm::MIPrinter::print(), llvm::MachineInstr::print(), processSwitches(), removeAttributeAtIndex(), llvm::Argument::removeAttrs(), removeFnAttr(), removeFnAttrs(), removeParamAttr(), removeParamAttrs(), removeRetAttr(), removeRetAttrs(), reportIllegalCopy(), llvm::MachineOptimizationRemarkEmitterAnalysis::run(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::ConstantHoistingPass::runImpl(), llvm::OptimizationRemarkEmitterWrapperPass::runOnFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::MachineOptimizationRemarkEmitterPass::runOnMachineFunction(), llvm::FastISel::selectExtractValue(), llvm::RAGreedy::selectOrSplit(), llvm::FunctionLoweringInfo::set(), setEntryCount(), setGC(), setMemoryEffects(), setSectionPrefix(), tryToOptimizeStoreOfAllocationToGlobal(), updateNVPTXMetadata(), validateGroupWaitEventsPtr(), validateLifetimeStart(), and llvm::LegalizerHelper::widenScalar().
const DataLayout & Function::getDataLayout | ( | ) | const |
Get the data layout of the module this function belongs to.
Requires the function to have a parent module.
Definition at line 384 of file Function.cpp.
References llvm::Module::getDataLayout(), and llvm::GlobalValue::getParent().
Referenced by llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), buildOverlapMapAndRecordDeclares(), llvm::CloneAndPruneIntoFromInst(), llvm::FunctionComparator::cmpTypes(), llvm::createMemCpyLoopKnownSize(), llvm::OpenMPIRBuilder::createTargetInit(), llvm::DependenceInfo::depends(), llvm::MachineIRBuilder::getDataLayout(), llvm::MachineFunction::getDataLayout(), llvm::LoopVectorizationCostModel::getSmallestAndWidestTypes(), llvm::DependenceInfo::getSplitIteration(), llvm::FunctionLoweringInfo::getValueFromVirtualReg(), llvm::LoopConstrainer::run(), llvm::ConstantHoistingPass::runImpl(), llvm::FunctionLoweringInfo::set(), and llvm::PPCTargetLowering::supportsTailCallFor().
DenormalMode Function::getDenormalMode | ( | const fltSemantics & | FPType | ) | const |
Returns the denormal handling type for the default rounding mode of the function.
Definition at line 810 of file Function.cpp.
References getDenormalModeF32Raw(), getDenormalModeRaw(), and llvm::APFloatBase::IEEEsingle().
Referenced by atomicIgnoresDenormalModeOrFPModeIsFTZ(), computeKnownFPClass(), and llvm::MachineFunction::getDenormalMode().
DenormalMode Function::getDenormalModeF32Raw | ( | ) | const |
Return the representational value of "denormal-fp-math-f32".
Code interested in the semantics of the function should use getDenormalMode instead.
Definition at line 828 of file Function.cpp.
References getFnAttribute(), llvm::DenormalMode::getInvalid(), llvm::Attribute::getValueAsString(), llvm::Attribute::isValid(), and llvm::parseDenormalFPAttribute().
Referenced by getDenormalMode().
DenormalMode Function::getDenormalModeRaw | ( | ) | const |
Return the representational value of "denormal-fp-math".
Code interested in the semantics of the function should use getDenormalMode instead.
Definition at line 822 of file Function.cpp.
References getFnAttribute(), llvm::Attribute::getValueAsString(), and llvm::parseDenormalFPAttribute().
Referenced by getDenormalMode().
|
inline |
Definition at line 808 of file Function.h.
|
inline |
Definition at line 807 of file Function.h.
Referenced by llvm::calculateSEHStateNumbers(), calculateStateNumbersForInvokes(), llvm::calculateWinCXXEHStateNumbers(), llvm::CloneAndPruneIntoFromInst(), llvm::FunctionComparator::compare(), llvm::createSanitizerCtorAndInitFunctions(), llvm::OpenMPIRBuilder::createTask(), llvm::OpenMPIRBuilder::createTeams(), emitTaskDependencies(), llvm::OpenMPIRBuilder::finalize(), findArgParts(), findArgumentCopyElisionCandidates(), llvm::InstCombinerImpl::freezeOtherUses(), llvm::MemoryDependenceResults::getDependency(), llvm::GraphTraits< DOTFuncInfo * >::getEntryNode(), llvm::GraphTraits< DOTFuncMSSAInfo * >::getEntryNode(), llvm::MemoryDependenceResults::getNonLocalCallDependency(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), llvm::InlineFunction(), llvm::invertCondition(), isColdCallSite(), IsEmptyAtExitFunction(), isPotentiallyReachable(), llvm::PPCInstrInfo::isSignOrZeroExtended(), memoryIsNotModifiedBetween(), llvm::InsertPHIStrategy::mutate(), NegateValue(), llvm::PrepareToSplitEntryBlock(), llvm::JumpThreadingPass::processBlock(), programUndefinedIfUndefOrPoison(), raiseUserConstantDataAllocasToEntryBlock(), replaceArgumentUses(), and llvm::TryToSimplifyUncondBranchFromEmptyBlock().
std::optional< ProfileCount > Function::getEntryCount | ( | bool | AllowSynthetic = false | ) | const |
Get the entry count for this function.
Entry count is the number of times the function was executed. When AllowSynthetic is false, only pgo_data will be returned.
Definition at line 2078 of file Function.cpp.
References llvm::GlobalObject::getMetadata(), llvm::MDNode::getOperand(), llvm::ConstantInt::getValue(), llvm::APInt::getZExtValue(), PCT_Real, and PCT_Synthetic.
Referenced by llvm::AsmPrinter::emitBBAddrMapSection(), llvm::InlineFunction(), and setEntryCount().
Attribute Function::getFnAttribute | ( | Attribute::AttrKind | Kind | ) | const |
Return the attribute for the given attribute kind.
Definition at line 769 of file Function.cpp.
References llvm::AttributeList::getFnAttr().
Referenced by llvm::TargetLoweringBase::areJTsAllowed(), atomicIgnoresDenormalModeOrFPModeIsFTZ(), llvm::OpenMPIRBuilder::finalize(), getDenormalModeF32Raw(), getDenormalModeRaw(), getFnAttributeAsParsedInteger(), getGridValue(), llvm::X86TargetLowering::getStackProbeSymbolName(), getVScaleForTuning(), llvm::PPCTargetLowering::hasInlineStackProbe(), llvm::SystemZTargetLowering::hasInlineStackProbe(), llvm::X86TargetLowering::hasInlineStackProbe(), StrBoolAttr::isSet(), llvm::FastISel::lowerCall(), llvm::CallLowering::lowerCall(), llvm::RISCVTargetLowering::LowerFormalArguments(), llvm::RISCVTargetLowering::LowerReturn(), llvm::TargetInstrInfo::mergeOutliningCandidateAttributes(), llvm::ARMBaseInstrInfo::mergeOutliningCandidateAttributes(), llvm::OpenMPIRBuilder::readThreadBoundsForKernel(), switchToLookupTable(), llvm::AttributeFuncs::updateMinLegalVectorWidthAttr(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitTrunc(), and llvm::InstCombinerImpl::visitZExt().
Return the attribute for the given attribute kind.
Definition at line 773 of file Function.cpp.
References llvm::AttributeList::getFnAttr().
For a string attribute Kind
, parse attribute as an integer.
Default
if attribute is not present.Default
if there is an error parsing the attribute integer, and error is emitted to the LLVMContext Definition at line 781 of file Function.cpp.
References A, llvm::Default, llvm::LLVMContext::emitError(), getContext(), getFnAttribute(), and Name.
Referenced by llvm::GCNSubtarget::getNSAThreshold(), llvm::PPCTargetLowering::getStackProbeSize(), llvm::SystemZTargetLowering::getStackProbeSize(), llvm::X86TargetLowering::getStackProbeSize(), llvm::OpenMPIRBuilder::readTeamBoundsForKernel(), llvm::OpenMPIRBuilder::readThreadBoundsForKernel(), and llvm::StackProtector::runOnFunction().
|
inline |
Return the stack alignment for the function.
Definition at line 468 of file Function.h.
References llvm::AttributeList::getFnStackAlignment().
Definition at line 170 of file Function.h.
Referenced by llvm::OpenMPIRBuilder::finalize(), and llvm::AMDGPU::removeFnAttrFromReachable().
|
inline |
Returns the FunctionType for me.
Definition at line 214 of file Function.h.
Referenced by llvm::FunctionComparator::compareSignature(), llvm::MatrixBuilder::CreateColumnMajorLoad(), llvm::MatrixBuilder::CreateColumnMajorStore(), llvm::DbgVariableRecord::createDebugIntrinsic(), llvm::IRBuilderBase::CreateLaunderInvariantGroup(), llvm::MatrixBuilder::CreateMatrixMultiply(), llvm::MatrixBuilder::CreateMatrixTranspose(), llvm::coro::createMustTailCall(), llvm::IRBuilderBase::CreateStripInvariantGroup(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), emitTPIDR2Save(), llvm::InstCombinerImpl::EvaluateInDifferentType(), llvm::VPWidenCallRecipe::execute(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::Mangler::getNameWithPrefix(), llvm::OpenMPIRBuilder::getOrCreateRuntimeFunction(), llvm::coro::Shape::getRetconResultTypes(), llvm::LoopVectorizationCostModel::getVectorIntrinsicCost(), hasAddressTaken(), llvm::InlineFunction(), llvm::IntrinsicCostAttributes::IntrinsicCostAttributes(), llvm::SITargetLowering::LowerFormalArguments(), llvm::HexagonTargetLowering::LowerFormalArguments(), llvm::lowerGlobalIFuncUsersAsGlobalCtor(), llvm::DiagnosticInfoUnsupported::print(), llvm::Intrinsic::remangleIntrinsicFunction(), replaceCalledFunction(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::CallBase::setCalledFunction(), llvm::LoopVectorizationCostModel::setVectorizedCallDecision(), llvm::UpgradeARCRuntime(), and llvm::UpgradeIntrinsicCall().
const std::string & Function::getGC | ( | ) | const |
Definition at line 838 of file Function.cpp.
References assert(), getContext(), llvm::LLVMContext::getGC(), and hasGC().
Referenced by llvm::FunctionComparator::compareSignature(), and llvm::InlineFunction().
DenseSet< GlobalValue::GUID > Function::getImportGUIDs | ( | ) | const |
Returns the set of GUIDs that needs to be imported to the function for sample PGO, to enable the same inlines as the profiled optimized binary.
Definition at line 2100 of file Function.cpp.
References llvm::GlobalObject::getMetadata().
Referenced by setEntryCount().
unsigned Function::getInstructionCount | ( | ) | const |
Returns the number of non-debug IR instructions in this function.
This is equivalent to the sum of the sizes of each basic block contained within this function.
Definition at line 388 of file Function.cpp.
|
inline |
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intrinsic if the function is not an intrinsic, or if the pointer is null.
This value is always defined to be zero to allow easy checking for whether a function is intrinsic or not. The particular intrinsic functions which correspond to this value are defined in llvm/Intrinsics.h.
Definition at line 249 of file Function.h.
Referenced by addIntrinsicToSummary(), llvm::calculateCXXStateForAsynchEH(), llvm::calculateSEHStateForAsynchEH(), llvm::VPWidenCallRecipe::execute(), llvm::findDevirtualizableCallsForTypeCheckedLoad(), llvm::findDevirtualizableCallsForTypeTest(), FindPreallocatedCall(), llvm::IntrinsicInst::getIntrinsicID(), handleBrSelExpect(), handlePhiDef(), handleSwitchExpect(), hasOnlyColdCalls(), isConstrainedFPIntrinsic(), lowerAwaitSuspend(), lowerExpectIntrinsic(), optimizeDoubleFP(), shouldCheckArgs(), and llvm::UpgradeIntrinsicCall().
|
inline |
Return a value larger than the largest block number.
Intended to allocate a vector that is sufficiently large to hold all blocks indexed by their number.
Definition at line 826 of file Function.h.
Referenced by llvm::FunctionLoweringInfo::set().
MemoryEffects Function::getMemoryEffects | ( | ) | const |
Definition at line 879 of file Function.cpp.
References getAttributes(), and llvm::AttributeList::getMemoryEffects().
Referenced by doesNotAccessMemory(), onlyAccessesArgMemory(), onlyAccessesInaccessibleMemOrArgMem(), onlyAccessesInaccessibleMemory(), onlyReadsMemory(), onlyWritesMemory(), setOnlyAccessesArgMemory(), setOnlyAccessesInaccessibleMemOrArgMem(), setOnlyAccessesInaccessibleMemory(), setOnlyReadsMemory(), and setOnlyWritesMemory().
|
inline |
Definition at line 486 of file Function.h.
References llvm::AttributeList::getParamAlignment().
Referenced by getFrameLayout(), llvm::Argument::getParamAlign(), and llvm::InlineFunction().
Attribute Function::getParamAttribute | ( | unsigned | ArgNo, |
Attribute::AttrKind | Kind | ||
) | const |
gets the specified attribute from the list of attributes.
Definition at line 795 of file Function.cpp.
References llvm::AttributeList::getParamAttr().
Referenced by llvm::Argument::getAttribute().
Extract the byref type for a parameter.
Definition at line 510 of file Function.h.
References llvm::AttributeList::getParamByRefType().
Referenced by llvm::Argument::getParamByRefType().
Extract the byval type for a parameter.
Definition at line 495 of file Function.h.
References llvm::AttributeList::getParamByValType().
Referenced by llvm::Argument::getParamByValType().
Extract the number of dereferenceable bytes for a parameter.
ArgNo | Index of an argument, with 0 being the first function arg. |
Definition at line 521 of file Function.h.
References llvm::AttributeList::getParamDereferenceableBytes().
Referenced by llvm::Argument::getDereferenceableBytes(), and getFrameLayout().
Extract the number of dereferenceable_or_null bytes for a parameter.
ArgNo | AttributeList ArgNo, referring to an argument. |
Definition at line 528 of file Function.h.
References llvm::AttributeList::getParamDereferenceableOrNullBytes().
Referenced by llvm::Argument::getDereferenceableOrNullBytes().
Extract the inalloca type for a parameter.
Definition at line 505 of file Function.h.
References llvm::AttributeList::getParamInAllocaType().
Referenced by llvm::Argument::getParamInAllocaType().
|
inline |
Extract the nofpclass attribute for a parameter.
Definition at line 533 of file Function.h.
References llvm::AttributeList::getParamNoFPClass().
Referenced by llvm::Argument::getNoFPClass().
Extract the preallocated type for a parameter.
Definition at line 515 of file Function.h.
References llvm::AttributeList::getParamPreallocatedType().
|
inline |
Definition at line 490 of file Function.h.
References llvm::AttributeList::getParamStackAlignment().
Referenced by llvm::Argument::getParamStackAlign().
Extract the sret type for a parameter.
Definition at line 500 of file Function.h.
References llvm::AttributeList::getParamStructRetType().
Referenced by llvm::Argument::getParamStructRetType().
Constant * Function::getPersonalityFn | ( | ) | const |
Get the personality function associated with this function.
Definition at line 1993 of file Function.cpp.
References assert(), llvm::User::getNumOperands(), and hasPersonalityFn().
Referenced by llvm::CodeViewDebug::beginFunctionImpl(), llvm::CloneFunctionInto(), llvm::LoopSafetyInfo::computeBlockColors(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::AArch64TargetLowering::EmitLoweredCatchRet(), llvm::X86FrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::CodeExtractor::extractCodeRegion(), findUnwindDestinations(), llvm::getEHScopeMembership(), getSEHRegistrationNodeSize(), llvm::InlineFunction(), llvm::MachineBasicBlock::liveout_begin(), needFuncLabels(), llvm::X86FrameLowering::processFunctionBeforeFrameFinalized(), llvm::X86FrameLowering::restoreWinEHStackPointersInParent(), llvm::StackProtector::runOnFunction(), and llvm::FunctionLoweringInfo::set().
Constant * Function::getPrefixData | ( | ) | const |
Get the prefix data associated with this function.
Definition at line 2003 of file Function.cpp.
References assert(), llvm::User::getNumOperands(), and hasPrefixData().
Referenced by llvm::CloneFunctionInto().
Constant * Function::getPrologueData | ( | ) | const |
Get the prologue data associated with this function.
Definition at line 2013 of file Function.cpp.
References assert(), llvm::User::getNumOperands(), and hasPrologueData().
Referenced by llvm::CloneFunctionInto().
Attribute Function::getRetAttribute | ( | Attribute::AttrKind | Kind | ) | const |
Return the attribute for the given attribute kind for the return value.
Definition at line 777 of file Function.cpp.
References llvm::AttributeList::getRetAttr().
|
inline |
Returns the type of the ret val.
Definition at line 219 of file Function.h.
Referenced by assureFPCallStub(), buildUMulWithOverflowFunc(), llvm::CloneAndPruneIntoFromInst(), copyMustTailReturn(), llvm::IRBuilderBase::CreateBinaryIntrinsic(), llvm::IRBuilderBase::CreateLaunderInvariantGroup(), llvm::createLibcall(), llvm::IRBuilderBase::CreateStripInvariantGroup(), llvm::VPWidenCallRecipe::execute(), llvm::OpenMPIRBuilder::finalize(), llvm::IRPosition::getAssociatedType(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), llvm::InlineFunction(), llvm::PPCInstrInfo::isSignOrZeroExtended(), llvm::Attributor::isValidFunctionSignatureRewrite(), lowerFunnelShifts(), llvm::NVPTXTargetLowering::LowerReturn(), llvm::makeGuardControlFlowExplicit(), moveFunctionAdaptingType(), llvm::VPWidenCallRecipe::print(), llvm::FunctionLoweringInfo::set(), llvm::PPCTargetLowering::supportsTailCallFor(), and llvm::UpgradeIntrinsicCall().
std::optional< StringRef > Function::getSectionPrefix | ( | ) | const |
Get the section prefix for this function.
Definition at line 2118 of file Function.cpp.
References assert(), and llvm::GlobalObject::getMetadata().
Referenced by llvm::TargetInstrInfo::isFunctionSafeToSplit().
DISubprogram * Function::getSubprogram | ( | ) | const |
Get the attached subprogram.
Calls getMetadata() with LLVMContext::MD_dbg and casts the result to DISubprogram.
Definition at line 1837 of file Metadata.cpp.
References llvm::GlobalObject::getMetadata().
Referenced by llvm::DwarfDebug::beginCodeAlignment(), llvm::DwarfDebug::beginFunctionImpl(), llvm::BTFDebug::beginFunctionImpl(), llvm::DwarfDebug::beginInstruction(), llvm::CloneFunctionInto(), llvm::Instruction::dropLocation(), llvm::AsmPrinter::emitFunctionBody(), llvm::DwarfDebug::emitInitialLocDirective(), llvm::AsmPrinter::emitInitialRawDwarfLocDirective(), llvm::AsmPrinter::emitStackUsage(), llvm::CodeViewDebug::endFunctionImpl(), llvm::DwarfDebug::endFunctionImpl(), llvm::CodeExtractor::extractCodeRegion(), fixupDebugInfoPostExtraction(), HandleByValArgumentInit(), hasDebugInfo(), llvm::LexicalScopes::initialize(), llvm::InlineFunction(), llvm::Legalizer::runOnMachineFunction(), llvm::InstructionSelect::selectMachineFunction(), and shouldEmitDebugInfoForProfiling().
|
inline |
Get what kind of unwind table entry to generate for this function.
Definition at line 664 of file Function.h.
References llvm::AttributeList::getUWTableKind().
|
inline |
getSymbolTable() - Return the symbol table if any, otherwise nullptr.
Definition at line 815 of file Function.h.
Referenced by parseIRValue().
|
inline |
Definition at line 816 of file Function.h.
bool Function::hasAddressTaken | ( | const User ** | PutOffender = nullptr , |
bool | IgnoreCallbackUses = false , |
||
bool | IgnoreAssumeLikeCalls = true , |
||
bool | IgnoreLLVMUsed = false , |
||
bool | IgnoreARCAttachedCall = false , |
||
bool | IgnoreCastedDirectCall = false |
||
) | const |
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invokes to it, or blockaddress expressions.
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invokes to it.
Optionally passes back an offending user for diagnostic purposes, ignores callback uses, assume like pointer annotation calls, references in llvm.used and llvm.compiler.used variables, operand bundle "clang.arc.attachedcall", and direct calls with a different call site signature (the function is implicitly casted).
Optionally ignores callback uses, assume like pointer annotation calls, and references in llvm.used and llvm.compiler.used variables.
Definition at line 1900 of file Function.cpp.
References llvm::all_of(), getFunctionType(), llvm::Value::hasOneUse(), I, llvm::AbstractCallSite::isCallbackCall(), llvm::LLVMContext::OB_clang_arc_attachedcall, llvm::Value::user_begin(), llvm::Value::user_empty(), llvm::Value::users(), and llvm::Value::uses().
bool Function::hasFnAttribute | ( | Attribute::AttrKind | Kind | ) | const |
Return true if the function has the attribute.
Definition at line 743 of file Function.cpp.
References llvm::AttributeList::hasFnAttr().
Referenced by llvm::CodeViewDebug::beginFunctionImpl(), llvm::AArch64TargetLowering::canMergeStoresTo(), llvm::X86TargetLowering::canMergeStoresTo(), canTransformToMemCmp(), checkNumAlignedDPRCS2Regs(), combineVectorSizedSetCCEquality(), llvm::CSKYFrameLowering::determineCalleeSaves(), llvm::TargetFrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineFrameLayout(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::MipsSEFrameLowering::emitEpilogue(), llvm::MipsAsmPrinter::emitFunctionBodyStart(), llvm::CSKYFrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), emitSCSEpilogue(), emitSCSPrologue(), llvm::TargetFrameLowering::enableCalleeSaveSkip(), llvm::ARMFrameLowering::enableCalleeSaveSkip(), llvm::X86FrameLowering::enableShrinkWrapping(), llvm::expandAtomicRMWToCmpXchg(), fixupLineNumbers(), foldLogOpOfMaskedICmps_NotAllZeros_BMask_Mixed(), llvm::AArch64Subtarget::getAuthenticatedLRCheckMethod(), llvm::CSKYRegisterInfo::getCalleeSavedRegs(), llvm::RISCVRegisterInfo::getCalleeSavedRegs(), llvm::X86RegisterInfo::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCallPreservedMask(), llvm::AArch64FrameLowering::getFrameIndexReference(), llvm::AArch64Subtarget::getPtrAuthBlockAddressDiscriminatorIfEnabled(), llvm::MipsRegisterInfo::getReservedRegs(), llvm::X86TargetLowering::getStackProbeSymbolName(), llvm::AArch64RegisterInfo::getStrictlyReservedRegs(), getVScaleForTuning(), llvm::X86FrameLowering::has128ByteRedZone(), llvm::HexagonFrameLowering::hasFP(), llvm::PPCTargetLowering::hasInlineStackProbe(), llvm::SystemZTargetLowering::hasInlineStackProbe(), llvm::X86TargetLowering::hasInlineStackProbe(), hasReturnsTwiceAttr(), hasStackProtectorFnAttr(), llvm::AArch64RegisterInfo::isAsmClobberable(), llvm::ScalarEvolution::isKnownToBeAPowerOfTwo(), isNoReturnDef(), llvm::omp::isOpenMPKernel(), isPotentiallyReachable(), EnumAttr::isSet(), LowerATOMIC_STORE(), llvm::lowerAtomicRMWInst(), llvm::InlineAsmLowering::lowerInlineAsm(), llvm::TargetInstrInfo::mergeOutliningCandidateAttributes(), llvm::ARMBaseInstrInfo::mergeOutliningCandidateAttributes(), llvm::PPCFrameLowering::needsFP(), llvm::AArch64FunctionInfo::needsShadowCallStackPrologueEpilogue(), nullPointerIsDefined(), performBRCONDCombine(), llvm::X86TargetLowering::ReplaceNodeResults(), llvm::PPCFrameLowering::restoreCalleeSavedRegisters(), llvm::JumpThreadingPass::runImpl(), llvm::Attributor::shouldInitialize(), llvm::MachineFunction::shouldSplitStack(), llvm::PPCFrameLowering::spillCalleeSavedRegisters(), llvm::AArch64TargetLowering::supportSplitCSR(), llvm::JumpThreadingPass::tryToUnfoldSelectInCurrBB(), llvm::SystemZELFFrameLowering::usePackedStack(), llvm::RISCVMachineFunctionInfo::useSaveRestoreLibCalls(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitTrunc(), llvm::InstCombinerImpl::visitXor(), and llvm::InstCombinerImpl::visitZExt().
Return true if the function has the attribute.
Definition at line 747 of file Function.cpp.
References llvm::AttributeList::hasFnAttr().
|
inline |
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generation.
Definition at line 349 of file Function.h.
Referenced by clearGC(), llvm::FunctionComparator::compareSignature(), getGC(), llvm::SelectionDAGISel::initializeAnalysisResults(), and llvm::InlineFunction().
|
inline |
hasLazyArguments/CheckLazyArguments - The argument list of a function is built on demand, so that the list isn't allocated until the first client needs it.
The hasLazyArguments predicate returns true if the arg list hasn't been set up yet.
Definition at line 121 of file Function.h.
Referenced by stealArgumentListFrom().
|
inline |
Optimize this function for minimum size (-Oz).
Definition at line 702 of file Function.h.
Referenced by analyzeLoopUnrollCost(), combineFMinNumFMaxNum(), combineMul(), EmitCmp(), emitConstantSizeRepmov(), expandMul(), llvm::foldBranchToCommonDest(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::ARMSubtarget::getGPRAllocationOrder(), llvm::ARMSubtarget::ignoreCSRForAllocationOrder(), isMinSize(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), llvm::AArch64TargetLowering::preferredShiftLegalizationStrategy(), llvm::RISCVTargetLowering::preferredShiftLegalizationStrategy(), llvm::X86TargetLowering::preferredShiftLegalizationStrategy(), reduceVMULWidth(), llvm::LoopVectorizationPlanner::selectEpilogueVectorizationFactor(), shouldLowerMemFuncForSize(), llvm::AArch64InstrInfo::shouldOutlineFromFunctionByDefault(), llvm::ARMBaseInstrInfo::shouldOutlineFromFunctionByDefault(), llvm::RISCVInstrInfo::shouldOutlineFromFunctionByDefault(), splitStores(), and validateAndCostRequiredSelects().
|
inline |
Determine if the call can synchroize with other threads.
Definition at line 636 of file Function.h.
|
inline |
Do not optimize this function (-O0).
Definition at line 699 of file Function.h.
Referenced by llvm::CodeViewDebug::beginFunctionImpl(), llvm::LoongArchFrameLowering::enableShrinkWrapping(), llvm::RISCVFrameLowering::enableShrinkWrapping(), isOptNone(), llvm::SelectionDAGISelPass::run(), llvm::TwoAddressInstructionPass::run(), llvm::TLSVariableHoistPass::runImpl(), and llvm::InstructionSelect::runOnMachineFunction().
|
inline |
Optimize this function for size (-Os) or minimum size (-Oz).
Definition at line 705 of file Function.h.
Referenced by AlignBlocks(), llvm::CodeViewDebug::beginFunctionImpl(), llvm::AArch64InstrInfo::canFoldIntoAddrMode(), combineFMA(), combineFMADDSUB(), combineFneg(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), llvm::HexagonTargetLowering::LowerFDIV(), ProfitableToMerge(), llvm::LoopVectorizationPlanner::selectEpilogueVectorizationFactor(), shouldLowerMemFuncForSize(), llvm::SelectionDAG::shouldOptForSize(), llvm::FastISel::shouldOptForSize(), and llvm::TailDuplicator::shouldTailDuplicate().
bool Function::hasParamAttribute | ( | unsigned | ArgNo, |
Attribute::AttrKind | Kind | ||
) | const |
check if an attributes is in the list of attributes.
Definition at line 755 of file Function.cpp.
References llvm::AttributeList::hasParamAttr().
Referenced by llvm::Argument::hasAttribute(), llvm::Argument::hasSwiftErrorAttr(), and llvm::Argument::hasSwiftSelfAttr().
|
inline |
Check whether this function has a personality function.
Definition at line 903 of file Function.h.
Referenced by llvm::CodeViewDebug::beginFunctionImpl(), llvm::CloneFunctionInto(), llvm::LoopSafetyInfo::computeBlockColors(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::CodeExtractor::extractCodeRegion(), getPersonalityFn(), getSEHRegistrationNodeSize(), llvm::InlineFunction(), llvm::MachineBasicBlock::liveout_begin(), needFuncLabels(), llvm::WebAssemblyFrameLowering::needsPrologForEH(), recoverFramePointer(), llvm::StackProtector::runOnFunction(), and llvm::FunctionLoweringInfo::set().
|
inline |
Check whether this function has prefix data.
Definition at line 912 of file Function.h.
Referenced by llvm::CloneFunctionInto(), and getPrefixData().
Return true if the function is annotated with profile data.
Presence of entry counts from a profile run implies the function has profile annotations. If IncludeSynthetic is false, only return true when the profile data is real.
Definition at line 333 of file Function.h.
Referenced by llvm::CodeViewDebug::beginFunctionImpl(), getLayoutSuccessorProbThreshold(), llvm::ProfileSummaryInfo::isColdCallSite(), and sinkLoopInvariantInstructions().
|
inline |
Check whether this function has prologue data.
Definition at line 921 of file Function.h.
Referenced by llvm::CloneFunctionInto(), and getPrologueData().
bool Function::hasRetAttribute | ( | Attribute::AttrKind | Kind | ) | const |
check if an attribute is in the list of attributes for the return value.
Definition at line 751 of file Function.cpp.
References llvm::AttributeList::hasRetAttr().
bool Function::hasStackProtectorFnAttr | ( | ) | const |
Returns true if the function has ssp, sspstrong, or sspreq fn attrs.
Definition at line 855 of file Function.cpp.
References hasFnAttribute().
Referenced by llvm::CodeViewDebug::beginFunctionImpl().
|
inline |
Determine if the function returns a structure through first or second pointer argument.
Definition at line 686 of file Function.h.
References llvm::AttributeList::hasParamAttr().
Referenced by llvm::Mangler::getNameWithPrefix(), llvm::HexagonTargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerFormalArguments_32(), and llvm::SparcTargetLowering::LowerReturn_32().
|
inline |
True if the ABI mandates (or the user requested) that this function be in a unwind table.
Definition at line 670 of file Function.h.
|
inline |
Insert BB
in the basic block list at Position
.
\Returns an iterator to the newly inserted BB.
Definition at line 752 of file Function.h.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::insert(), and llvm::BasicBlock::setIsNewDbgInfoFormat().
Referenced by llvm::OpenMPIRBuilder::emitBlock(), llvm::BasicBlock::insertInto(), and LLVMInsertExistingBasicBlockAfterInsertBlock().
bool Function::isConstrainedFPIntrinsic | ( | ) | const |
Returns true if the function is one of the "Constrained Floating-Point Intrinsics".
Returns false if not, and returns false when getIntrinsicID() returns Intrinsic::not_intrinsic.
Definition at line 569 of file Function.cpp.
References getIntrinsicID(), and llvm::Intrinsic::isConstrainedFPIntrinsic().
|
inline |
Determine if the call is convergent.
Definition at line 609 of file Function.h.
|
inline |
Definition at line 544 of file Function.h.
bool Function::isDefTriviallyDead | ( | ) | const |
isDefTriviallyDead - Return true if it is trivially safe to remove this function definition from the module (because it isn't externally visible, does not have its address taken, and has no callers).
To make this more accurate, call removeDeadConstantUsers first.
Definition at line 1968 of file Function.cpp.
References llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalValue::hasLinkOnceLinkage(), llvm::GlobalValue::hasLocalLinkage(), and users.
|
inline |
isIntrinsic - Returns true if the function's name starts with "llvm.".
It's possible for this function to return true while getIntrinsicID() returns Intrinsic::not_intrinsic!
Definition at line 254 of file Function.h.
Referenced by llvm::calculateCXXStateForAsynchEH(), llvm::calculateSEHStateForAsynchEH(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::InlineFunction(), moveFunctionAdaptingType(), optimizeDoubleFP(), and restoreMutatedType().
|
inline |
Definition at line 234 of file Function.h.
|
inline |
Determine if the function is presplit coroutine.
Definition at line 538 of file Function.h.
|
inline |
Determine if the call has sideeffects.
Definition at line 620 of file Function.h.
bool Function::isTargetIntrinsic | ( | ) | const |
isTargetIntrinsic - Returns true if this function is an intrinsic and the intrinsic is specific to a certain target.
If this is not an intrinsic or a generic intrinsic, false is returned.
Definition at line 955 of file Function.cpp.
References llvm::GlobalValue::IntID, and isTargetIntrinsic().
Referenced by llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), and isTargetIntrinsic().
|
static |
isTargetIntrinsic - Returns true if IID is an intrinsic specific to a certain target.
If it is a generic intrinsic false is returned.
Definition at line 951 of file Function.cpp.
|
inline |
isVarArg - Return true if this function takes a variable number of arguments.
Definition at line 232 of file Function.h.
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::SystemZELFFrameLowering::assignCalleeSavedSpillSlots(), llvm::FunctionComparator::compareSignature(), llvm::XCoreFunctionInfo::createLRSpillSlot(), llvm::SystemZELFFrameLowering::determineCalleeSaves(), llvm::XCoreFrameLowering::determineCalleeSaves(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::ARCFrameLowering::emitEpilogue(), llvm::ARCFrameLowering::emitPrologue(), llvm::SystemZXPLINKFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::getRegSpillOffset(), llvm::AArch64RegisterInfo::isArgumentRegister(), llvm::Attributor::isValidFunctionSignatureRewrite(), llvm::MipsCallLowering::lowerCall(), llvm::AArch64FrameLowering::resolveFrameOffsetReference(), llvm::FunctionLoweringInfo::set(), llvm::SystemZELFFrameLowering::spillCalleeSavedRegisters(), and llvm::PPCTargetLowering::supportsTailCallFor().
|
static |
This does the actual lookup of an intrinsic ID which matches the given function name.
Definition at line 980 of file Function.cpp.
References assert(), llvm::ArrayRef< T >::data(), findTargetSubtable(), Idx, IntrinsicNameTable, llvm::Intrinsic::isOverloaded(), llvm::Intrinsic::lookupLLVMIntrinsicByName(), Name, and llvm::Intrinsic::not_intrinsic.
Referenced by isOldDbgFormatIntrinsic(), LLVMLookupIntrinsicID(), and updateAfterNameChange().
|
inline |
Determine if the function is required to make forward progress.
Definition at line 653 of file Function.h.
|
inline |
True if this function needs an unwind table.
Definition at line 680 of file Function.h.
Referenced by llvm::X86FrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitPrologue(), llvm::ARMException::endFunction(), llvm::MachineFunction::needsFrameMoves(), llvm::AsmPrinter::needsSEHMoves(), and needsWinCFI().
bool Function::nullPointerIsDefined | ( | ) | const |
Check if null pointer dereferencing is considered undefined behavior for the function.
Return value: false => null pointer dereference is undefined. Return value: true => null pointer dereference is not undefined.
Definition at line 2128 of file Function.cpp.
References hasFnAttribute().
bool Function::onlyAccessesArgMemory | ( | ) | const |
Determine if the call can access memmory only using pointers based on its arguments.
Definition at line 912 of file Function.cpp.
References getMemoryEffects(), and llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesArgPointees().
bool Function::onlyAccessesInaccessibleMemOrArgMem | ( | ) | const |
Determine if the function may only access memory that is either inaccessible from the IR or pointed to by its arguments.
Definition at line 930 of file Function.cpp.
References getMemoryEffects(), and llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleOrArgMem().
bool Function::onlyAccessesInaccessibleMemory | ( | ) | const |
Determine if the function may only access memory that is inaccessible from the IR.
Definition at line 921 of file Function.cpp.
References getMemoryEffects(), and llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleMem().
bool Function::onlyReadsMemory | ( | ) | const |
Determine if the function does not access or only reads memory.
Definition at line 895 of file Function.cpp.
References getMemoryEffects(), and llvm::MemoryEffectsBase< LocationEnum >::onlyReadsMemory().
Referenced by HandleByValArgument().
bool Function::onlyWritesMemory | ( | ) | const |
Determine if the function does not access or only writes memory.
Definition at line 903 of file Function.cpp.
References getMemoryEffects(), and llvm::MemoryEffectsBase< LocationEnum >::onlyWritesMemory().
void Function::print | ( | raw_ostream & | OS, |
AssemblyAnnotationWriter * | AAW = nullptr , |
||
bool | ShouldPreserveUseListOrder = false , |
||
bool | IsForDebug = false |
||
) | const |
Print the function to an output stream with an optional AssemblyAnnotationWriter.
Definition at line 4852 of file AsmWriter.cpp.
References llvm::GlobalValue::getParent(), and OS.
Referenced by llvm::StackLifetime::print().
void Function::removeAttributeAtIndex | ( | unsigned | i, |
Attribute::AttrKind | Kind | ||
) |
removes the attribute from the list of attributes.
Definition at line 693 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeAttributeAtIndex().
removes the attribute from the list of attributes.
Definition at line 697 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeAttributeAtIndex().
void Function::removeFnAttr | ( | Attribute::AttrKind | Kind | ) |
Remove function attributes from this function.
Definition at line 701 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeFnAttribute().
Referenced by llvm::AMDGPU::removeFnAttrFromReachable(), and EnumAttr::set().
void Function::removeFnAttr | ( | StringRef | Kind | ) |
Remove function attribute from this function.
Definition at line 705 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeFnAttribute().
void Function::removeFnAttrs | ( | const AttributeMask & | Attrs | ) |
Definition at line 709 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeFnAttributes().
void Function::removeFromParent | ( | ) |
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it.
Definition at line 465 of file Function.cpp.
References llvm::Module::getFunctionList(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::GlobalValue::getParent(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::remove().
Referenced by llvm::OpenMPIRBuilder::finalize().
void Function::removeParamAttr | ( | unsigned | ArgNo, |
Attribute::AttrKind | Kind | ||
) |
removes the attribute from the list of attributes.
Definition at line 725 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeParamAttribute().
Referenced by llvm::Argument::removeAttr().
removes the attribute from the list of attributes.
Definition at line 729 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeParamAttribute().
void Function::removeParamAttrs | ( | unsigned | ArgNo, |
const AttributeMask & | Attrs | ||
) |
removes the attribute from the list of attributes.
Definition at line 733 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeParamAttributes().
void Function::removeRetAttr | ( | Attribute::AttrKind | Kind | ) |
removes the attribute from the return value list of attributes.
Definition at line 713 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeRetAttribute().
void Function::removeRetAttr | ( | StringRef | Kind | ) |
removes the attribute from the return value list of attributes.
Definition at line 717 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeRetAttribute().
void Function::removeRetAttrs | ( | const AttributeMask & | Attrs | ) |
removes the attributes from the return value list of attributes.
Definition at line 721 of file Function.cpp.
References getContext(), and llvm::AttributeList::removeRetAttributes().
Referenced by llvm::CloneAndPruneIntoFromInst().
void Function::renumberBlocks | ( | ) |
Renumber basic blocks into a dense value range starting from 0.
Be aware that other data structures and analyses (e.g., DominatorTree) may depend on the value numbers and need to be updated or invalidated.
Definition at line 89 of file Function.cpp.
|
inline |
Determine if the parameter or return value is marked with NoAlias attribute.
Definition at line 693 of file Function.h.
References llvm::AttributeList::hasRetAttr().
|
inline |
Set the attribute list for this Function.
Definition at line 360 of file Function.h.
Referenced by llvm::Argument::addAttrs(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), copyAttributesFrom(), doPromotion(), moveFunctionAdaptingType(), llvm::Argument::removeAttrs(), and llvm::IRPosition::setAttrList().
|
inline |
Definition at line 285 of file Function.h.
Referenced by copyAttributesFrom(), getOrCreateFunction(), llvm::InlineFunction(), and llvm::Intrinsic::remangleIntrinsicFunction().
|
inline |
Definition at line 604 of file Function.h.
|
inline |
Definition at line 612 of file Function.h.
|
inline |
Definition at line 547 of file Function.h.
void Function::setDoesNotAccessMemory | ( | ) |
Definition at line 890 of file Function.cpp.
References llvm::MemoryEffectsBase< LocationEnum >::none(), and setMemoryEffects().
|
inline |
Definition at line 631 of file Function.h.
|
inline |
Definition at line 648 of file Function.h.
|
inline |
Definition at line 585 of file Function.h.
|
inline |
Definition at line 596 of file Function.h.
void Function::setEntryCount | ( | ProfileCount | Count, |
const DenseSet< GlobalValue::GUID > * | Imports = nullptr |
||
) |
Set the entry count for this function.
Entry count is the number of times this function was executed based on pgo data. Imports
points to a set of GUIDs that needs to be imported by the function for sample PGO, to enable the same inlines as the profiled optimized binary.
Definition at line 2056 of file Function.cpp.
References assert(), llvm::MDBuilder::createFunctionEntryCount(), getContext(), llvm::Function::ProfileCount::getCount(), getEntryCount(), getImportGUIDs(), llvm::Function::ProfileCount::getType(), llvm::Function::ProfileCount::isSynthetic(), llvm::GlobalObject::setMetadata(), and llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::size().
Referenced by llvm::CodeExtractor::extractCodeRegion(), llvm::SampleProfileLoaderBaseImpl< FT >::finalizeWeightPropagation(), llvm::SampleProfileLoaderBaseImpl< FT >::initWeightPropagation(), and setEntryCount().
void Function::setEntryCount | ( | uint64_t | Count, |
Function::ProfileCountType | Type = PCT_Real , |
||
const DenseSet< GlobalValue::GUID > * | Imports = nullptr |
||
) |
A convenience wrapper for setting entry count.
Definition at line 2073 of file Function.cpp.
References setEntryCount().
void Function::setGC | ( | std::string | Str | ) |
Definition at line 843 of file Function.cpp.
References getContext(), and llvm::LLVMContext::setGC().
Referenced by copyAttributesFrom().
|
inline |
Definition at line 237 of file Function.h.
void Function::setIsNewDbgInfoFormat | ( | bool | NewVal | ) |
Definition at line 124 of file Function.cpp.
References convertFromNewDbgValues(), convertToNewDbgValues(), and IsNewDbgInfoFormat.
Referenced by llvm::CloneFunction(), llvm::CloneFunctionInto(), and doPromotion().
void Function::setMemoryEffects | ( | MemoryEffects | ME | ) |
Definition at line 882 of file Function.cpp.
References addFnAttr(), getContext(), and llvm::Attribute::getWithMemoryEffects().
Referenced by setDoesNotAccessMemory(), setOnlyAccessesArgMemory(), setOnlyAccessesInaccessibleMemOrArgMem(), setOnlyAccessesInaccessibleMemory(), setOnlyReadsMemory(), and setOnlyWritesMemory().
|
inline |
Definition at line 657 of file Function.h.
void Function::setNewDbgInfoFormatFlag | ( | bool | NewVal | ) |
Definition at line 130 of file Function.cpp.
References IsNewDbgInfoFormat.
|
inline |
Definition at line 639 of file Function.h.
|
inline |
Definition at line 615 of file Function.h.
void Function::setOnlyAccessesArgMemory | ( | ) |
Definition at line 915 of file Function.cpp.
References llvm::MemoryEffectsBase< LocationEnum >::argMemOnly(), getMemoryEffects(), and setMemoryEffects().
void Function::setOnlyAccessesInaccessibleMemOrArgMem | ( | ) |
Definition at line 933 of file Function.cpp.
References getMemoryEffects(), llvm::MemoryEffectsBase< LocationEnum >::inaccessibleOrArgMemOnly(), and setMemoryEffects().
void Function::setOnlyAccessesInaccessibleMemory | ( | ) |
Definition at line 924 of file Function.cpp.
References getMemoryEffects(), llvm::MemoryEffectsBase< LocationEnum >::inaccessibleMemOnly(), and setMemoryEffects().
void Function::setOnlyReadsMemory | ( | ) |
Definition at line 898 of file Function.cpp.
References getMemoryEffects(), llvm::MemoryEffectsBase< LocationEnum >::readOnly(), and setMemoryEffects().
void Function::setOnlyWritesMemory | ( | ) |
Definition at line 906 of file Function.cpp.
References getMemoryEffects(), setMemoryEffects(), and llvm::MemoryEffectsBase< LocationEnum >::writeOnly().
void Function::setPersonalityFn | ( | Constant * | Fn | ) |
Definition at line 1998 of file Function.cpp.
Referenced by llvm::CloneFunctionInto(), copyAttributesFrom(), llvm::CodeExtractor::extractCodeRegion(), and LLVMBuildLandingPad().
void Function::setPrefixData | ( | Constant * | PrefixData | ) |
Definition at line 2008 of file Function.cpp.
Referenced by llvm::CloneFunctionInto(), and copyAttributesFrom().
|
inline |
Definition at line 541 of file Function.h.
void Function::setPrologueData | ( | Constant * | PrologueData | ) |
Definition at line 2018 of file Function.cpp.
Referenced by llvm::CloneFunctionInto(), and copyAttributesFrom().
|
inline |
Definition at line 696 of file Function.h.
void Function::setSectionPrefix | ( | StringRef | Prefix | ) |
Set the section prefix for this function.
Definition at line 2112 of file Function.cpp.
References llvm::MDBuilder::createFunctionSectionPrefix(), getContext(), and llvm::GlobalObject::setMetadata().
|
inline |
Definition at line 623 of file Function.h.
|
inline |
Definition at line 542 of file Function.h.
void Function::setSubprogram | ( | DISubprogram * | SP | ) |
Set the attached subprogram.
Calls setMetadata() with LLVMContext::MD_dbg.
Definition at line 1833 of file Metadata.cpp.
References llvm::GlobalObject::setMetadata().
Referenced by buildDebugInfoForNoopResumeDestroyFunc(), and fixupDebugInfoPostExtraction().
|
inline |
Definition at line 673 of file Function.h.
|
inline |
Definition at line 661 of file Function.h.
bool Function::shouldEmitDebugInfoForProfiling | ( | ) | const |
Returns true if we should emit debug info for profiling.
Definition at line 1841 of file Metadata.cpp.
References getSubprogram().
Referenced by llvm::VPTransformState::setDebugLocFrom().
|
inline |
Definition at line 856 of file Function.h.
Referenced by addBoundsChecking(), addVariantDeclaration(), llvm::computeSignatureVTs(), createSwitchStatement(), createTblForTrunc(), findMainViewFileID(), gatherFileIDs(), initializeUniqueCases(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::GraphTraits< DOTFuncInfo * >::size(), and llvm::GraphTraits< DOTFuncMSSAInfo * >::size().
|
inline |
Transfer all blocks from FromF
to this function at ToIt
.
Definition at line 759 of file Function.h.
References begin(), and end().
Referenced by doPromotion(), llvm::BasicBlock::moveAfter(), and llvm::BasicBlock::moveBefore().
void Function::splice | ( | Function::iterator | ToIt, |
Function * | FromF, | ||
Function::iterator | FromBeginIt, | ||
Function::iterator | FromEndIt | ||
) |
Transfer a range of basic blocks that belong to FromF
from FromBeginIt
to FromEndIt
, to this function at ToIt
.
Definition at line 473 of file Function.cpp.
References assert(), end(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::splice().
|
inline |
Transfer one BasicBlock from FromF
at FromIt
to this function at ToIt
.
Definition at line 765 of file Function.h.
void Function::stealArgumentListFrom | ( | Function & | Src | ) |
Steal arguments from another function.
Drop this function's arguments and splice in the ones from Src
. Requires that this has no function body.
Definition at line 582 of file Function.cpp.
References A, llvm::all_of(), arg_size(), assert(), llvm::Value::getSubclassDataFromValue(), hasLazyArguments(), llvm::GlobalValue::isDeclaration(), makeArgArray(), and Name.
void Function::updateAfterNameChange | ( | ) |
Update internal caches that depend on the function name (such as the intrinsic ID and libcall cache).
Note, this method does not need to be called directly, as it is called from Value::setName() whenever the name of this function changes.
Definition at line 1000 of file Function.cpp.
References llvm::Value::getName(), llvm::GlobalValue::HasLLVMReservedName, llvm::GlobalValue::IntID, lookupIntrinsicID(), Name, and llvm::Intrinsic::not_intrinsic.
Referenced by moveFunctionAdaptingType().
void Function::viewCFG | ( | ) | const |
viewCFG - This function is meant for use from the debugger.
You can just say 'call F->viewCFG()' and a ghostview window should pop up from the program, displaying the CFG of the current function with the code for each basic block inside. This depends on there being a 'dot' and 'gv' program in your path.
You can just say 'call F->viewCFG()' and a ghostview window should pop up from the program, displaying the CFG of the current function. This depends on there being a 'dot' and 'gv' program in your path.
Definition at line 137 of file CFGPrinter.cpp.
References viewCFG().
Referenced by viewCFG(), and viewCFGOnly().
void Function::viewCFG | ( | bool | ViewCFGOnly, |
const BlockFrequencyInfo * | BFI, | ||
const BranchProbabilityInfo * | BPI | ||
) | const |
Extended form to print edge weights.
Definition at line 139 of file CFGPrinter.cpp.
References CFGFuncName, contains(), llvm::getMaxFreq(), llvm::Value::getName(), and llvm::ViewGraph().
void Function::viewCFGOnly | ( | ) | const |
viewCFGOnly - This function is meant for use from the debugger.
It works just like viewCFG, but it does not include the contents of basic blocks into the nodes, just the label. If you are only interested in the CFG this can make the graph smaller.
Definition at line 152 of file CFGPrinter.cpp.
References viewCFGOnly().
Referenced by viewCFGOnly().
void Function::viewCFGOnly | ( | const BlockFrequencyInfo * | BFI, |
const BranchProbabilityInfo * | BPI | ||
) | const |
Extended form to print edge weights.
Definition at line 154 of file CFGPrinter.cpp.
References viewCFG().
|
inline |
Determine if the function will return.
Definition at line 660 of file Function.h.
Referenced by llvm::VPRecipeBase::mayHaveSideEffects().
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 789 of file Function.h.
|
friend |
Definition at line 789 of file Function.h.
|
friend |
Definition at line 789 of file Function.h.
|
friend |
Definition at line 89 of file Function.h.
|
friend |
Definition at line 135 of file Function.h.
bool llvm::Function::IsNewDbgInfoFormat |
Is this function using intrinsics to record the position of debugging information, or non-intrinsic records? See IsNewDbgInfoFormat in BasicBlock.
Definition at line 115 of file Function.h.
Referenced by llvm::CloneFunctionInto(), convertFromNewDbgValues(), convertToNewDbgValues(), llvm::CodeExtractor::extractCodeRegion(), llvm::BasicBlock::insertInto(), llvm::Attributor::internalizeFunctions(), moveFunctionAdaptingType(), setIsNewDbgInfoFormat(), and setNewDbgInfoFormatFlag().