A sequence of machine instructions forming one basic block.

Synopsis

Declared in <llvm/CodeGen/MachineBasicBlock.h>

Base Classes

Name

Description

ilist_node_with_parent<MachineBasicBlock, MachineFunction>

An ilist node that can access its parent list.

Types

Name

Description

RegisterMaskPair

Pair of physical register and lane mask. This is not simply a std::pair typedef because the members should be named clearly as they both have an integer type.

SplitCriticalEdgeAnalyses

Analyses optionally updated when splitting a critical edge.

liveout_iterator

Input iterator over registers potentially live out of this block.

Type Aliases

Name

Description

const_instr_iterator

Const iterator over individual machine instructions (ignoring bundles).

const_instr_range

Const range over individual machine instructions (ignoring bundles).

const_iterator

Const bundle‐aware iterator over machine instructions.

const_pred_iterator

Const iterator over CFG predecessor MachineBasicBlocks.

const_pred_reverse_iterator

Const reverse iterator over predecessor MachineBasicBlocks.

const_reverse_instr_iterator

Const reverse iterator over individual machine instructions.

const_reverse_iterator

Const bundle‐aware reverse iterator over machine instructions.

const_succ_iterator

Const iterator over CFG successor MachineBasicBlocks.

const_succ_reverse_iterator

Const reverse iterator over successor MachineBasicBlocks.

instr_iterator

Iterator over individual machine instructions (ignoring bundles).

instr_range

Range over individual machine instructions (ignoring bundles).

iterator

Bundle‐aware iterator over machine instructions.

livein_iterator

Const iterator over live‐in register/lane pairs.

pred_iterator

Iterator over CFG predecessor MachineBasicBlocks.

pred_reverse_iterator

Reverse iterator over predecessor MachineBasicBlocks.

reverse_instr_iterator

Reverse iterator over individual machine instructions (ignoring bundles).

reverse_iterator

Bundle‐aware reverse iterator over machine instructions.

succ_iterator

Iterator over CFG successor MachineBasicBlocks.

succ_reverse_iterator

Reverse iterator over successor MachineBasicBlocks.

Enums

Name

Description

LivenessQueryResult

Possible outcome of a register liveness query to computeRegisterLiveness()

PrintNameFlag

Bit flags selecting optional details for printName.

Member Functions

Name

Description

ReplaceUsesOfBlockWith

Given a machine basic block that branched to 'Old', change the code and CFG so that it branches to 'New' instead.

SkipPHIsAndLabels

Return the first instruction after I that is not a PHI or label.

SkipPHIsLabelsAndDebug

Return the first instruction after I that is not a PHI, label, or debug.

SplitCriticalEdge

SplitCriticalEdge overloads

addLiveIn

addLiveIn overloads

addSuccessor

Add Succ as a successor of this MachineBasicBlock.

addSuccessorWithoutProb

Add Succ as a successor without recording an edge probability.

back

Return the last instruction in the block (bundle‐aware).

begin

begin overloads

canFallThrough

Return true if this block can fall through to the next layout block.

canPredictBranchProbabilities

Return true if successor probabilities match the equal‐probability default, so MIR printing can omit them.

canSplitCriticalEdge

Return true if the edge from this block to Succ can be split.

clear

Remove all instructions from this basic block without deleting the block.

clearBasicBlock

Remove the reference to the underlying IR BasicBlock. This is for reduction tools and should generally not be used.

clearLiveIns

clearLiveIns overloads

computeRegisterLiveness

Return whether physical register Reg is live just before Before.

copySuccessor

Copy a successor (and any probability info) from original block to this block's. Uses an iterator into the original blocks successors.

dump

Dump this machine basic block to stderr for debugging.

empty

Return true if this block contains no instructions.

end

end overloads

erase

erase overloads

eraseFromParent

This method unlinks 'this' from the containing function and deletes it.

erase_instr

Remove an instruction from the instruction list and delete it.

findBranchDebugLoc

Find and return the merged DebugLoc of the branch instructions of the block. Return UnknownLoc if there is none.

findDebugLoc

findDebugLoc overloads

findPrevDebugLoc

findPrevDebugLoc overloads

front

Return the first instruction in the block (bundle‐aware).

getAddressTakenIRBlock

Retrieves the BasicBlock which corresponds to this MachineBasicBlock.

getAlignment

Return alignment of the basic block.

getAnalysisNumber

For analyses, blocks have a more stable number.

getBBID

Return the optional unique basic‐block ID assigned to this block.

getBasicBlock

Return the original LLVM IR basic block, or null if there is none.

getBeginClobberMask

Get the clobber mask for the start of this basic block. Funclets use this to prevent register allocation across funclet transitions.

getCallFrameSize

Return the call frame size on entry to this basic block.

getEHContSymbol

Return the Windows EH Continuation Symbol for this basic block.

getEndClobberMask

Get the clobber mask for the end of the basic block.

getEndSymbol

Returns the MCSymbol marking the end of this basic block.

getFallThrough

Return the fallthrough block if control can fall off this block's end.

getFirstInstrTerminator

Same getFirstTerminator but it ignores bundles and return an instr_iterator instead.

getFirstNonDebugInstr

getFirstNonDebugInstr overloads

getFirstNonPHI

getFirstNonPHI overloads

getFirstTerminator

getFirstTerminator overloads

getFirstTerminatorForward

Find the first terminator by scanning forward from the block start.

getFullName

Return a formatted string to identify this block and its parent function.

getIrrLoopHeaderWeight

Return the optional irreducible loop header weight for this block.

getLastNonDebugInstr

getLastNonDebugInstr overloads

getLiveIns

Return the underlying live‐in register/lane vector.

getLogicalFallThrough

Return the logical fallthrough successor, by branch or layout fallthrough.

getMaxBytesForAlignment

Return the maximum amount of padding allowed for aligning the basic block.

getName

Return the name of the corresponding LLVM basic block, or an empty string.

getNextNode

Get the next node, or nullptr for the list tail.

getNumber

MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFunction yet, in which case this will return ‐1.

getParent

getParent overloads

getPrevNode

getPrevNode overloads

getSectionID

Returns the section ID of this basic block.

getSinglePredecessor

getSinglePredecessor overloads

getSingleSuccessor

getSingleSuccessor overloads

getSuccProbability

Return the probability of the CFG edge from this block to Succ.

getSymbol

Return the MCSymbol for this basic block.

hasAddressTaken

Return true if this block's address is taken outside ordinary CFG uses.

hasEHPadSuccessor

Return true if any successor of this block is an EH pad.

hasLabelMustBeEmitted

Test whether this block must have its label emitted.

hasName

Check if there is a name of corresponding LLVM basic block.

hasSuccessorProbabilities

Return true if any of the successors have probabilities attached to them.

insert

insert overloads

insertAfter

Insert MI into the instruction list after I.

insertAfterBundle

Insert MI after I, or after I's bundle if I is bundled.

instr_back

instr_back overloads

instr_begin

instr_begin overloads

instr_end

instr_end overloads

instr_front

instr_front overloads

instr_rbegin

instr_rbegin overloads

instr_rend

instr_rend overloads

instrs

instrs overloads

isBeginSection

Returns true if this block begins any section.

isCleanupFuncletEntry

Returns true if this is the entry block of a cleanup funclet.

isEHContTarget

Returns true if this is a target of Windows EH Continuation Guard.

isEHFuncletEntry

Returns true if this is the entry block of an EH funclet.

isEHPad

Returns true if the block is a landing pad. That is this basic block is entered via an exception handler.

isEHScopeEntry

Returns true if this is the entry block of an EH scope, i.e., the block that used to have a catchpad or cleanuppad instruction in the LLVM IR.

isEHScopeReturnBlock

Convenience function that returns true if the bock ends in a EH scope return instruction.

isEndSection

Returns true if this block ends any section.

isEntryBlock

Returns true if this is the entry block of the function.

isIRBlockAddressTaken

Test whether this block is the target of an IR BlockAddress. (There can more than one MBB associated with an IR BB where the address is taken.)

isInlineAsmBrIndirectTarget

Returns true if this is the indirect dest of an INLINEASM_BR.

isLayoutSuccessor

Return true if MBB is the immediate layout successor of this block.

isLegalToHoistInto

Returns true if it is legal to hoist instructions into this block.

isLiveIn

Return true if the specified register is in the live in set.

isMachineBlockAddressTaken

Return true if this block's machine address is taken for non‐CFG uses.

isPredecessor

Return true if the specified MBB is a predecessor of this block.

isReturnBlock

Convenience function that returns true if the block ends in a return instruction.

isSuccessor

Return true if the specified MBB is a successor of this block.

livein_begin

Return an iterator to the beginning of the live‐in register list.

livein_begin_dbg

Return a live‐in begin iterator without verifying liveness accuracy.

livein_empty

Return true if this block has no live‐in registers.

livein_end

Return an iterator to the end of the live‐in register list.

liveins

Return a range over this block's live‐in registers.

liveins_dbg

Return live‐in registers without verifying that liveness data is current.

liveout_begin

Return a begin iterator over registers potentially live out of this block.

liveout_end

Return the past‐the‐end live‐out iterator for this block.

liveouts

Return a range over registers potentially live out of this block.

mayHaveInlineAsmBr

Return true if this block may be targeted by an INLINEASM_BR.

moveAfter

Move this block after NewBefore without changing the CFG.

moveBefore

Move this block before NewAfter without changing the CFG.

normalizeSuccProbs

Normalize successor probabilities so they sum to one.

phis

phis overloads

pop_back

Remove and destroy the last instruction in this block.

pop_front

Remove and destroy the first instruction in this block.

pred_begin

pred_begin overloads

pred_empty

Return true if this block has no CFG predecessors.

pred_end

pred_end overloads

pred_rbegin

pred_rbegin overloads

pred_rend

pred_rend overloads

pred_size

Return the number of CFG predecessors.

predecessors

predecessors overloads

print

print overloads

printAsOperand

Print this block as a MIR operand (for example, %bb.N).

printName

Print this block's name to os with optional IR/attribute details.

push_back

Append instruction MI to the end of this block.

rbegin

rbegin overloads

remove

Remove the unbundled instruction from the instruction list without deleting it.

removeFromParent

This method unlinks 'this' from the containing function, and returns it, but does not delete it.

removeLiveIn

removeLiveIn overloads

removeLiveInOverlappedWith

Remove Reg and overlapping live‐in registers/lanes.

removePHIsIncomingValuesForPredecessor

Remove all PHI incoming values that refer to predecessor PredMBB.

removeSuccessor

removeSuccessor overloads

remove_instr

Remove the possibly bundled instruction from the instruction list without deleting it.

rend

rend overloads

replacePhiUsesWith

Update all phi nodes in this basic block to refer to basic block New instead of basic block Old.

replaceSuccessor

Replace successor OLD with NEW and update probability info.

rfindDebugLoc

rfindDebugLoc overloads

rfindPrevDebugLoc

rfindPrevDebugLoc overloads

sameSection

Returns true if this and MBB belong to the same section.

setAddressTakenIRBlock

Set this block to reflect that it corresponds to an IR‐level basic block with a BlockAddress.

setAlignment

setAlignment overloads

setAnalysisNumber

Set this block's analysis number to N.

setBBID

Sets the fixed BBID of this basic block.

setCallFrameSize

Set the call frame size on entry to this basic block.

setIrrLoopHeaderWeight

Record the irreducible loop header weight copied from the IR basic block.

setIsBeginSection

Mark whether this block is the first in its basic block section.

setIsCleanupFuncletEntry

Indicates if this is the entry block of a cleanup funclet.

setIsEHContTarget

Indicates if this is a target of Windows EH Continuation Guard.

setIsEHFuncletEntry

Indicates if this is the entry block of an EH funclet.

setIsEHPad

Indicates the block is a landing pad. That is this basic block is entered via an exception handler.

setIsEHScopeEntry

Indicates if this is the entry block of an EH scope, i.e., the block that that used to have a catchpad or cleanuppad instruction in the LLVM IR.

setIsEndSection

Mark whether this block is the last in its basic block section.

setIsInlineAsmBrIndirectTarget

Indicates if this is the indirect dest of an INLINEASM_BR.

setLabelMustBeEmitted

Set this block to reflect that, regardless how we flow to it, we need its label be emitted.

setMachineBlockAddressTaken

Mark that this block's machine address is taken for non‐CFG uses.

setMaxBytesForAlignment

Set the maximum amount of padding allowed for aligning the basic block

setNumber

Set this block's dense function‐level number to N.

setSectionID

Sets the section ID for this basic block.

setSuccProbability

Set successor probability of a given iterator.

size

Return the number of instructions in this block (including debug instrs).

sizeWithoutDebugLargerThan

Return true if the non‐debug instruction count exceeds Limit.

sortUniqueLiveIns

Sort and unique the LiveIns vector for cheaper membership tests.

splice

splice overloads

splitAt

Split this block after SplitInst into two consecutive blocks.

splitSuccessor

Split the old successor into old plus new and updates the probability info.

succ_begin

succ_begin overloads

succ_empty

Return true if this block has no CFG successors.

succ_end

succ_end overloads

succ_rbegin

succ_rbegin overloads

succ_rend

succ_rend overloads

succ_size

Return the number of CFG successors.

successors

successors overloads

terminatorIsComputedGotoWithSuccessors

Returns true if the original IR terminator is an indirectbr with successor blocks. This typically corresponds to a goto in C, rather than jump tables.

terminators

terminators overloads

transferSuccessors

Transfers all the successors from MBB to this machine basic block (i.e., copies all the successors FromMBB and remove all the successors from FromMBB).

transferSuccessorsAndUpdatePHIs

Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor blocks which refer to FromMBB to refer to this.

updateTerminator

Update terminators after a change to this block's layout.

validateSuccProbs

Validate successors' probabilities and check if the sum of them is approximate one. This only works in DEBUG mode.

Static Member Functions

Name

Description

getSublistAccess

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

Friends

Name

Description

llvm::ilist_callback_traits<MachineBasicBlock>

Callback traits notifying a MachineFunction when MBBs enter or leave it.

llvm::MachineBranchProbabilityInfo

Analysis that provides relative branch probabilities for CFG edges between machine basic blocks.

llvm::MachineFunction

Representation of machine code for a single LLVM IR function.

llvm::ilist_callback_traits

Callbacks do nothing by default in iplist and ilist.

Non-Member Functions

Name

Description

BuildMI

Insert a new instruction before I without a destination register.

BuildMI

Insert a new instruction before I without a destination register.

BuildMI

Insert a new instruction before I without a destination register.

BuildMI

This version of the builder builds a DBG_VALUE, DBG_INSTR_REF, or DBG_VALUE_LIST intrinsic for a machine operand and inserts it at position I.

BuildMI

Insert a new instruction before I without a destination register.

BuildMI

Insert a new instruction with a destination register before I.

BuildMI

Insert a new instruction with a destination register before I.

BuildMI

Insert a new instruction with a destination register before I.

BuildMI

Append a new instruction with a destination register to BB.

BuildMI

This version of the builder builds a DBG_VALUE intrinsic for either a value in a register or a register‐indirect address and inserts it at position I.

BuildMI

This version of the builder inserts the newly‐built instruction at the end of the given MachineBasicBlock, and does NOT take a destination register.

BuildMI

Insert a new instruction with a destination register before I.

PeelSingleBlockLoop

Peels a single block loop.

addLiveIns

Adds registers contained in LiveRegs to the block live‐in list of MBB. Does not add reserved registers.

buildDbgValueForSpill

Clone a DBG_VALUE whose value has been spilled to FrameIndex.

buildDbgValueForSpill

Clone a DBG_VALUE after spilling the given operands to FrameIndex.

finalizeBundle

Finalize a machine instruction bundle from FirstMI to LastMI (exclusive).

finalizeBundle

Finalize a machine instruction bundle whose end is marked by InsideBundle.

findSplitPointForStackProtector

Find the split point at which to splice the end of BB into its success stack protector check machine basic block.

getEHScopeMembership

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

guessSuccessors

Guess likely successors of a machine basic block from its operands.

instrs

Return the instructions in machine basic block BB.

pred_begin

Return an iterator to the first CFG predecessor of BB.

pred_end

Return the end iterator for CFG predecessors of BB.

pred_size

Return the number of CFG predecessors of BB.

predecessors

Return the CFG predecessors of BB.

printMBBReference

Print a machine basic block reference for use in diagnostics and dumps.

recomputeLivenessFlags

Recomputes dead and kill flags in MBB.

shouldOptimizeForSize

Returns true if machine basic block MBB is suggested to be size‐optimized based on the profile.

shouldOptimizeForSize

Returns true if machine basic block MBB is suggested to be size‐optimized based on the profile.

stableHashValue

Compute a stable hash of machine basic block MBB.

succ_begin

Return an iterator to the first CFG successor of BB.

succ_end

Return the end iterator for CFG successors of BB.

succ_size

Return the number of CFG successors of BB.

successors

Return the CFG successors of machine basic block BB.

Created with MrDocs