A single function or procedure in LLVM IR.

Synopsis

Declared in <llvm/IR/Function.h>

class Function
    : public GlobalObject
    , public ilist_node<Function>

Description

A function consists of a list of basic blocks, a list of arguments, and a symbol table.

Base Classes

Name

Description

GlobalObject

Base class for independently defined globals such as functions and variables.

ilist_node<Function>

An intrusive list node.

Types

Name

Description

SanitizerMetadata

Per‐global sanitizer instrumentation flags for ASan, HWASan, and Memtag.

const_value_op_iterator

Const iterator for directly iterating over the operand Values.

value_op_iterator

Iterator for directly iterating over the operand Values.

Type Aliases

Name

Description

BasicBlockListType

The list type used to store this function's basic blocks.

GUID

A 64‐bit global unique identifier used by PGO and ThinLTO.

arg_iterator

Iterator over this function's formal arguments.

const_arg_iterator

Const iterator over this function's formal arguments.

const_iterator

Const iterator over this function's basic blocks.

const_op_iterator

Const iterator over this user's operand Use objects.

const_op_range

Range of const operand Use iterators.

const_use_iterator

Const iterator over this value's uses.

const_user_iterator

Const iterator over this value's users.

iterator

Iterator over this function's basic blocks.

op_iterator

Iterator over this user's operand Use objects.

op_range

Range of mutable operand Use iterators.

use_iterator

Iterator over this value's uses.

user_iterator

Iterator over this value's users.

Enums

Name

Description

DLLStorageClassTypes

Storage classes of global values for PE targets.

LinkageTypes

An enumeration for the kinds of linkage for global values.

ThreadLocalMode

Thread‐local storage models for global variables.

UnnamedAddr

How significant this global's address is when merging or linking.

VCallVisibility

Values for visibility metadata attached to vtables.

ValueTy

Concrete subclass of this.

VisibilityTypes

An enumeration for the kinds of visibility of global values.

Member Functions

Name

Description

Function [constructor] [deleted]

Copy construction is deleted; Function owns its basic blocks and state.

~Function [destructor]

Destroy this function and its basic blocks.

operator=

Assignment operators

DoPHITranslation

DoPHITranslation overloads

addAttributeAtIndex

adds the attribute to the list of attributes.

addDereferenceableOrNullParamAttr

adds the dereferenceable_or_null attribute to the list of attributes for the given arg.

addDereferenceableParamAttr

adds the dereferenceable attribute to the list of attributes for the given arg.

addFnAttr

Add function attributes to this function.

addFnAttrs

Add function attributes to this function.

addParamAttr

adds the attribute to the list of attributes for the given arg.

addParamAttrs

adds the attributes to the list of attributes for the given arg.

addRangeRetAttr

adds the range attribute to the list of attributes for the return value.

addRetAttr

Add return value attributes to this function.

addRetAttrs

Add return value attributes to this function.

addTypeMetadata

Attach type metadata at the given offset for this global object.

addUse

This method should only be used by the Use class.

arg_begin

arg_begin overloads

arg_empty

Return true if this function has no formal arguments.

arg_end

arg_end overloads

arg_size

Return the number of formal arguments.

args

args overloads

assertModuleIsMaterialized

Assert in debug builds that modules containing this value are materialized.

assertModuleIsMaterializedImpl

Assert that every module containing this value is fully materialized.

back

Return the last basic block in this function.

begin

begin overloads

callsFunctionThatReturnsTwice

callsFunctionThatReturnsTwice ‐ Return true if the function has a call to setjmp or other function that gcc recognizes as "returning twice".

canBeFreed

Return true if this pointer's memory may be freed in its defining scope.

canBeOmittedFromSymbolTable

Return true if this global can be left out of the object symbol table.

canBenefitFromLocalAlias

Return true if this global may use a local alias during code generation.

canChangeSignature

Determine whether interprocedural transforms may rewrite this function's signature.

canIncreaseAlignment

Returns true if the alignment of the value can be unilaterally increased.

cannotDuplicate

Determine if the call cannot be duplicated.

clearGC

Remove the garbage‐collection algorithm name from this function.

containsConstantExpression

Return true if this is a fixed width vector constant that includes any constant expressions.

containsMatchingVectorElement

Return true if this is a vector constant where at least one element satisfies the given predicate. Scalable vectors are not checked.

containsPoisonElement

Return true if this is a vector constant that includes any poison elements.

containsUndefElement

Return true if this is a vector constant that includes any strictly undef (not poison) elements.

containsUndefOrPoisonElement

Return true if this vector constant includes undef or poison elements.

convertFromNewDbgValues

Convert all basic blocks in this function back from the new debug‐info format.

convertToNewDbgValues

Convert all basic blocks in this function to the new debug‐info format.

copyAttributesFrom

copyAttributesFrom ‐ copy all additional attributes (those not needed to create a Function) from the Function Src to this one.

copyMetadata

Copy metadata from Src, adjusting offsets by Offset.

deleteBody

deleteBody ‐ This method deletes the body of the function, and converts the linkage to external.

deleteValue

Delete a pointer to a generic Value.

destroyConstant

Destroy this constant and any constant users that depend on it.

doesNoCfCheck

Determine if the function should not perform indirect branch tracking.

doesNotAccessMemory

Determine if the function does not access memory.

doesNotFreeMemory

Determine if the call might deallocate memory.

doesNotRecurse

Determine if the function is known not to recurse, directly or indirectly.

doesNotReturn

Determine if the function cannot return.

doesNotThrow

Determine if the function cannot unwind.

dropAllReferences

Drop all references held by instructions in this function's body.

dropDroppableUses

Remove every uses that can safely be removed.

dropDroppableUsesIn

Remove every use of this value in User that can safely be removed.

dump

Support for debugging, callable in GDB: V‐>dump()

empty

Return true if this function has no basic blocks.

end

end overloads

erase

Erases a range of BasicBlocks from FromIt to (not including) ToIt.

eraseFromParent

eraseFromParent ‐ This method unlinks 'this' from the containing module and deletes it.

front

Return the first basic block in this function.

getAbsoluteSymbolRange

If this is an absolute symbol reference, returns the range of the symbol, otherwise returns std::nullopt.

getAddressSpace

Return the address space of this global value's pointer type.

getAggregateElement

getAggregateElement overloads

getAliaseeObject

Return the underlying GlobalObject this value ultimately refers to, if any (following aliases).

getAlign

Returns the alignment of the given function.

getArg

Return the formal argument at zero‐based index i.

getAttributeAtIndex

gets the attribute from the list of attributes.

getAttributes

Return the attribute list for this Function.

getBlockNumberEpoch

Return the epoch of the current basic‐block numbering.

getCallingConv

Return the calling convention of this function.

getComdat

Return the Comdat object for this global object, or null if none.

getContext

getContext ‐ Return a reference to the LLVMContext associated with this function.

getDLLStorageClass

Return the DLL storage class of this global value.

getDataLayout

Get the data layout of the module this function belongs to.

getDeadOnReturnInfo

Extract the number of dead_on_return bytes for a parameter.

getDenormalFPEnv

Return the representational value of the denormal_fpenv attribute.

getDenormalMode

Returns the denormal handling type for the default rounding mode of the function.

getDescriptor

Returns the descriptor co‐allocated with this User instance.

getEntryBlock

Return the entry basic block of this function.

getEntryCount

Get the entry count for this function.

getFnAttribute

Return the attribute for the given attribute kind.

getFnAttributeAsParsedInteger

For a string attribute Kind, parse attribute as an integer.

getFnStackAlign

Return the stack alignment for the function.

getFunction

Return this function (identity helper for generic FunctionT code).

getFunctionType

Returns the FunctionType for me.

getGC

Return the name of the garbage collection algorithm for this function.

getGUID

Return a 64‐bit global unique ID for this value.

getGUIDIfAssigned

Return this value's GUID if one has been assigned, or nullopt otherwise.

getGUIDOrFallback

Return the GUID for this value if it has been assigned, otherwise fall back to computing it based on its current name and linkage.

getImportGUIDs

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.

getInstructionCount

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.

getIntrinsicID

Return the intrinsic ID for this function, or not_intrinsic.

getLinkage

Return the linkage type of this global value.

getMaxBlockNumber

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.

getMemoryEffects

Return the memory effects attributed to this function.

getMetadata

getMetadata overloads

getName

Return a constant reference to the value's name.

getNameOrAsOperand

Return this value's name, or a printed operand string if it is unnamed.

getNumOperands

Return the number of hung‐off operands.

getNumUses

This method computes the number of uses of this Value.

getOperand

getOperand overloads

getOperandList

getOperandList overloads

getOperandUse

getOperandUse overloads

getParamAlign

Return the alignment attribute for parameter ArgNo, if any.

getParamAttribute

gets the specified attribute from the list of attributes.

getParamByRefType

Extract the byref type for a parameter.

getParamByValType

Extract the byval type for a parameter.

getParamDereferenceableBytes

Extract the number of dereferenceable bytes for a parameter.

getParamDereferenceableOrNullBytes

Extract the number of dereferenceable_or_null bytes for a parameter.

getParamInAllocaType

Extract the inalloca type for a parameter.

getParamNoFPClass

Extract the nofpclass attribute for a parameter.

getParamPreallocatedType

Extract the preallocated type for a parameter.

getParamStackAlign

Return the stack alignment attribute for parameter ArgNo, if any.

getParamStructRetType

Extract the sret type for a parameter.

getParent

Return the module that contains this global value.

getPartition

Return the linker partition name for this global, or empty if none is set.

getPersonalityFn

Get the personality function associated with this function.

getPointerAlignment

Returns an alignment of the pointer value.

getPointerDereferenceableBytes

Returns the number of bytes known to be dereferenceable for the pointer value.

getPointerOffsetFrom

If this ptr is provably equal to Other plus a constant offset, return that offset in bytes. Essentially ptr this subtract ptr Other.

getPreferredAlignment

Returns the prefalign of the given function.

getPrefixData

Get the prefix data associated with this function.

getPrologueData

Get the prologue data associated with this function.

getRawSubclassOptionalData

Return the raw optional flags value contained in this value.

getRetAttribute

Return the attribute for the given attribute kind for the return value.

getReturnType

Returns the type of the ret val.

getSanitizerMetadata

Return the sanitizer instrumentation flags for this global.

getSection

Get the custom section of this global if it has one.

getSectionPrefix

Get the section prefix for this global object.

getSingleUndroppableUse

getSingleUndroppableUse overloads

getSplatValue

If all elements of the vector constant have the same value, return that value. Otherwise, return nullptr. Ignore poison elements by setting AllowPoison to true.

getSubprogram

Get the attached subprogram.

getThreadLocalMode

Return the thread‐local storage model of this global.

getType

Global values are always pointers.

getUWTableKind

Get what kind of unwind table entry to generate for this function.

getUniqueInteger

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.

getUniqueUndroppableUser

getUniqueUndroppableUser overloads

getUnnamedAddr

Return how significant this global's address is for merging/linking.

getVCallVisibility

Return the vcall visibility recorded on this global object.

getVScaleValue

Return the value for vscale based on the vscale_range attribute or 0 when unknown.

getValueID

Return an ID for the concrete type of this object.

getValueName

Return the symbol‐table name entry for this value, if any.

getValueSymbolTable

Return the value symbol table for this function, or null if none.

getValueType

Return the type of the value (the pointee type for pointer globals).

getVisibility

Return the visibility of this global value.

handleOperandChange

Replace all uses of From with To within this constant.

hasAddressTaken

Return true if this function has non‐call uses that take its address.

hasAppendingLinkage

Return true if this global has appending linkage.

hasAtLeastLocalUnnamedAddr

Returns true if this value's address is not significant in this module.

hasAttributeAtIndex

Check if attribute of the given kind is set at the given index.

hasAvailableExternallyLinkage

Return true if this global has available_externally linkage.

hasComdat

Return true if this global object belongs to a COMDAT group.

hasCommonLinkage

Return true if this global has common linkage.

hasDLLExportStorageClass

Return true if this global is exported from a DLL.

hasDLLImportStorageClass

Return true if this global is imported from a DLL.

hasDefaultVisibility

Return true if this global has default visibility.

hasExactDefinition

Return true if this global has an exact defintion.

hasExactInverseFP

Return true if this scalar has an exact multiplicative inverse or this vector has an exact multiplicative inverse for each element in the vector.

hasExternalLinkage

Return true if this global has external linkage.

hasExternalWeakLinkage

Return true if this global has external weak linkage.

hasFnAttribute

Return true if the function has the attribute.

hasGC

hasGC/getGC/setGC/clearGC ‐ The name of the garbage collection algorithm to use during code generation.

hasGlobalUnnamedAddr

Return true if this global has the global unnamed_addr attribute.

hasHiddenVisibility

Return true if this global has hidden visibility.

hasInternalLinkage

Return true if this global has internal linkage.

hasKernelCallingConv

Does it have a kernel calling convention?

hasLazyArguments

Return true if the formal argument list has not been built yet.

hasLinkOnceAnyLinkage

Return true if this global has linkonce‐any linkage.

hasLinkOnceLinkage

Return true if this global has linkonce or linkonce_odr linkage.

hasLinkOnceODRLinkage

Return true if this global has linkonce_odr linkage.

hasLocalLinkage

Return true if this global has internal or private linkage.

hasMetadata

hasMetadata overloads

hasMetadataOtherThanDebugLocAndGuid

Return true if this global has metadata other than debug location and GUID.

hasMinSize

Optimize this function for minimum size (‐Oz).

hasNUndroppableUses

Return true if this value has exactly N undroppable uses.

hasNUndroppableUsesOrMore

Return true if this value has N undroppable uses or more.

hasNUses

Return true if this Value has exactly N uses.

hasNUsesOrMore

Return true if this value has N uses or more.

hasName

Return true if this value has a name in the symbol table.

hasNoSync

Determine if the call can synchroize with other threads

hasOneLiveUse

Return true if the constant has exactly one live use.

hasOneUse

Return true if there is exactly one use of this value.

hasOneUser

Return true if there is exactly one user of this value.

hasOptNone

Do not optimize this function (‐O0).

hasOptSize

Optimize this function for size (‐Os) or minimum size (‐Oz).

hasParamAttribute

hasParamAttribute overloads

hasPartition

Return true if this global has a linker partition name.

hasPersonalityFn

Check whether this function has a personality function.

hasPrefixData

Check whether this function has prefix data.

hasPrivateLinkage

Return true if this global has private linkage.

hasProfileData

Return true if the function is annotated with profile data.

hasPrologueData

Check whether this function has prologue data.

hasProtectedVisibility

Return true if this global has protected visibility.

hasRetAttribute

check if an attribute is in the list of attributes for the return value.

hasSanitizerMetadata

Return true if this global has sanitizer metadata attached.

hasSection

Check if this global has a custom object file section.

hasStackProtectorFnAttr

Returns true if the function has ssp, sspstrong, or sspreq fn attrs.

hasStructRetAttr

Determine if the function returns a structure through first or second pointer argument.

hasUWTable

True if the ABI mandates (or the user requested) that this function be in a unwind table.

hasUseList

Check if this Value has a use‐list.

hasValidDeclarationLinkage

Return true if this global has a linkage valid for a declaration.

hasValueHandle

Return true if there is a value handle associated with this value.

hasWeakAnyLinkage

Return true if this global has weak_any linkage.

hasWeakLinkage

Return true if this global has weak or weak ODR linkage.

hasWeakODRLinkage

Return true if this global has weak_odr linkage.

hasZeroLiveUses

Return true if the constant has no live uses.

insert

Insert BB in the basic block list at Position.

isAbsoluteSymbolRef

Returns whether this is a reference to an absolute symbol.

isAllOnesValue

Return true if this is the value that would be returned by getAllOnesValue.

isConstantUsed

Return true if the constant has users other than constant expressions and other dangling things.

isConstrainedFPIntrinsic

Return true if this is a constrained floating‐point intrinsic.

isConvergent

Determine if the call is convergent.

isCoroOnlyDestroyWhenComplete

Return true if coroutine destroy runs only when the coro is complete.

isDLLImportDependent

Return true if the value is dependent on a dllimport variable.

isDSOLocal

Return true if this symbol is known to be local to the DSO.

isDeclaration

Return true if the primary definition of this global value is outside of the current translation unit.

isDeclarationForLinker

Return true if the linker should treat this global as a declaration.

isDefTriviallyDead

Return true if this function definition is trivially safe to remove.

isDefinitionExact

Return true if the currently visible definition of this global (if any) is exactly the definition we will see at runtime.

isDiscardableIfUnused

Return true if this global's definition may be discarded if unused.

isDroppable

Return whether this user's uses may be dropped without affecting correctness.

isElementWiseEqual

Return true if this constant and Y are element‐wise equal.

isFiniteNonZeroFP

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.

isImplicitDSOLocal

Return true if linkage or visibility implies this symbol is dso_local.

isInterposable

Return true if this global's definition can be substituted arbitrarily.

isIntrinsic

Return true if this function's name starts with "llvm.".

isManifestConstant

Return true if a constant is ConstantData or a ConstantAggregate or ConstantExpr that contain only ConstantData.

isMaterializable

Return true if this function's body may be lazily materialized.

isMaxSignedValue

Return true if the value is the largest signed value.

isMinSignedValue

Return true if the value is the smallest signed value.

isNaN

Return true if this is a floating‐point NaN constant or a vector floating‐point constant with all NaN elements.

isNegativeZeroValue

Return true if the value is what would be returned by getZeroValueForNegation.

isNormalFP

Return true if this is a normal floating‐point constant.

isNotMinSignedValue

Return true if the value is not the smallest signed value, or, for vectors, does not contain smallest signed value elements.

isNotOneValue

Return true if the value is not the one value, or, for vectors, does not contain one value elements.

isNullValue

Return true if this is the value that would be returned by getNullValue.

isOneValue

Returns true if the value is one.

isPresplitCoroutine

Determine if the function is presplit coroutine.

isSpeculatable

Determine if the call has sideeffects.

isStrictFP

Determine if the function has strict floating point sematics.

isStrongDefinitionForLinker

Returns true if this global's definition will be the one chosen by the linker.

isSwiftError

Return true if this value is a swifterror value.

isTagged

Return true if memtag sanitization is requested for this global.

isTargetIntrinsic

Return true if this function is a target‐specific intrinsic.

isThreadDependent

Return true if the value can vary between threads.

isThreadLocal

If the value is "Thread Local", its value isn't shared by the threads.

isUsedByMetadata

Return true if there is metadata referencing this value.

isUsedInBasicBlock

Check if this value is used in the specified basic block.

isVarArg

isVarArg ‐ Return true if this function takes a variable number of arguments.

isWeakForLinker

Return true if this global's definition may be replaced at link time.

materialize

Make sure this GlobalValue is fully read.

materialized_use_begin

materialized_use_begin overloads

materialized_use_empty

Return true if there are no currently materialized uses.

materialized_user_begin

materialized_user_begin overloads

materialized_users

materialized_users overloads

materialized_uses

materialized_uses overloads

mustProgress

Determine if the function is required to make forward progress.

mutateType

Mutate the type of this Value to be of the specified type.

needsDynamicRelocation

Return true if this constant may generate a dynamic relocation entry.

needsRelocation

Return true if this constant may generate a relocation entry.

needsUnwindTableEntry

True if this function needs an unwind table.

nullPointerIsDefined

Return whether null pointer dereference is defined for this function.

onlyAccessesArgMemory

Determine if the call can access memory only using pointers based on its arguments.

onlyAccessesInaccessibleMemOrArgMem

Determine if the function may only access memory that is either inaccessible from the IR or pointed to by its arguments.

onlyAccessesInaccessibleMemory

Determine if the function may only access memory that is inaccessible from the IR.

onlyReadsMemory

Determine if the function does not access or only reads memory.

onlyWritesMemory

Determine if the function does not access or only writes memory.

op_begin

op_begin overloads

op_end

op_end overloads

operand_values

operand_values overloads

operands

operands overloads

operator delete

Delete operators

print

print overloads

printAsOperand

printAsOperand overloads

reassignGUID

Recompute and assign a GUID to this value, replacing the existing GUID.

removeAttributeAtIndex

removes the attribute from the list of attributes.

removeDeadConstantUsers

Remove any dead constant users dangling off of this constant.

removeFnAttr

removeFnAttr overloads

removeFnAttrs

Remove function attributes matching Attrs from this function.

removeFromParent

removeFromParent ‐ This method unlinks 'this' from the containing module, but does not delete it.

removeParamAttr

removes the attribute from the list of attributes.

removeParamAttrs

removes the attribute from the list of attributes.

removeRetAttr

removes the attribute from the return value list of attributes.

removeRetAttrs

removes the attributes from the return value list of attributes.

removeSanitizerMetadata

Remove sanitizer metadata from this global value.

renumberBlocks

Renumber basic blocks into a dense range starting from zero.

replaceAllUsesWith

Change all uses of this to point to a new Value.

replaceNonMetadataUsesWith

Change non‐metadata uses of this to point to a new Value.

replaceUsesOfWith

Replace uses of one Value with another.

replaceUsesOutsideBlock

Replace uses of this value that occur outside BB with V.

replaceUsesWithIf

Replace selected uses of this value with New.

returnDoesNotAlias

Determine if the parameter or return value is marked with NoAlias attribute.

reverseUseList

Reverse the use‐list.

setAlignment

setAlignment overloads

setAttributes

Set the attribute list for this Function.

setCallingConv

Set the calling convention of this function.

setCannotDuplicate

Mark that the function cannot be duplicated.

setComdat

Set the COMDAT group for this global object, or clear it if C is null.

setConvergent

Mark that the function is convergent.

setCoroDestroyOnlyWhenComplete

Mark that the coroutine destroy runs only when the coro is complete.

setDLLStorageClass

Set the DLL storage class of this global value.

setDSOLocal

Set whether this symbol is known to be local to the linkage unit.

setDoesNotAccessMemory

Mark that the function does not access memory.

setDoesNotFreeMemory

Mark the function as not deallocating memory (adds nofree).

setDoesNotRecurse

Mark that the function does not recurse.

setDoesNotReturn

Mark that the function does not return.

setDoesNotThrow

Mark that the function does not throw.

setEntryCount

Set the entry count for this function.

setGC

Set the garbage collection algorithm name used during code generation.

setIsMaterializable

Mark whether this function's body may be lazily materialized from bitcode.

setLinkage

Set the linkage type of this global value.

setMemoryEffects

Set the memory effects attributed to this function.

setMustProgress

Mark that the function must make forward progress.

setName

Change the name of the value.

setNoSanitizeMetadata

Disable address and HWAddress sanitizer instrumentation for this global.

setNoSync

Mark that the function does not synchronize with other threads.

setNotConvergent

Clear the convergent attribute so the function is not treated as convergent.

setNumHungOffUseOperands

Set the operand count for a User with hung‐off uses.

setOnlyAccessesArgMemory

Mark that the function may only access memory through its arguments.

setOnlyAccessesInaccessibleMemOrArgMem

Mark that memory access is limited to inaccessible or argument memory.

setOnlyAccessesInaccessibleMemory

Mark that the function may only access memory inaccessible from the IR.

setOnlyReadsMemory

Mark that the function does not access or only reads memory.

setOnlyWritesMemory

Mark that the function does not access or only writes memory.

setOperand

setOperand overloads

setPartition

Set the linker partition name for this global.

setPersonalityFn

Set the personality function used for exception handling in this function.

setPreferredAlignment

Sets the prefalign attribute of the Function.

setPrefixData

Set the constant prefix data emitted before this function's entry block.

setPresplitCoroutine

Mark this function as a presplit coroutine.

setPrologueData

Set the constant prologue data emitted at the start of this function.

setReturnDoesNotAlias

Mark that the return value does not alias any other pointer.

setSanitizerMetadata

Set sanitizer instrumentation flags for this global value.

setSection

Change the section for this global.

setSectionPrefix

Update the section prefix metadata if it differs from Prefix.

setSpeculatable

Mark the function as safe to speculate (no side effects or undefined behavior).

setSplittedCoroutine

Clear the presplit‐coroutine attribute after splitting.

setSubprogram

Set the attached subprogram.

setThreadLocal

Set whether this global is thread‐local using the general‐dynamic model.

setThreadLocalMode

Set the thread‐local storage model of this global.

setUWTableKind

Set the unwind‐table kind for this function.

setUnnamedAddr

Set how significant this global's address is for merging and linking.

setVCallVisibilityMetadata

Set the vcall visibility metadata for this global object.

setValueName

Set the symbol‐table name entry for this value.

setVisibility

Set the visibility of this global value.

setWillReturn

Mark that the function will return.

shouldEmitDebugInfoForProfiling

Returns true if we should emit debug info for profiling.

size

Return the number of basic blocks in this function.

sortUseList

Sort the use‐list.

splice

splice overloads

stealArgumentListFrom

Steal arguments from another function.

stripAndAccumulateConstantOffsets

stripAndAccumulateConstantOffsets overloads

stripAndAccumulateInBoundsConstantOffsets

stripAndAccumulateInBoundsConstantOffsets overloads

stripInBoundsConstantOffsets

stripInBoundsConstantOffsets overloads

stripInBoundsOffsets

stripInBoundsOffsets overloads

stripPointerCasts

stripPointerCasts overloads

stripPointerCastsAndAliases

stripPointerCastsAndAliases overloads

stripPointerCastsForAliasAnalysis

stripPointerCastsForAliasAnalysis overloads

stripPointerCastsSameRepresentation

stripPointerCastsSameRepresentation overloads

takeName

Transfer the name from V to this value.

toConstantRange

Convert constant to an approximate constant range. For vectors, the range is the union over the element ranges. Poison elements are ignored.

updateAfterNameChange

Update internal caches that depend on the function name.

use_begin

use_begin overloads

use_empty

Return true if this value has no uses.

use_end

use_end overloads

user_back

Return the sole user when this value has exactly one user.

user_begin

Return an iterator to the first user of this value.

user_empty

Return true if this value has no users.

user_end

user_end overloads

users

users overloads

uses

uses overloads

value_op_begin

value_op_begin overloads

value_op_end

value_op_end overloads

viewCFG

viewCFG overloads

viewCFGOnly

viewCFGOnly overloads

willReturn

Determine if the function will return.

Static Member Functions

Name

Description

Create

Create overloads

classof

Methods for support type inquiry through isa, cast, and dyn_cast.

createWithDefaultAttr

Creates a function with some attributes recorded in llvm.module.flags and the LLVMContext applied.

dropDroppableUse

Remove the droppable use U.

dropLLVMManglingEscape

If the given string begins with the GlobalValue name mangling escape character '1', drop it.

getAllOnesValue

Return the all‐ones constant of type Ty.

getGUIDAssumingExternalLinkage

Return a 64‐bit GUID for a global symbol name, assuming external linkage.

getGlobalIdentifier

Return a lookup key for a global value used by PGO and ThinLTO.

getIntegerValue

Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value.

getLinkOnceLinkage

Return linkonce or linkonce_odr linkage depending on ODR.

getMinUnnamedAddr

Return the more significant unnamed_addr of A and B.

getNullValue

Return the null constant of type Ty (zero for integers, null for pointers, and so on).

getWeakLinkage

Return weak or weak_odr linkage depending on ODR.

isAppendingLinkage

Return true if Linkage is appending linkage.

isAvailableExternallyLinkage

Return true if Linkage is available_externally linkage.

isCommonLinkage

Return true if Linkage is common linkage.

isDiscardableIfUnused

Whether the definition of this global may be discarded if it is not used in its compilation unit.

isExternalLinkage

Return true if Linkage is external linkage.

isExternalWeakLinkage

Return true if Linkage is external weak linkage.

isInternalLinkage

Return true if Linkage is internal linkage.

isInterposableLinkage

Return true if a definition with Linkage may be replaced non‐equivalently at link time.

isLinkOnceAnyLinkage

Return true if Linkage is linkonce‐any linkage.

isLinkOnceLinkage

Return true if Linkage is linkonce or linkonce ODR linkage.

isLinkOnceODRLinkage

Return true if Linkage is linkonce_odr linkage.

isLocalLinkage

Return true if Linkage is internal or private linkage.

isPrivateLinkage

Return true if Linkage is private linkage.

isValidDeclarationLinkage

Return true if Linkage is valid for a declaration without a definition.

isWeakAnyLinkage

Return true if Linkage is weak_any linkage.

isWeakForLinker

Return true if a definition with Linkage may be replaced at link time.

isWeakLinkage

Return true if Linkage is weak or weak ODR linkage.

isWeakODRLinkage

Return true if Linkage is weak ODR linkage.

mergeUndefsWith

Merge undef elements from Other into constant C.

replaceUndefsWith

Try to replace undefined constant C or undefined elements in C with Replacement. If no changes are made, the constant C is returned.

Static Data Members

Name

Description

MaxAlignmentExponent

The maximum alignment for instructions.

MaximumAlignment

Maximum absolute alignment in bytes (1 << MaxAlignmentExponent).

Using Declarations

Name

Description

addMetadata

Add a metadata attachment to this global object.

clearMetadata

Erase all metadata attached to this global object.

eraseMetadata

Erase all metadata attachments with the given kind.

eraseMetadataIf

Erase all metadata attachments matching the given predicate.

getAllMetadata

Appends all metadata attached to this global object to MDs.

setMetadata

Set a particular kind of metadata attachment on this global object.

Protected Types

Name

Description

AllocInfo

Information about how a User object was allocated, to be passed into the User constructor.

HungOffOperandsAllocMarker

Indicates this User has operands "hung off" in another allocation.

IntrusiveOperandsAllocMarker

Indicates this User has operands co‐allocated.

IntrusiveOperandsAndDescriptorAllocMarker

Indicates this User has operands and a descriptor co‐allocated .

Protected Enums

Name

Description

Unnamed enum

Bit indices for data packed into GlobalValueSubClassData.

Protected Member Functions

Name

Description

Op

Op overloads

addMetadata

addMetadata overloads

allocHungoffUses

Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User.

clearMetadata

Erase all metadata attached to this Value.

copyAttributesFrom

copyAttributesFrom overloads

eraseMetadata

Erase all metadata attachments with the given kind.

eraseMetadataIf

Erase all metadata attachments matching the given predicate.

getAlign

Returns the alignment of the given variable or function.

getAllMetadata

Append all metadata attached to this value into MDs.

getGlobalObjectSubClassData

Return subclass‐specific data packed above GlobalObject bits.

getGlobalValueSubClassData

Return subclass‐specific data packed into this global value.

getMetadata

Get the current metadata attachments for the given kind, if any.

getMetadataImpl

Get metadata for the given kind, if any.

getSubclassDataFromValue

Return the opaque subclass data bits stored in this value.

growHungoffUses

Grow the number of hung off uses. Note that allocHungoffUses should be called if there are no uses.

operator new

New operators

setAlignment

setAlignment overloads

setGlobalObjectSubClassData

Set subclass‐specific data packed above GlobalObject bits.

setGlobalValueSubClassData

Set subclass‐specific data packed into this global value.

setMetadata

setMetadata overloads

setParent

Set the module that contains this global value.

setValueSubclassData

Set the opaque subclass data bits stored in this value.

Protected Static Member Functions

Name

Description

OpFrom

Return the operand Use at compile‐time index Idx from that.

Protected Data Members

Name

Description

DllStorageClass

DLL storage class of this global (see DLLStorageClassTypes).

HasDescriptor

True if this value has a descriptor.

HasHungOffUses

Whether operands are stored in a separately allocated array.

HasLLVMReservedName

True if this value's name starts with "llvm.".

HasName

True if this value has a name in the symbol table.

HasPartition

True if this symbol has a partition name assigned (see https://lld.llvm.org/Partitions.html).

HasSanitizerMetadata

True if this symbol has sanitizer metadata available. Should only happen if sanitizers were enabled when building the translation unit which contains this GV.

IntID

The intrinsic ID for this subclass (which must be a Function).

IsDSOLocal

If true then there is a definition within the same linkage unit and that definition cannot be runtime preempted.

IsUsedByMD

True if metadata references this value.

Linkage

Linkage type of this global (see LinkageTypes).

MetadataIndex

Index of first metadata attachment in context, or zero.

NumUserOperands

Number of operands in this user.

ObjComdat

The COMDAT group for this global, or null if none.

Parent

The module containing this global value.

SubclassOptionalData

Hold arbitary subclass data.

ThreadLocal

Is this symbol "Thread Local", if so, what is the desired model?

UnnamedAddrVal

This value's unnamed address mode (see UnnamedAddr).

ValueType

The type of the value this global points to (the pointee type).

Visibility

The visibility of this global (see VisibilityTypes).

Protected Static Data Members

Name

Description

ConstantSubclassBits

Bits reserved in SubclassOptionalData, not to be used for ConstantExpr flags.

GlobalObjectSubClassDataBits

Number of subclass data bits remaining after GlobalObject's reserved bits.

GlobalValueSubClassDataBits

Number of bits reserved for subclass‐specific data in GlobalValue.

Friends

Name

Description

llvm::ilist_node_with_parent

An ilist node that can access its parent list.

llvm::SymbolTableListTraits

Traits that keep parent links and symbol tables in sync with list changes.

llvm::InstIterator

Grant InstIterator access to the basic‐block list.

llvm::BasicBlock::eraseFromParent

Unlink 'this' from the containing function and delete it.

llvm::BasicBlock::removeFromParent

Unlink 'this' from the containing function, but do not delete it.

llvm::TargetLibraryInfoImpl

Implementation of the target library information.

llvm::BasicBlock::setParent

Non-Member Functions

Name

Description

CloneAndPruneFunctionInto

Clone OldFunc into NewFunc with on‐the‐fly constant prop and DCE.

CloneAndPruneIntoFromInst

Clone and prune OldFunc into NewFunc starting at a given instruction.

CloneFunction

Return a copy of the specified function and add it to its module.

CloneFunctionAttributesInto

Clone OldFunc's attributes into NewFunc, transforming values based on the mappings in VMap.

CloneFunctionBodyInto

Clone OldFunc's body into NewFunc.

CloneFunctionInto

Clone OldFunc into NewFunc using the provided value map.

CloneFunctionMetadataInto

Clone OldFunc's metadata into NewFunc.

ComputeMaxSignificantBits

Get the upper bound on bit size for this Value Op as a signed integer.

ComputeNumSignBits

Return the number of times the sign bit of the register is replicated into the other bits.

ConstantFoldConstant

Fold a constant using the specified DataLayout.

ConstantFoldExtractElementInstruction

Attempt to constant fold an extractelement instruction with the specified operands and indices.

ConstantFoldExtractValueInstruction

Attempt to constant fold an extractvalue instruction with the specified operands and indices.

ConstantFoldInsertElementInstruction

Attempt to constant fold an insertelement instruction with the specified operands and indices.

ConstantFoldInsertValueInstruction

Attempt to constant fold an insertvalue instruction with the specified operands and indices.

ConstantFoldIntegerCast

Constant fold a zext, sext or trunc, depending on IsSigned and whether the DestTy is wider or narrower than C. Returns nullptr on failure.

ConstantFoldLoadFromConst

Extract value of C at the given Offset reinterpreted as Ty. If bits past the end of C are accessed, they are assumed to be poison.

ConstantFoldLoadFromConst

Extract value of C reinterpreted as Ty. Same as previous API with zero offset.

ConstantFoldLoadFromConstPtr

Return the value that a load from C with offset Offset would produce if it is constant and determinable. If this is not determinable, return null.

ConstantFoldLoadFromConstPtr

Return the value that a load from C would produce if it is constant and determinable. If this is not determinable, return null.

ConstantFoldLoadFromUniformValue

Return a uniform bit‐pattern constant reinterpreted as Ty, or null.

ConstantFoldLoadThroughBitcast

Try to cast a constant to a destination type through a bitcast‐like load.

ConstantFoldSelectInstruction

Attempt to constant fold a select instruction with the specified operands. The constant result is returned if successful; if not, null is returned.

ConstantFoldShuffleVectorInstruction

Attempt to constant fold a shufflevector instruction with the specified operands and mask.

EliminateUnreachableBlocks

Delete all basic blocks in F that are unreachable from its entry.

ExtractTypeInfo

ExtractTypeInfo ‐ Returns the type info, possibly bitcast, encoded in V.

FindEarliestCapture

Find the earliest instruction that captures V in F.

FindFunctionBackedges

Find all loop backedges in the specified function.

FindInsertedValue

Given an aggregate and a sequence of indices, see if the scalar value indexed is already around as a register.

FlushFPConstant

Flush a floating‐point constant according to the parent function's denormal mode.

GetPointerBaseWithConstantOffset

Analyze the specified pointer to see if it can be expressed as a base pointer plus a constant offset. Return the base and offset to the caller.

GetPointerBaseWithConstantOffset

Const overload of GetPointerBaseWithConstantOffset.

GetStringLength

If we can compute the length of the string pointed to by the specified pointer, return 'len+1'. If we can't, return 0.

IsConstantOffsetFromGlobal

Return true if C is a constant offset from a global.

LowerDbgDeclare

Lower dbg.declare records into dbg.value records.

MapValue

Look up or compute a value in the value map.

MapValue

Version of MapValue with type safety for Constant.

MaskedValueIsZero

Return true if 'V & Mask' is known to be zero. We use this predicate to simplify operations downstream. Mask is known to be zero for bits that V cannot have.

NullPointerIsDefined

Return whether null pointer dereference is defined for F or address space AS.

PointerMayBeCaptured

Visit a pointer and derived values to find capturing uses.

PointerMayBeCaptured

Return which components of the pointer may be captured.

PointerMayBeCaptured

Return true if this pointer may be captured by the enclosing function.

PointerMayBeCapturedBefore

Return true if this pointer may be captured before a given instruction.

PointerMayBeCapturedBefore

Return which components of the pointer may be captured on the path to I.

RecursivelyDeleteTriviallyDeadInstructions

Recursively delete a trivially dead instruction and its dead operands.

RemapFunction

Remap the operands, metadata, arguments, and instructions of a function.

SplitAllCriticalEdges

Split every critical edge in a function.

SplitBlockAndInsertForEachLane

Invoke a callback once for each lane up to an effective vector length.

SplitBlockAndInsertIfElse

Split a block and insert an else‐branch at an instruction.

SplitBlockAndInsertIfElse

Split a block and insert a conditional else‐branch around the split point.

SplitBlockAndInsertIfThen

Split a block and insert a then‐branch at an instruction.

SplitBlockAndInsertIfThen

Split a block and insert a conditional then‐branch around the split point.

SplitBlockAndInsertIfThenElse

Split a block and insert optional then/else blocks around the split point.

SplitBlockAndInsertIfThenElse

Split a block and insert optional then/else blocks at an instruction.

SplitBlockAndInsertIfThenElse

Split a block and insert both then and else branches around the split point.

SplitBlockAndInsertIfThenElse

Split a block and insert then/else branches at an instruction.

SplitBlockAndInsertSimpleForLoop

Insert a simple counted for‐loop at a split point.

SplitIndirectBrCriticalEdges

Split critical edges leaving an indirectbr when a simple case applies.

StructuralHash

Returns a hash of the function F.

StructuralHashWithDifferences

Computes a structural hash of a function while selectively ignoring operands.

UpgradeCallsToIntrinsic

Upgrade an old intrinsic function and all of its call sites.

UpgradeFunctionAttributes

Correct any IR that is relying on old function attribute behavior.

UpgradeIntrinsicFunction

Check whether an intrinsic function needs upgrading.

WriteDOTGraphToFile

Write a function analysis graph to a DOT file with a custom name prefix.

addAssumptions

Appends the set of assumptions Assumptions to F.

applyProfMetadataIfEnabled

Apply a metadata callback if V is an instruction and profiling is enabled.

assumeBundleImpliesNonNull

Return true if the given assume operand bundle implies that Val is non‐null.

attributesPermitTailCall

Check whether caller/callee attribute mismatches inhibit a tail call.

calculateClrEHStateNumbers

Build WinEHFuncInfo CoreCLR state numbers and unwind‐map tables.

calculateSEHStateNumbers

Build WinEHFuncInfo SEH state numbers and unwind‐map tables.

calculateWinCXXEHStateNumbers

Build WinEHFuncInfo state numbers and tables for __CxxFrameHandler3.

canRenameComdatFunc

Return true if Comdat function F can safely share renamed counters.

canReplacePointersIfEqual

Returns true if pointer From can be replaced with equal pointer To.

canReturn

Return true if there is at least a path through which F can return, false if there is no such path.

canSimplifyInvokeNoUnwind

Return true if invokes of nounwind callees in F may be simplified.

canTrackArgumentsInterprocedurally

Return true if F's argument values can be tracked interprocedurally.

canTrackReturnsInterprocedurally

Return true if F's return values can be tracked interprocedurally.

cannotBeNegativeZero

Return true if we can prove that the specified FP value is never equal to ‐0.0. Users should use caution when considering PreserveSign denormal‐fp‐math.

cannotBeOrderedLessThanZero

Return true if we can prove that the specified FP value is either NaN or never less than ‐0.0.

classifyEHPersonality

See if the given exception handling personality function is one that we understand. If so, return a description of it; otherwise return Unknown.

collectPossibleValues

Enumerate immediate constant values of V into Constants.

colorEHFunclets

Recompute which basic blocks belong to which EH funclets in F.

computeConstantRange

Determine the possible constant range of an integer or vector of integer value. This is intended as a cheap, non‐recursive check.

computeFunctionBodyMemoryAccess

Returns the memory access properties of this copy of the function.

computeKnownBits

Returns the known bits rather than passing by reference.

computeKnownBits

Determine which bits of V are known to be either zero or one and return them in the KnownZero/KnownOne bit sets.

computeKnownBits

Returns the known bits rather than passing by reference.

computeKnownBits

Compute known bits for the demanded elements of V using Q.

computeKnownBits

Compute known bits for V into Known using the simplify query Q.

computeKnownBits

Compute known bits for V using the simplify query Q.

computeKnownBitsFromContext

Merge bits known from context‐dependent facts into Known.

computeKnownFPClass

Wrapper to account for known fast math flags at the use instruction.

computeKnownFPClass

Determine known floating‐point classes for V.

computeKnownFPClass

Wrapper to account for known fast math flags at the use instruction.

computeKnownFPClass

Determine which floating‐point classes are valid for V, and return them in KnownFPClass bit sets.

computeKnownFPClass

Determine known floating‐point classes for V using explicit analysis context.

computeKnownFPSignBit

Return the known sign bit of a floating‐point value, if provable.

computeOverflowForSignedMul

Compute whether a signed multiply of LHS and RHS can overflow.

computeOverflowForSignedSub

Compute whether a signed subtract of LHS and RHS can overflow.

computeOverflowForUnsignedMul

Compute whether an unsigned multiply of LHS and RHS can overflow.

computeOverflowForUnsignedSub

Compute whether an unsigned subtract of LHS and RHS can overflow.

convertToDeclaration

Converts value GV to declaration, or replaces with a declaration if it is an alias.

createPGOFuncNameMetadata

Create PGOFuncName metadata when it differs from F's raw name.

createPGOFuncNameVar

Create the global variable that stores F's PGO function name.

createPGONameMetadata

Create PGOName metadata when it differs from GO's mangled name.

createSanitizerCtor

Creates sanitizer constructor function.

createSanitizerCtorAndInitFunctions

Creates sanitizer constructor function, and calls sanitizer's init function from it.

decomposeBitTest

Decompose an icmp into the form ((X & Mask) pred C) if possible.

decomposeBitTestICmp

Decompose an icmp into the form ((X & Mask) pred C) if possible.

emitBCmp

Emit a call to the bcmp function.

emitBinaryFloatFnCall

Emit a call to the binary floating‐point libcall named Name.

emitBinaryFloatFnCall

Emit a call to the binary DoubleFn, FloatFn, or LongDoubleFn for Op1's type.

emitCalloc

Emit a call to the calloc function.

emitFPutC

Emit a call to fputc with an int Char and a FILE pointer.

emitFPutS

Emit a call to fputs with a string pointer and a FILE pointer.

emitFWrite

Emit a call to fwrite with a pointer, size_t Size, and FILE pointer.

emitHotColdNew

Emit a call to the hot/cold operator new function.

emitHotColdNewAligned

Emit a call to the hot/cold aligned operator new function.

emitHotColdNewAlignedNoThrow

Emit a call to the hot/cold aligned nothrow operator new function.

emitHotColdNewNoThrow

Emit a call to the hot/cold nothrow operator new function.

emitHotColdSizeReturningNew

Emit a call to the hot/cold size‐returning operator new function.

emitHotColdSizeReturningNewAligned

Emit a call to the hot/cold size‐returning aligned operator new function.

emitMalloc

Emit a call to the malloc function.

emitMemCCpy

Emit a call to the memccpy function.

emitMemChr

Emit a call to memchr with a pointer, int Val, and size_t Len.

emitMemCmp

Emit a call to the memcmp function.

emitMemCpyChk

Emit a call to __memcpy_chk with size_t Len/ObjSize and pointer Dst/Src.

emitMemPCpy

Emit a call to the mempcpy function.

emitMemRChr

Emit a call to the memrchr function, analogously to emitMemChr.

emitPutChar

Emit a call to putchar, assuming Char is an int.

emitPutS

Emit a call to puts, assuming Str is some pointer.

emitSNPrintf

Emit a call to the snprintf function.

emitSPrintf

Emit a call to the sprintf function.

emitStpCpy

Emit a call to stpcpy for the specified pointer arguments.

emitStpNCpy

Emit a call to stpncpy for the specified pointer arguments and length.

emitStrCat

Emit a call to the strcat function.

emitStrChr

Emit a call to strchr for the specified pointer and character.

emitStrCpy

Emit a call to strcpy for the specified pointer arguments.

emitStrDup

Emit a call to strdup for the specified pointer.

emitStrLCat

Emit a call to the strlcat function.

emitStrLCpy

Emit a call to the strlcpy function.

emitStrLen

Emit a call to strlen for the specified pointer.

emitStrNCat

Emit a call to the strncat function.

emitStrNCmp

Emit a call to the strncmp function to the builder.

emitStrNCpy

Emit a call to strncpy for the specified pointer arguments and length.

emitUnaryFloatFnCall

Emit a call to the unary DoubleFn, FloatFn, or LongDoubleFn for Op's type.

emitUnaryFloatFnCall

Emit a call to the unary floating‐point libcall named Name.

emitVSNPrintf

Emit a call to the vsnprintf function.

emitVSPrintf

Emit a call to the vsprintf function.

emitWcsLen

Emit a call to wcslen for the specified pointer.

extractWidenableCondition

Returns the widenable condition in U's expression tree, if uniquely used.

findAllocaForValue

Const overload of findAllocaForValue.

findAllocaForValue

Returns unique alloca where the value comes from, or nullptr. If OffsetZero is true check that V points to the begining of the alloca.

findDVRDeclareValues

As above, for DVRDeclareValues.

findDVRDeclares

Finds dbg.declare records declaring local variables as living in the memory that 'V' points to.

findDVRValues

As above, for DVRValues.

findDbgUsers

Finds the debug info records describing a value.

findDbgValues

Finds the dbg.values describing a value.

findIndirectCalls

Return all indirect call sites in function F.

findScalarElement

Given a vector and an element number, see if the scalar value is already around as a register, for example if it were inserted then extracted from the vector.

findVTableAddrs

Return vtable address instructions feeding indirect calls in F.

findValuesAffectedByCondition

Call InsertAffected on all Values whose known bits / value may be affected by the condition Cond. Used by AssumptionCache and DomConditionCache.

gep_type_begin

Return a begin iterator over the types indexed by GEP GEP.

gep_type_begin

Return a begin iterator over the types indexed by GEP GEP.

gep_type_end

Return the end iterator for types indexed by GEP GEP.

gep_type_end

Return the end iterator for types indexed by GEP GEP.

getAllocationFamily

If a function is part of an allocation family (e.g. malloc/realloc/calloc/free), return the identifier for its family of functions.

getAssumptions

Return the set of all assumptions for the function F.

getBaseObjectSize

Like getObjectSize(), but only for base objects.

getConstantDataArrayInfo

Returns true if the value V is a pointer into a ConstantDataArray. If successful Slice will point to a ConstantDataArray info object with an appropriate offset.

getConstantStringInfo

Compute the contents of a null‐terminated C string pointed to by V.

getExplicitlyUnknownBranchWeightsIfProfiled

Returns a metadata node containing unknown branch weights if the function has an entry count, otherwise returns nullptr.

getFunctionAtVTableOffset

Return the function and pointer at a vtable offset, if they refer to a function.

getIRPGOFuncName

Return the IRPGO profile lookup name for function F.

getInitialValueOfAllocation

If this is a call to an allocation function that initializes memory to a fixed value, return said value in the requested type. Otherwise, return nullptr.

getKnowledgeForValue

Return a valid Knowledge associated to the Value V if its Attribute kind is in AttrKinds and it matches the Filter.

getKnowledgeValidInContext

Return a valid Knowledge associated to the Value V if its Attribute kind is in AttrKinds and the knowledge is suitable to be used in the context of CtxI.

getKnownAlignment

Infer a known alignment for the specified pointer.

getLoadStoreAddressSpace

Return the address space of the pointer operand of load or store I.

getLoadStoreAlignment

Return the alignment of load or store instruction I.

getLoadStorePointerOperand

Return the pointer operand of a load or store, or null if V is neither.

getLoadStorePointerOperand

Return the pointer operand of a load or store, or null if V is neither.

getLoadStoreType

Return the value type accessed by load or store instruction I.

getLosslessInvCast

Try to cast C to InvC losslessly, satisfying CastOp(InvC) equals C, or CastOp(InvC) is a refined value of undefined C. Will try best to preserve the flags.

getLosslessSignedTrunc

Compute a lossless inverse of a signed extend (sext) of C.

getLosslessUnsignedTrunc

Compute a lossless inverse of an unsigned extend (zext) of C.

getMaxFreq

Return the maximum frequency of a basic block in a function.

getNumOfCalls

Return the number of calls of CalledFunction by CallerFunction.

getObjectSize

Compute the size of the object pointed by Ptr.

getOrCreateFunctionComdat

Return F's comdat, creating and attaching one when missing.

getOrCreateSanitizerCtorAndInitFunctions

Creates sanitizer constructor and init functions lazily.

getOrEnforceKnownAlignment

Return a known alignment for a value, optionally raising it first.

getPGOFuncName

Return a front‐end PGO lookup name for function F.

getPGOFuncNameMetadata

Return the PGOFuncName metadata node associated with function F.

getPointerAtOffset

Find a trivial pointer located at a byte offset within a constant.

getPointerOperand

Return the pointer operand of a load, store, or GEP, or null otherwise.

getPointerOperand

Non‐const overload of getPointerOperand.

getSplatValue

Get splat value if the input is a splat vector or return nullptr.

getUnderlyingObject

Strip GEP adjustments, pointer casts, and threadlocal.address from V.

getUnderlyingObject

Non‐const overload of getUnderlyingObject.

getUnderlyingObjectAggressive

Like getUnderlyingObject(), but will try harder to find a single underlying object. In particular, this function also looks through selects and phis.

getUnderlyingObjects

This method is similar to getUnderlyingObject except that it can look through phi and select instructions and return multiple objects.

getUnderlyingObjectsForCodeGen

This is a wrapper around getUnderlyingObjects and adds support for basic ptrtoint+arithmetic+inttoptr sequences.

getVScaleRange

Determine the possible constant range of vscale with the given bit width, based on the vscale_range function attribute.

hasAssumption

Return true if F has the assumption AssumptionStr attached.

impliesPoison

Return true if V is poison given that ValAssumedPoison is already poison.

inferAttributesFromOthers

Materialize attributes that can be inferred from others on a function.

inferNonMandatoryLibFuncAttrs

Infer and set non‐mandatory attributes on an existing function.

inst_begin

Return an iterator to the first instruction in F.

inst_begin

Return an iterator to the first instruction in F.

inst_begin

Return a const iterator to the first instruction in F.

inst_begin

Return a const iterator to the first instruction in F.

inst_end

Return the end iterator for instructions in F.

inst_end

Return the end iterator for instructions in F.

inst_end

Return the const end iterator for instructions in F.

inst_end

Return the const end iterator for instructions in F.

instructions

Return a range over all instructions in F.

instructions

Return a range over all instructions in F.

instructions

Return a const range over all instructions in F.

instructions

Return a const range over all instructions in F.

invertCondition

Invert a boolean condition, reusing an existing inverted copy when possible.

isAllocLikeFn

Tests if a value is a call or invoke to a library function that allocates memory (either malloc, calloc, or strdup like).

isAllocationFn

Tests if a value is a call or invoke to a library function that allocates or reallocates memory (either malloc, calloc, realloc, or strdup like).

isAllocationFn

Tests if a value is a call or invoke to a library function that allocates or reallocates memory (either malloc, calloc, realloc, or strdup like).

isBaseOfObject

Return true if V is known to be the base of its memory object.

isBytewiseValue

If the specified value can be set by repeating the same byte in memory, return the i8 value that it is represented with.

isCFGuardFunction

Return true if GV is a Control Flow Guard runtime function.

isCheckForZeroAndMulWithOverflow

Return true if Op0 and Op1 match a zero check with mul‐with‐overflow.

isCheckForZeroAndMulWithOverflow

Return true if Op0 and Op1 match a zero check with mul‐with‐overflow.

isConsecutiveAccess

Returns true if the memory operations A and B are consecutive. This is a simple API that does not depend on the analysis pass.

isDereferenceableAndAlignedPointer

Returns true if V is always a dereferenceable pointer with sufficient alignment.

isDereferenceableAndAlignedPointer

Returns true if V is always dereferenceable for Size bytes with sufficient alignment.

isDereferenceablePointer

Equivalent to isDereferenceableAndAlignedPointer with an alignment of 1.

isDereferenceablePointer

Equivalent to isDereferenceableAndAlignedPointer with an alignment of 1.

isEscapeSource

Returns true if the pointer is one which would have been considered an escape by isNotCapturedBefore.

isGuaranteedNotToBePoison

Iterator‐context overload of isGuaranteedNotToBePoison.

isGuaranteedNotToBePoison

Returns true if V cannot be poison, but may be undef.

isGuaranteedNotToBeUndef

Returns true if V cannot be undef, but may be poison.

isGuaranteedNotToBeUndefOrPoison

Return true if this function can prove that V does not have undef bits and is never poison.

isGuard

Returns true iff U has semantics of a guard expressed in a form of call of llvm.experimental.guard intrinsic.

isGuardAsWidenableBranch

Returns true iff U has semantics of a guard expressed in a form of a widenable conditional branch to deopt block.

isIdentifiedFunctionLocal

Return true if V is unambiguously identified at the function level.

isIdentifiedObject

Return true if this pointer refers to a distinct and identifiable object.

isImpliedByDomCondition

Return the boolean condition value in the context of the given instruction if it is known based on dominating conditions.

isImpliedCondition

Return whether a compare is implied true or false by LHS, if known.

isImpliedCondition

Return whether RHS is implied true or false by LHS, if known.

isInlineViable

Check if it is mechanically possible to inline the function Callee, based on the contents of the function.

isKnownIntegral

Return true if the floating‐point value V is known to be an integer value.

isKnownInversion

Return true iff: 1. X is poison implies Y is poison. 2. X is true implies Y is false. 3. X is false implies Y is true. Otherwise, return false.

isKnownNegation

Return true if the two given values are negation.

isKnownNegative

Returns true if the given value is known be negative (i.e. non‐positive and non‐zero).

isKnownNeverInfOrNaN

Return true if the floating‐point value can never contain a NaN or infinity.

isKnownNeverInfinity

Return true if the floating‐point scalar value is not an infinity or if the floating‐point vector value has no infinities.

isKnownNeverNaN

Return true if the floating‐point scalar value is not a NaN or if the floating‐point vector value has no NaN elements.

isKnownNonEqual

Return true if the given values are known to be non‐equal when defined. Supports scalar integer types only.

isKnownNonNegative

Returns true if the give value is known to be non‐negative.

isKnownNonZero

Return true if the given value is known to be non‐zero when defined.

isKnownPositive

Returns true if the given value is known be positive (i.e. non‐negative and non‐zero).

isKnownToBeAPowerOfTwo

Return true if the given value is known to have exactly one bit set when defined.

isKnownToBeAPowerOfTwo

Return true if V is known to be a power of two when defined.

isLibFreeFunction

isLibFreeFunction ‐ Returns true if the function is a builtin free()

isNoAliasCall

Return true if this pointer is returned by a noalias function.

isNotVisibleOnUnwind

Return true if Object memory is not visible after an unwind.

isReallocLikeFn

Tests if a function is a call or invoke to a library function that reallocates memory (e.g., realloc).

isSafeToDestroyConstant

Return true if it is safe to destroy constant C.

isSafeToLoadUnconditionally

Return true if we know that executing a load from this value cannot trap.

isSafeToLoadUnconditionally

Return true if we know that executing a load from this value cannot trap.

isSplatValue

Return true if each element of V is poisoned or equal to the others.

isWidenableBranch

Returns true iff U is a widenable branch (that is, extractWidenableCondition returns widenable condition).

isWidenableCondition

Returns true iff V has semantics of llvm.experimental.widenable.condition call.

isWritableObject

Return true if Object is writable without trapping.

lintFunction

Lint a function.

lowerConstantIntrinsics

Lower remaining objectsize and is.constant intrinsic calls in a function.

makeGuardControlFlowExplicit

Splits control flow at Guard into an explicit branch with a deopt path.

markRegisterParameterAttributes

Apply ‐mregparm‐style register parameter attributes to a function.

maskContainsAllOneOrUndef

Return true if any lane of an i1 mask is known true or undef.

matchSelectPattern

Const overload of matchSelectPattern.

matchSelectPattern

Pattern match integer [SU]MIN, [SU]MAX and ABS idioms, returning the kind and providing the out parameter results if we successfully match.

mayContainIrreducibleControl

Return true if F may contain irreducible control flow.

needsComdatForCounter

Return true if profile counters for GV should use Comdat.

onlyUsedByLifetimeMarkers

Return true if the only users of this pointer are lifetime markers.

onlyUsedByLifetimeMarkersOrDroppableInsts

Return true if the only users of this pointer are lifetime markers or droppable instructions.

parseWidenableBranch

Parses a widenable branch and returns Uses so they can be modified.

parseWidenableBranch

Parses a widenable branch and returns its condition, widenable condition, and successor blocks.

parseWidenableGuard

Collects the individual checks from a widenable guard's condition.

possiblyDemandedEltsInMask

Return an APInt of active lanes for a <Y x i1> mask.

printGraphForFunction

Write an analysis graph for a function to a DOT file.

propagateIRFlags

Intersect IR flags from scalar ops VL onto vector op I.

removeASanIncompatibleFnAttributes

Remove memory attributes incompatible with ASan/HWASan instrumentation.

removeUnreachableBlocks

Remove blocks unreachable from a function's entry.

replaceDbgDeclare

Replace a dbg.declare when its address is replaced.

replaceDominatedUsesWith

Replace uses dominated by an edge with another value.

replaceDominatedUsesWith

Replace uses dominated by an instruction with another value.

replaceDominatedUsesWith

Replace uses dominated by a block's end with another value.

replaceDominatedUsesWithIf

Conditionally replace uses dominated by an instruction with another value.

replaceDominatedUsesWithIf

Conditionally replace uses dominated by a block's end with another value.

replaceDominatedUsesWithIf

Conditionally replace uses dominated by an edge with another value.

replaceRelativePointerUsersWithZero

Finds the same "relative pointer" pattern as described above, where the target is C, and replaces the entire pattern with a constant zero.

returnTypeIsEligibleForTailCall

Test if given that the input instruction is in the tail call position if the return type or any attributes of the function will inhibit tail call optimization.

setExplicitlyUnknownFunctionEntryCount

Analogous to setExplicitlyUnknownBranchWeights, but for functions and their entry counts.

setLoadStoreAlignment

Set the alignment of load or store instruction I.

shouldOptimizeForSize

Returns true if function F is suggested to be size‐optimized based on the profile.

simplifyAShrInst

Given operands for a AShr, fold the result or return nulll.

simplifyAddInst

Given operands for an Add, fold the result or return null.

simplifyAndInst

Given operands for an And, fold the result or return null.

simplifyExtractElementInst

Given operands for an ExtractElementInst, fold the result or return null.

simplifyExtractValueInst

Given operands for an ExtractValueInst, fold the result or return null.

simplifyFAddInst

Given operands for an FAdd, fold the result or return null.

simplifyFDivInst

Given operands for an FDiv, fold the result or return null.

simplifyFMAFMul

Given operands for the multiplication of a FMA, fold the result or return null.

simplifyFMulInst

Given operands for an FMul, fold the result or return null.

simplifyFNegInst

Given operand for an FNeg, fold the result or return null.

simplifyFRemInst

Given operands for an FRem, fold the result or return null.

simplifyFSubInst

Given operands for an FSub, fold the result or return null.

simplifyFreezeInst

Given an operand for a Freeze, see if we can fold the result.

simplifyInsertElementInst

Given operands for an InsertElement, fold the result or return null.

simplifyInsertValueInst

Given operands for an InsertValueInst, fold the result or return null.

simplifyLShrInst

Given operands for a LShr, fold the result or return null.

simplifyMulInst

Given operands for a Mul, fold the result or return null.

simplifyOrInst

Given operands for an Or, fold the result or return null.

simplifySDivInst

Given operands for an SDiv, fold the result or return null.

simplifySRemInst

Given operands for an SRem, fold the result or return null.

simplifySelectInst

Given operands for a SelectInst, fold the result or return null.

simplifyShlInst

Given operands for a Shl, fold the result or return null.

simplifyShuffleVectorInst

Given operands for a ShuffleVectorInst, fold the result or return null.

simplifySubInst

Given operands for a Sub, fold the result or return null.

simplifyUDivInst

Given operands for a UDiv, fold the result or return null.

simplifyURemInst

Given operands for a URem, fold the result or return null.

simplifyWithOpReplaced

See if V simplifies when its operand Op is replaced with RepOp.

simplifyXorInst

Given operands for an Xor, fold the result or return null.

stripDebugInfo

Strip debug info from a single function.

stripNullTest

Const overload of stripNullTest.

stripNullTest

Returns the inner value X if the expression has the form f(X) where f(X) == 0 if and only if X == 0, otherwise returns nullptr.

tryEnforceAlignment

Try to raise a controlled object's alignment to a preferred value.

updateProfileCallee

Update callee profile counts after cloning or inlining.

verifyFunction

Check a function for errors, useful for use when debugging a pass.

verifySafepointIR

Run the safepoint verifier over a single function. Crashes on failure.

viewGraphForFunction

Open a Graphviz viewer for a function's analysis graph.

viewRegion

Analyze the regions of a function and open its GraphViz visualization in a viewer.

viewRegionOnly

Analyze the regions of a function and open its GraphViz visualization in a viewer.

wrap

Wrap an array of Value pointers as opaque LLVMValueRef values.

wrap

Convert a Value pointer to an opaque LLVMValueRef.

AA::getWithType

Try to convert V to type Ty without introducing new instructions.

AA::isValidInScope

Return true if V is a valid value in Scope, that is a constant or an instruction/argument of Scope.

AttributeFuncs::areInlineCompatible

Return true if Caller and Callee have compatible attributes for inlining.

AttributeFuncs::areOutlineCompatible

Checks if there are any incompatible function attributes between A and B.

AttributeFuncs::isStrictFPInlineCompatible

Return true unless Callee is strictfp while Caller is not.

AttributeFuncs::mergeAttributesForInlining

Merge caller's and callee's attributes.

AttributeFuncs::mergeAttributesForOutlining

Merges the functions attributes from ToMerge into function Base.

AttributeFuncs::updateMinLegalVectorWidthAttr

Update min‐legal‐vector‐width if it is in Attribute and less than Width.

Intrinsic::getDeclarationIfExists

This version supports overloaded intrinsics.

Intrinsic::getDeclarationIfExists

Look up the Function declaration of intrinsic id if it exists.

Intrinsic::getOrInsertDeclaration

Look up or insert the Function declaration for intrinsic id in M.

Intrinsic::getOrInsertDeclaration

Look up or insert the Function declaration for intrinsic IID in M.

Intrinsic::isSignatureValid

Same as previous, but accepts a Function instead of ID and FunctionType.

Intrinsic::remangleIntrinsicFunction

Remangle an intrinsic if its name does not match its signature.

PatternMatch::m_CheckedFp

Match a float or vector where CheckFn(ele) is true, binding the constant. For vectors, poison elements are assumed to match.

PatternMatch::m_CheckedInt

Match an integer or vector where CheckFn(ele) is true, binding the constant. For vectors, poison elements are assumed to match.

PatternMatch::m_Constant

Match a Constant, capturing the value if we match.

PatternMatch::m_Deferred

Match a deferred const Value* determined later in the same match expression.

PatternMatch::m_Deferred

Match a deferred Value* determined later in the same match expression.

PatternMatch::m_ImmConstant

Match an immediate Constant, capturing the value if we match.

PatternMatch::m_Specific

Match if we have a specific specified value.

PatternMatch::m_Value

Match against the nested pattern, and capture the value if we match.

PatternMatch::m_Value

Match a const value, capturing it if we match.

PatternMatch::m_Value

Match against the nested pattern, and capture the value if we match.

PatternMatch::m_Value

Match a value, capturing it if we match.

VNCoercion::canCoerceMustAliasedValueToLoad

Return true if CoerceAvailableValueToLoadType would succeed if it was called.

VNCoercion::coerceAvailableValueToLoadType

Try to coerce a stored value to a must‐aliased load of a different type.

VNCoercion::getConstantValueForLoad

Extract a constant load value from a constant store or load at an offset.

VNCoercion::getValueForLoad

Extract bits for a load from a clobbering store or load at a given offset.

at::deleteAll

Remove all Assignment Tracking related intrinsics and metadata from F.

codegen::setFunctionAttributes

Set function attributes of function F based on CPU, TuneCPU, Features, and command line flags.

coro::doRematerializations

Rematerialize instructions across suspend points instead of spilling them.

instrumentor::evaluateFilter

Evaluate a filter expression for an instrumentation opportunity.

lowertypetests::isJumpTableCanonical

Return true if F should use a canonical jump table.

objcarc::GetARCInstKind

Map V to its ARCInstKind equivalence class.

objcarc::GetArgRCIdentityRoot

Assuming the given instruction is one of the special calls such as objc_retain or objc_release, return the RCIdentity root of the argument of the call.

objcarc::GetBasicARCInstKind

Determine which objc runtime call instruction class V belongs to.

objcarc::GetFunctionClass

Determine if F is one of the special known Functions. If it isn't, return ARCInstKind::CallOrUser.

objcarc::GetRCIdentityRoot

Return the RCIdentity root of value V.

objcarc::GetRCIdentityRoot

Return the non‐const RCIdentity root of value V.

objcarc::GetUnderlyingObjCPtr

Return the underlying ObjC object pointer for V.

objcarc::GetUnderlyingObjCPtrCached

A wrapper for GetUnderlyingObjCPtr used for results memoization.

objcarc::IsNullOrUndef

Return true if V is a null pointer constant or undef.

objcarc::IsObjCIdentifiedObject

Return true if this value refers to a distinct and identifiable object.

objcarc::IsPotentialRetainableObjPtr

Test whether Op may be a retainable object pointer using alias analysis.

objcarc::IsPotentialRetainableObjPtr

Test whether the given value is possible a retainable object pointer.

objcarc::getAttachedARCFunction

Return the ARC runtime function from a clang_arc_attachedcall bundle.

omp::isOpenMPKernel

Return true iff Fn is an OpenMP GPU kernel; Fn has the "kernel" attribute.

orc::cloneFunctionDecl

Clone a function declaration into a new module.

orc::makeStub

Turn a function declaration into a stub function that makes an indirect call using the given function pointer.

Created with MrDocs