Representation of machine code for a single LLVM IR function.

Synopsis

Declared in <llvm/CodeGen/MachineFunction.h>

class MachineFunction;

Types

Name

Description

ArgRegPair

Argument number paired with the register used to pass it after lowering.

CallSiteInfo

Extra call‐site metadata for argument forwarding and call‐graph types.

CalledGlobalInfo

Global callee and target flags for a call instruction.

DebugPHIRegallocPos

PHI location that is also a debug‐info variable value during regalloc.

DebugSubstitution

Remaps a debug instruction‐reference from one def to another.

Delegate

Callback interface notified when instructions are inserted or removed.

VariableDbgInfo

Fixed location of a variable that does not change during execution.

Type Aliases

Name

Description

CallSiteInfoMap

Map from call instructions to their additional call‐site info.

DebugInstrOperandPair

Pair of instruction number and operand number.

OperandCapacity

Capacity token used when allocating recycled MachineOperand arrays.

VariableDbgInfoMapTy

Collection type for unchanging variable debug locations.

const_iterator

Const iterator over the machine basic blocks in this function.

const_reverse_iterator

Const reverse iterator over the machine basic block list.

iterator

Iterator over the machine basic blocks in this function.

reverse_iterator

Reverse iterator over the machine basic blocks in this function.

Member Functions

Name

Description

MachineFunction [constructor]

Constructors

~MachineFunction [destructor]

Destroy the MachineFunction and its owned machine IR.

operator= [deleted]

MachineFunctions are not assignable.

CloneMachineInstr

Create a new MachineInstr which is a copy of Orig, identical in all ways except the instruction has no parent, prev, or next. Bundling flags are reset.

CreateMachineBasicBlock

Allocate a new MachineBasicBlock (prefer this over new).

CreateMachineInstr

Allocate a new MachineInstr (prefer this over new MachineInstr).

RenumberBlocks

Discard and recompute MachineBasicBlock numbers for this function.

addCallSiteInfo

Start tracking the arguments passed to the call CallI.

addCalledGlobal

Notes the global and target flags for a call site.

addCodeViewAnnotation

Record annotations associated with a particular label.

addEHContTarget

Add the specified symbol to the list of targets for Windows EH Continuation Guard.

addFrameInst

Append frame CFI instruction Inst and return its index.

addInvoke

Provide the begin and end labels of an invoke style call and associate it with a try landing pad block.

addLandingPad

Add a new landing pad and extract EH info from its landingpad instruction.

addLiveIn

Add physical register PReg as a live‐in and create a matching vreg.

addLongjmpTarget

Add the specified symbol to the list of valid longjmp targets for Windows Control Flow Guard.

addToMBBNumbering

Adds the MBB to the internal numbering. Returns the unique number assigned to the MBB.

allocateOperandArray

Allocate an array of MachineOperands. This is only intended for use by internal MachineInstr functions.

allocateRegMask

Allocate and initialize a register mask with NumRegister bits.

allocateShuffleMask

Allocate a copy of shuffle mask Mask owned by this function.

assignAnalysisNumber

Assign and return the next analysis block number.

assignBeginEndSections

Assign IsBeginSection IsEndSection fields for basic blocks in this function.

back

back overloads

begin

begin overloads

callsEHReturn

Return true if this function contains a call to eh_return.

callsUnwindInit

Return true if this function contains a call to _Unwind_Init.

cloneInfo

Clone target‐specific info Old into this function and return it.

cloneInfoFrom

Clone MachineFunctionInfo from OrigMF, remapping blocks via Src2DstMBB.

cloneMachineInstrBundle

Clones instruction or the whole instruction bundle Orig and insert into MBB before InsertBefore.

copyAdditionalCallInfo

Copy call‐site info from Old to New for a duplicated call.

createExternalSymbolName

Allocate a string and populate it with the given external symbol name.

createMIExtraInfo

Allocate and construct an extra info structure for a MachineInstr.

deallocateOperandArray

Deallocate an array of MachineOperands and recycle the memory.

deleteMachineBasicBlock

Delete the given MachineBasicBlock.

deleteMachineInstr

Delete the given MachineInstr.

dump

dump ‐ Print the current MachineFunction to cerr, useful for debugger use.

empty

Return true if this function has no basic blocks.

end

end overloads

ensureAlignment

Ensure the function is at least A bytes aligned.

erase

erase overloads

eraseAdditionalCallInfo

Erase the call site info for call instruction MI.

estimateFunctionSizeInBytes

Return an estimate of the function's code size, taking into account block and function alignment

exposesReturnsTwice

Return true if this function calls a "returns twice" function.

finalizeDebugInstrRefs

Finalize partially emitted DBG_INSTR_REF debug instructions.

front

front overloads

getAlignment

getAlignment ‐ Return the alignment of the function.

getAnalysisBlockNumberEpoch

Return the numbering "epoch" of analysis block numbers.

getBlockNumbered

Return the MachineBasicBlock with block number N.

getCallSiteBeginLabel

Get the call site number for a begin label.

getCallSiteLandingPad

Get the call site indexes for a landing pad EH symbol.

getCallSitesInfo

Return the map from call instructions to their call‐site info.

getCalledGlobals

Iterates over the full set of call sites and their associated globals.

getCodeViewAnnotations

Return the CodeView label annotations recorded for this function.

getConstantPool

getConstantPool overloads

getContext

Return the MCContext used by this machine function.

getDataLayout

Return the DataLayout attached to the Module associated to this MF.

getDenormalMode

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

getEHContTargets

Returns a reference to a list of symbols that are targets for Windows EH Continuation Guard.

getEntryValueVariableDbgInfo

Returns the collection of variables for which we have debug info and that have been assigned an entry value register.

getFilterIDFor

Return the id of the filter encoded by TyIds. This is function wide.

getFilterIds

Return a reference to the typeids encoding filters used in the current function.

getFrameInfo

getFrameInfo overloads

getFrameInstructions

Returns a reference to a list of cfi instructions in the function's prologue. Used to construct frame maps for debug and exception handling comsumers.

getFunction

Return the LLVM function that this machine code represents

getFunctionNumber

getFunctionNumber ‐ Return a unique ID for the current function.

getInStackSlotVariableDbgInfo

Returns the collection of variables for which we have debug info and that have been assigned a stack slot.

getInfo

getInfo overloads

getInstructionCount

Return the number of MachineInstrs in this MachineFunction.

getJTISymbol

Return the MCSymbol for the specified non‐empty jump table.

getJumpTableInfo

getJumpTableInfo overloads

getLandingPads

Return a reference to the landing pad info for the current function.

getLongjmpTargets

Return symbols immediately following calls to _setjmp in this function.

getMachineMemOperand

getMachineMemOperand overloads

getMaxAnalysisBlockNumber

Return one past the highest analysis block number assigned so far.

getName

getName ‐ Return the name of the corresponding LLVM function.

getNewDebugInstrNum

Return the next instruction number for debug value tracking.

getNumBlockIDs

getNumBlockIDs ‐ Return the number of MBB ID's allocated.

getObserver

Return the currently installed GlobalISel change observer.

getOrCreateJumpTableInfo

Return existing jump‐table info, or allocate one for JTEntryKind.

getOrCreateLandingPadInfo

Find or create an LandingPadInfo for the specified MachineBasicBlock.

getPICBaseSymbol

getPICBaseSymbol ‐ Return a function‐local symbol to represent the PIC base.

getPSVManager

Return the PseudoSourceValueManager for this function.

getPreferredAlignment

Returns the preferred alignment which comes from the function attributes (optsize, minsize, prefalign) and TargetLowering.

getPrefetchTargets

Return the map of basic‐block IDs to prefetch callsite indexes.

getProperties

getProperties overloads

getRegInfo

getRegInfo overloads

getSection

Returns the Section this function belongs to.

getSubtarget

getSubtarget overloads

getTarget

getTarget ‐ Return the target machine this machine code is compiled with

getTypeIDFor

Return the type id for the specified typeinfo. This is function wide.

getTypeInfos

Return a reference to the C++ typeinfo for the current function.

getVariableDbgInfo

getVariableDbgInfo overloads

getWasmLandingPadIndex

Get the index in wasm EH for a given landing pad.

getWinEHFuncInfo

getWinEHFuncInfo overloads

handleChangeDesc

Notify delegates that MI is changing its MCInstrDesc to TID.

hasAnyCallSiteLabel

Return true if any call site begin label has been recorded for EH.

hasAnyCallSiteLandingPad

Return true if any landing‐pad EH symbol has call‐site indexes recorded.

hasAnyWasmLandingPadIndex

Return if there is any wasm exception handling.

hasBBSections

Returns true if this function has basic block sections enabled.

hasCallSiteBeginLabel

Return true if the begin label has a call site number associated with it.

hasCallSiteLandingPad

Return true if the landing pad Eh symbol has an associated call site.

hasEHContTarget

Return true if this function has a Windows EH Continuation Guard target.

hasEHFunclets

Return true if this function uses EH funclets.

hasEHScopes

Return true if this function uses EH scopes.

hasFakeUses

Return true if this function contains FAKE_USE instructions.

hasInlineAsm

Returns true if the function contains any inline assembly.

hasWasmLandingPadIndex

Returns true if the landing pad has an associate index in wasm EH.

hasWinCFI

Returns true if the function contains Windows CFI instructions.

initTargetMachineFunctionInfo

Initialize the target‐specific MachineFunctionInfo for STI.

insert

Insert MBB into the block list immediately before MBBI.

isOutlined

Return true if this function was created by the machine outliner.

makeDebugValueSubstitution

Create a substitution from one instruction/operand value to another.

moveAdditionalCallInfo

Move call‐site info from Old to New when replacing a call.

needsFrameMoves

True if this function needs frame moves for debug or exceptions.

print

Print this MachineFunction to OS for debugging.

push_back

Append basic block MBB to the end of this function.

push_front

Insert basic block MBB at the beginning of this function.

rbegin

rbegin overloads

remove

remove overloads

removeFromMBBNumbering

Remove basic‐block number N from the internal numbering tracker.

rend

rend overloads

replaceFrameInstRegister

Replace all references to register

reset

Reset the instance as if it was just created.

resetDelegate

Reset the currently registered delegate ‐ otherwise assert.

salvageCopySSA

Find the underlying defining instruction/operand for a COPY in SSA form.

salvageCopySSAImpl

Implementation helper for salvageCopySSA.

setAlignment

Set the alignment of the function.

setBBSectionsType

Set the basic‐block sections policy for this function.

setCallSiteBeginLabel

Map the begin label for a call site.

setCallSiteLandingPad

Map the landing pad's EH symbol to the call site indexes.

setCallsEHReturn

Set whether this function contains a call to eh_return.

setCallsUnwindInit

Set whether this function contains a call to _Unwind_Init.

setDebugInstrNumberingCount

Set value of DebugInstrNumberingCount field. Avoid using this unless you're deserializing this data.

setDelegate

Set the delegate. resetDelegate must be called before attempting to set.

setExposesReturnsTwice

Set whether this function exposes a call to a "returns twice" function.

setHasEHContTarget

Set whether this function has a Windows EH Continuation Guard target.

setHasEHFunclets

Set whether this function uses EH funclets.

setHasEHScopes

Set whether this function uses EH scopes.

setHasFakeUses

Set whether this function contains FAKE_USE instructions.

setHasInlineAsm

Set a flag that indicates that the function contains inline assembly.

setHasWinCFI

Set whether any Windows CFI instructions have been emitted in this function.

setIsOutlined

Mark whether this function was created by the machine outliner.

setObserver

Install GlobalISel change observer O.

setPrefetchTargets

Set the map of basic‐block IDs to prefetch callsite indexes.

setSection

Indicates the Section this function belongs to.

setUseDebugInstrRef

Set whether this function will use instruction referencing or not.

setVariableDbgInfo

setVariableDbgInfo overloads

setWasmLandingPadIndex

Map the landing pad to its index. Used for Wasm exception handling.

shouldSplitStack

Should we be emitting segmented stack stuff for the function

shouldUseDebugInstrRef

Determine whether, in the current machine configuration, we should use instruction referencing or not.

size

Return the number of machine basic blocks in this function.

sort

Sort the basic blocks in this function using comparator comp.

splice

splice overloads

substituteDebugValuesForInst

Retarget tracked debug values from Old to equivalent defs in New.

tryGetCalledGlobal

Tries to get the global and target flags for a call site, if the instruction is a call to a global.

useDebugInstrRef

Returns true if the function's variable locations are tracked with instruction referencing.

verify

verify overloads

viewCFG

Display this function's CFG in a debugger graph viewer.

viewCFGOnly

Display this function's CFG labels without basic‐block contents.

Static Member Functions

Name

Description

getSublistAccess

Return the pointer‐to‐member used by MachineBasicBlock::getNextNode().

Data Members

Name

Description

DebugInstrNumberingCount

A count of how many instructions in the function have had numbers assigned to them. Used for debug value tracking, to determine the next instruction number.

DebugPHIPositions

Map of debug instruction numbers to the position of their PHI instructions during register allocation. See DebugPHIRegallocPos.

DebugValueSubstitutions

Substitutions recording where tracked debug values were redefined.

UseDebugInstrRef

Flag for whether this function contains DBG_VALUEs (false) or DBG_INSTR_REF (true).

VariableDbgInfos

Debug locations for variables with a fixed address during execution.

Static Data Members

Name

Description

DebugOperandMemNumber

A reserved operand number representing the instructions memory operand, for instructions that have a stack spill fused into them.

Friends

Name

Description

llvm::ilist_traits<MachineInstr>

Intrusive list traits for MachineInstr nodes owned by a MachineBasicBlock.

Non-Member Functions

Name

Description

BuildMI

This version of the builder builds a DBG_VALUE or DBG_VALUE_LIST intrinsic for a MachineOperand.

BuildMI

Build a DBG_VALUE for a register or a register‐indirect address.

BuildMI

This version of the builder sets up the first operand as a destination virtual register.

BuildMI

Builder interface. Specify how to create the initial instruction itself.

avoidZeroOffsetLandingPad

Insert a NOP before a section‐leading EH pad so its LSDA offset is nonzero.

calculateDbgEntityHistory

Compute debug‐value and debug‐label histories for MF.

computeMachineUniformityInfo

Compute uniformity information for a Machine IR function.

constrainOperandRegClass

Constrain a register operand to a given target register class.

constrainOperandRegClass

Constrain a register operand for a given instruction description.

createAggressiveAntiDepBreaker

Create an aggressive anti‐dependence breaker.

createCriticalAntiDepBreaker

Create a critical‐path anti‐dependence breaker.

finalizeBundles

Finalize instruction bundles in the specified MachineFunction.

getEHScopeMembership

Compute EH scope membership for each basic block in a machine function.

getFunctionLiveInPhysReg

Return a virtual register for an incoming physical argument register.

hasInstrProfHashMismatch

Return whether the function has an instrumented‐profile hash mismatch.

inferAlignFromPtrInfo

Infer an alignment from machine pointer info for a memory access.

legalizeMachineFunction

Legalize generic instructions in MF according to LI.

machineFunctionIsIllegal

Return an illegal instruction in MF, or nullptr if MIR is fully legal.

reportGISelFailure

Report an ISel failure for a specific instruction with a custom message.

reportGISelFailure

Report an ISel error as a missed optimization remark to the LLVMContext's diagnostic stream. Set the FailedISel MachineFunction property.

reportGISelWarning

Report an ISel warning as a missed optimization remark to the LLVMContext's diagnostic stream.

scavengeFrameVirtualRegs

Replaces all frame index virtual registers with physical registers. Uses the register scavenger to find an appropriate register to use.

shouldOptimizeForSize

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

sortBasicBlocksAndUpdateBranches

Sort the machine basic blocks of MF and update branches after the reorder.

stableHashValue

Compute a stable hash of machine function MF.

Created with MrDocs