LLVM 19.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::MachineBasicBlock Class Reference

#include "llvm/CodeGen/MachineBasicBlock.h"

Inheritance diagram for llvm::MachineBasicBlock:
Inheritance graph
[legend]

Classes

class  liveout_iterator
 
struct  RegisterMaskPair
 Pair of physical register and lane mask. More...
 

Public Types

enum  LivenessQueryResult { LQR_Live , LQR_Dead , LQR_Unknown }
 Possible outcome of a register liveness query to computeRegisterLiveness() More...
 
enum  PrintNameFlag { PrintNameIr = (1 << 0) , PrintNameAttributes = (1 << 1) }
 
using instr_iterator = Instructions::iterator
 
using const_instr_iterator = Instructions::const_iterator
 
using reverse_instr_iterator = Instructions::reverse_iterator
 
using const_reverse_instr_iterator = Instructions::const_reverse_iterator
 
using iterator = MachineInstrBundleIterator< MachineInstr >
 
using const_iterator = MachineInstrBundleIterator< const MachineInstr >
 
using reverse_iterator = MachineInstrBundleIterator< MachineInstr, true >
 
using const_reverse_iterator = MachineInstrBundleIterator< const MachineInstr, true >
 
using instr_range = iterator_range< instr_iterator >
 
using const_instr_range = iterator_range< const_instr_iterator >
 
using pred_iterator = std::vector< MachineBasicBlock * >::iterator
 
using const_pred_iterator = std::vector< MachineBasicBlock * >::const_iterator
 
using succ_iterator = std::vector< MachineBasicBlock * >::iterator
 
using const_succ_iterator = std::vector< MachineBasicBlock * >::const_iterator
 
using pred_reverse_iterator = std::vector< MachineBasicBlock * >::reverse_iterator
 
using const_pred_reverse_iterator = std::vector< MachineBasicBlock * >::const_reverse_iterator
 
using succ_reverse_iterator = std::vector< MachineBasicBlock * >::reverse_iterator
 
using const_succ_reverse_iterator = std::vector< MachineBasicBlock * >::const_reverse_iterator
 
using livein_iterator = LiveInVector::const_iterator
 

Public Member Functions

const BasicBlockgetBasicBlock () const
 Return the LLVM basic block that this instance corresponded to originally.
 
void clearBasicBlock ()
 Remove the reference to the underlying IR BasicBlock.
 
StringRef getName () const
 Return the name of the corresponding LLVM basic block, or an empty string.
 
std::string getFullName () const
 Return a formatted string to identify this block and its parent function.
 
bool hasAddressTaken () const
 Test whether this block is used as something other than the target of a terminator, exception-handling target, or jump table.
 
bool isMachineBlockAddressTaken () const
 Test whether this block is used as something other than the target of a terminator, exception-handling target, jump table, or IR blockaddress.
 
bool isIRBlockAddressTaken () const
 Test whether this block is the target of an IR BlockAddress.
 
BasicBlockgetAddressTakenIRBlock () const
 Retrieves the BasicBlock which corresponds to this MachineBasicBlock.
 
void setMachineBlockAddressTaken ()
 Set this block to indicate that its address is used as something other than the target of a terminator, exception-handling target, jump table, or IR-level "blockaddress".
 
void setAddressTakenIRBlock (BasicBlock *BB)
 Set this block to reflect that it corresponds to an IR-level basic block with a BlockAddress.
 
bool hasLabelMustBeEmitted () const
 Test whether this block must have its label emitted.
 
void setLabelMustBeEmitted ()
 Set this block to reflect that, regardless how we flow to it, we need its label be emitted.
 
const MachineFunctiongetParent () const
 Return the MachineFunction containing this basic block.
 
MachineFunctiongetParent ()
 
unsigned size () const
 
bool sizeWithoutDebugLargerThan (unsigned Limit) const
 
bool empty () const
 
MachineInstrinstr_front ()
 
MachineInstrinstr_back ()
 
const MachineInstrinstr_front () const
 
const MachineInstrinstr_back () const
 
MachineInstrfront ()
 
MachineInstrback ()
 
const MachineInstrfront () const
 
const MachineInstrback () const
 
instr_iterator instr_begin ()
 
const_instr_iterator instr_begin () const
 
instr_iterator instr_end ()
 
const_instr_iterator instr_end () const
 
reverse_instr_iterator instr_rbegin ()
 
const_reverse_instr_iterator instr_rbegin () const
 
reverse_instr_iterator instr_rend ()
 
const_reverse_instr_iterator instr_rend () const
 
instr_range instrs ()
 
const_instr_range instrs () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
iterator_range< iteratorterminators ()
 
iterator_range< const_iteratorterminators () const
 
iterator_range< iteratorphis ()
 Returns a range that iterates over the phis in the basic block.
 
iterator_range< const_iteratorphis () const
 
pred_iterator pred_begin ()
 
const_pred_iterator pred_begin () const
 
pred_iterator pred_end ()
 
const_pred_iterator pred_end () const
 
pred_reverse_iterator pred_rbegin ()
 
const_pred_reverse_iterator pred_rbegin () const
 
pred_reverse_iterator pred_rend ()
 
const_pred_reverse_iterator pred_rend () const
 
unsigned pred_size () const
 
bool pred_empty () const
 
succ_iterator succ_begin ()
 
const_succ_iterator succ_begin () const
 
succ_iterator succ_end ()
 
const_succ_iterator succ_end () const
 
succ_reverse_iterator succ_rbegin ()
 
const_succ_reverse_iterator succ_rbegin () const
 
succ_reverse_iterator succ_rend ()
 
const_succ_reverse_iterator succ_rend () const
 
unsigned succ_size () const
 
bool succ_empty () const
 
iterator_range< pred_iteratorpredecessors ()
 
iterator_range< const_pred_iteratorpredecessors () const
 
iterator_range< succ_iteratorsuccessors ()
 
iterator_range< const_succ_iteratorsuccessors () const
 
void addLiveIn (MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
 Adds the specified register as a live in.
 
void addLiveIn (const RegisterMaskPair &RegMaskPair)
 
void sortUniqueLiveIns ()
 Sorts and uniques the LiveIns vector.
 
void clearLiveIns ()
 Clear live in list.
 
Register addLiveIn (MCRegister PhysReg, const TargetRegisterClass *RC)
 Add PhysReg as live in to this block, and ensure that there is a copy of PhysReg to a virtual register of class RC.
 
void removeLiveIn (MCPhysReg Reg, LaneBitmask LaneMask=LaneBitmask::getAll())
 Remove the specified register from the live in set.
 
bool isLiveIn (MCPhysReg Reg, LaneBitmask LaneMask=LaneBitmask::getAll()) const
 Return true if the specified register is in the live in set.
 
livein_iterator livein_begin_dbg () const
 Unlike livein_begin, this method does not check that the liveness information is accurate.
 
iterator_range< livein_iteratorliveins_dbg () const
 
livein_iterator livein_begin () const
 
livein_iterator livein_end () const
 
bool livein_empty () const
 
iterator_range< livein_iteratorliveins () const
 
livein_iterator removeLiveIn (livein_iterator I)
 Remove entry from the livein set and return iterator to the next.
 
std::vector< RegisterMaskPairgetLiveIns () const
 
liveout_iterator liveout_begin () const
 Iterator scanning successor basic blocks' liveins to determine the registers potentially live at the end of this block.
 
liveout_iterator liveout_end () const
 
iterator_range< liveout_iteratorliveouts () const
 
const uint32_tgetBeginClobberMask (const TargetRegisterInfo *TRI) const
 Get the clobber mask for the start of this basic block.
 
const uint32_tgetEndClobberMask (const TargetRegisterInfo *TRI) const
 Get the clobber mask for the end of the basic block.
 
Align getAlignment () const
 Return alignment of the basic block.
 
void setAlignment (Align A)
 Set alignment of the basic block.
 
void setAlignment (Align A, unsigned MaxBytes)
 
unsigned getMaxBytesForAlignment () const
 Return the maximum amount of padding allowed for aligning the basic block.
 
void setMaxBytesForAlignment (unsigned MaxBytes)
 Set the maximum amount of padding allowed for aligning the basic block.
 
bool isEHPad () const
 Returns true if the block is a landing pad.
 
void setIsEHPad (bool V=true)
 Indicates the block is a landing pad.
 
bool hasEHPadSuccessor () const
 
bool isEntryBlock () const
 Returns true if this is the entry block of the function.
 
bool isEHScopeEntry () const
 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.
 
void setIsEHScopeEntry (bool V=true)
 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.
 
bool isEHCatchretTarget () const
 Returns true if this is a target block of a catchret.
 
void setIsEHCatchretTarget (bool V=true)
 Indicates if this is a target block of a catchret.
 
bool isEHFuncletEntry () const
 Returns true if this is the entry block of an EH funclet.
 
void setIsEHFuncletEntry (bool V=true)
 Indicates if this is the entry block of an EH funclet.
 
bool isCleanupFuncletEntry () const
 Returns true if this is the entry block of a cleanup funclet.
 
void setIsCleanupFuncletEntry (bool V=true)
 Indicates if this is the entry block of a cleanup funclet.
 
bool isBeginSection () const
 Returns true if this block begins any section.
 
bool isEndSection () const
 Returns true if this block ends any section.
 
void setIsBeginSection (bool V=true)
 
void setIsEndSection (bool V=true)
 
std::optional< UniqueBBIDgetBBID () const
 
MBBSectionID getSectionID () const
 Returns the section ID of this basic block.
 
unsigned getSectionIDNum () const
 Returns the unique section ID number of this basic block.
 
void setBBID (const UniqueBBID &V)
 Sets the fixed BBID of this basic block.
 
void setSectionID (MBBSectionID V)
 Sets the section ID for this basic block.
 
MCSymbolgetEndSymbol () const
 Returns the MCSymbol marking the end of this basic block.
 
bool mayHaveInlineAsmBr () const
 Returns true if this block may have an INLINEASM_BR (overestimate, by checking if any of the successors are indirect targets of any inlineasm_br in the function).
 
bool isInlineAsmBrIndirectTarget () const
 Returns true if this is the indirect dest of an INLINEASM_BR.
 
void setIsInlineAsmBrIndirectTarget (bool V=true)
 Indicates if this is the indirect dest of an INLINEASM_BR.
 
bool isLegalToHoistInto () const
 Returns true if it is legal to hoist instructions into this block.
 
void moveBefore (MachineBasicBlock *NewAfter)
 Move 'this' block before or after the specified block.
 
void moveAfter (MachineBasicBlock *NewBefore)
 
bool sameSection (const MachineBasicBlock *MBB) const
 Returns true if this and MBB belong to the same section.
 
void updateTerminator (MachineBasicBlock *PreviousLayoutSuccessor)
 Update the terminator instructions in block to account for changes to block layout which may have been made.
 
void addSuccessor (MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
 Add Succ as a successor of this MachineBasicBlock.
 
void addSuccessorWithoutProb (MachineBasicBlock *Succ)
 Add Succ as a successor of this MachineBasicBlock.
 
void setSuccProbability (succ_iterator I, BranchProbability Prob)
 Set successor probability of a given iterator.
 
void normalizeSuccProbs ()
 Normalize probabilities of all successors so that the sum of them becomes one.
 
void validateSuccProbs () const
 Validate successors' probabilities and check if the sum of them is approximate one.
 
void removeSuccessor (MachineBasicBlock *Succ, bool NormalizeSuccProbs=false)
 Remove successor from the successors list of this MachineBasicBlock.
 
succ_iterator removeSuccessor (succ_iterator I, bool NormalizeSuccProbs=false)
 Remove specified successor from the successors list of this MachineBasicBlock.
 
void replaceSuccessor (MachineBasicBlock *Old, MachineBasicBlock *New)
 Replace successor OLD with NEW and update probability info.
 
void copySuccessor (const MachineBasicBlock *Orig, succ_iterator I)
 Copy a successor (and any probability info) from original block to this block's.
 
void splitSuccessor (MachineBasicBlock *Old, MachineBasicBlock *New, bool NormalizeSuccProbs=false)
 Split the old successor into old plus new and updates the probability info.
 
void transferSuccessors (MachineBasicBlock *FromMBB)
 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).
 
void transferSuccessorsAndUpdatePHIs (MachineBasicBlock *FromMBB)
 Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor blocks which refer to FromMBB to refer to this.
 
bool hasSuccessorProbabilities () const
 Return true if any of the successors have probabilities attached to them.
 
bool isPredecessor (const MachineBasicBlock *MBB) const
 Return true if the specified MBB is a predecessor of this block.
 
bool isSuccessor (const MachineBasicBlock *MBB) const
 Return true if the specified MBB is a successor of this block.
 
bool isLayoutSuccessor (const MachineBasicBlock *MBB) const
 Return true if the specified MBB will be emitted immediately after this block, such that if this block exits by falling through, control will transfer to the specified MBB.
 
const MachineBasicBlockgetSingleSuccessor () const
 Return the successor of this block if it has a single successor.
 
MachineBasicBlockgetSingleSuccessor ()
 
const MachineBasicBlockgetSinglePredecessor () const
 Return the predecessor of this block if it has a single predecessor.
 
MachineBasicBlockgetSinglePredecessor ()
 
MachineBasicBlockgetFallThrough (bool JumpToFallThrough=true)
 Return the fallthrough block if the block can implicitly transfer control to the block after it by falling off the end of it.
 
MachineBasicBlockgetLogicalFallThrough ()
 Return the fallthrough block if the block can implicitly transfer control to it's successor, whether by a branch or a fallthrough.
 
bool canFallThrough ()
 Return true if the block can implicitly transfer control to the block after it by falling off the end of it.
 
iterator getFirstNonPHI ()
 Returns a pointer to the first instruction in this block that is not a PHINode instruction.
 
const_iterator getFirstNonPHI () const
 
iterator SkipPHIsAndLabels (iterator I)
 Return the first instruction in MBB after I that is not a PHI or a label.
 
iterator SkipPHIsLabelsAndDebug (iterator I, Register Reg=Register(), bool SkipPseudoOp=true)
 Return the first instruction in MBB after I that is not a PHI, label or debug.
 
iterator getFirstTerminator ()
 Returns an iterator to the first terminator instruction of this basic block.
 
const_iterator getFirstTerminator () const
 
instr_iterator getFirstInstrTerminator ()
 Same getFirstTerminator but it ignores bundles and return an instr_iterator instead.
 
iterator getFirstTerminatorForward ()
 Finds the first terminator in a block by scanning forward.
 
iterator getFirstNonDebugInstr (bool SkipPseudoOp=true)
 Returns an iterator to the first non-debug instruction in the basic block, or end().
 
const_iterator getFirstNonDebugInstr (bool SkipPseudoOp=true) const
 
iterator getLastNonDebugInstr (bool SkipPseudoOp=true)
 Returns an iterator to the last non-debug instruction in the basic block, or end().
 
const_iterator getLastNonDebugInstr (bool SkipPseudoOp=true) const
 
bool isReturnBlock () const
 Convenience function that returns true if the block ends in a return instruction.
 
bool isEHScopeReturnBlock () const
 Convenience function that returns true if the bock ends in a EH scope return instruction.
 
MachineBasicBlocksplitAt (MachineInstr &SplitInst, bool UpdateLiveIns=true, LiveIntervals *LIS=nullptr)
 Split a basic block into 2 pieces at SplitPoint.
 
MachineBasicBlockSplitCriticalEdge (MachineBasicBlock *Succ, Pass &P, std::vector< SparseBitVector<> > *LiveInSets=nullptr)
 Split the critical edge from this block to the given successor block, and return the newly created block, or null if splitting is not possible.
 
bool canSplitCriticalEdge (const MachineBasicBlock *Succ) const
 Check if the edge between this block and the given successor Succ, can be split.
 
void pop_front ()
 
void pop_back ()
 
void push_back (MachineInstr *MI)
 
instr_iterator insert (instr_iterator I, MachineInstr *M)
 Insert MI into the instruction list before I, possibly inside a bundle.
 
template<typename IT >
void insert (iterator I, IT S, IT E)
 Insert a range of instructions into the instruction list before I.
 
iterator insert (iterator I, MachineInstr *MI)
 Insert MI into the instruction list before I.
 
iterator insertAfter (iterator I, MachineInstr *MI)
 Insert MI into the instruction list after I.
 
instr_iterator insertAfterBundle (instr_iterator I, MachineInstr *MI)
 If I is bundled then insert MI into the instruction list after the end of the bundle, otherwise insert MI immediately after I.
 
instr_iterator erase (instr_iterator I)
 Remove an instruction from the instruction list and delete it.
 
instr_iterator erase_instr (MachineInstr *I)
 Remove an instruction from the instruction list and delete it.
 
iterator erase (iterator I, iterator E)
 Remove a range of instructions from the instruction list and delete them.
 
iterator erase (iterator I)
 Remove an instruction or bundle from the instruction list and delete it.
 
iterator erase (MachineInstr *I)
 Remove an instruction from the instruction list and delete it.
 
MachineInstrremove (MachineInstr *I)
 Remove the unbundled instruction from the instruction list without deleting it.
 
MachineInstrremove_instr (MachineInstr *I)
 Remove the possibly bundled instruction from the instruction list without deleting it.
 
void clear ()
 
void splice (iterator Where, MachineBasicBlock *Other, iterator From)
 Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before 'Where'.
 
void splice (iterator Where, MachineBasicBlock *Other, iterator From, iterator To)
 Take a block of instructions from MBB 'Other' in the range [From, To), and insert them into this MBB right before 'Where'.
 
MachineBasicBlockremoveFromParent ()
 This method unlinks 'this' from the containing function, and returns it, but does not delete it.
 
void eraseFromParent ()
 This method unlinks 'this' from the containing function and deletes it.
 
void ReplaceUsesOfBlockWith (MachineBasicBlock *Old, MachineBasicBlock *New)
 Given a machine basic block that branched to 'Old', change the code and CFG so that it branches to 'New' instead.
 
void replacePhiUsesWith (MachineBasicBlock *Old, MachineBasicBlock *New)
 Update all phi nodes in this basic block to refer to basic block New instead of basic block Old.
 
DebugLoc findDebugLoc (instr_iterator MBBI)
 Find the next valid DebugLoc starting at MBBI, skipping any debug instructions.
 
DebugLoc findDebugLoc (iterator MBBI)
 
DebugLoc rfindDebugLoc (reverse_instr_iterator MBBI)
 Has exact same behavior as findDebugLoc (it also searches towards the end of this MBB) except that this function takes a reverse iterator to identify the starting MI.
 
DebugLoc rfindDebugLoc (reverse_iterator MBBI)
 
DebugLoc findPrevDebugLoc (instr_iterator MBBI)
 Find the previous valid DebugLoc preceding MBBI, skipping any debug instructions.
 
DebugLoc findPrevDebugLoc (iterator MBBI)
 
DebugLoc rfindPrevDebugLoc (reverse_instr_iterator MBBI)
 Has exact same behavior as findPrevDebugLoc (it also searches towards the beginning of this MBB) except that this function takes reverse iterator to identify the starting MI.
 
DebugLoc rfindPrevDebugLoc (reverse_iterator MBBI)
 
DebugLoc findBranchDebugLoc ()
 Find and return the merged DebugLoc of the branch instructions of the block.
 
LivenessQueryResult computeRegisterLiveness (const TargetRegisterInfo *TRI, MCRegister Reg, const_iterator Before, unsigned Neighborhood=10) const
 Return whether (physical) register Reg has been defined and not killed as of just before Before.
 
void dump () const
 
void print (raw_ostream &OS, const SlotIndexes *=nullptr, bool IsStandalone=true) const
 
void print (raw_ostream &OS, ModuleSlotTracker &MST, const SlotIndexes *=nullptr, bool IsStandalone=true) const
 
void printName (raw_ostream &os, unsigned printNameFlags=PrintNameIr, ModuleSlotTracker *moduleSlotTracker=nullptr) const
 Print the basic block's name as:
 
void printAsOperand (raw_ostream &OS, bool PrintType=true) const
 
int getNumber () const
 MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFunction yet, in which case this will return -1.
 
void setNumber (int N)
 
unsigned getCallFrameSize () const
 Return the call frame size on entry to this basic block.
 
void setCallFrameSize (unsigned N)
 Set the call frame size on entry to this basic block.
 
MCSymbolgetSymbol () const
 Return the MCSymbol for this basic block.
 
MCSymbolgetEHCatchretSymbol () const
 Return the EHCatchret Symbol for this basic block.
 
std::optional< uint64_tgetIrrLoopHeaderWeight () const
 
void setIrrLoopHeaderWeight (uint64_t Weight)
 
BranchProbability getSuccProbability (const_succ_iterator Succ) const
 Return probability of the edge from this block to MBB.
 
- Public Member Functions inherited from llvm::ilist_node_with_parent< MachineBasicBlock, MachineFunction >
MachineBasicBlockgetPrevNode ()
 
const MachineBasicBlockgetPrevNode () const
 Get the previous node, or nullptr for the list head.
 
MachineBasicBlockgetNextNode ()
 Get the next node, or nullptr for the list tail.
 
const MachineBasicBlockgetNextNode () const
 Get the next node, or nullptr for the list tail.
 
- Public Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >
self_iterator getIterator ()
 
const_self_iterator getIterator () const
 
reverse_self_iterator getReverseIterator ()
 
const_reverse_self_iterator getReverseIterator () const
 
bool isSentinel () const
 Check whether this is the sentinel node.
 

Static Public Member Functions

static Instructions MachineBasicBlock::* getSublistAccess (MachineInstr *)
 Support for MachineInstr::getNextNode().
 

Friends

class MachineFunction
 
class MachineBranchProbabilityInfo
 
class MIPrinter
 
struct ilist_callback_traits< MachineBasicBlock >
 

Additional Inherited Members

- Protected Types inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >
using self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, ilist_detail::compute_node_options< T, Options... >::type, false, false >::type
 
using const_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, ilist_detail::compute_node_options< T, Options... >::type, false, true >::type
 
using reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, ilist_detail::compute_node_options< T, Options... >::type, true, false >::type
 
using const_reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, ilist_detail::compute_node_options< T, Options... >::type, true, true >::type
 
- Protected Member Functions inherited from llvm::ilist_node_with_parent< MachineBasicBlock, MachineFunction >
 ilist_node_with_parent ()=default
 
- Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >
 ilist_node_impl ()=default
 

Detailed Description

Definition at line 101 of file MachineBasicBlock.h.

Member Typedef Documentation

◆ const_instr_iterator

Definition at line 289 of file MachineBasicBlock.h.

◆ const_instr_range

Definition at line 323 of file MachineBasicBlock.h.

◆ const_iterator

Definition at line 294 of file MachineBasicBlock.h.

◆ const_pred_iterator

Definition at line 366 of file MachineBasicBlock.h.

◆ const_pred_reverse_iterator

Definition at line 371 of file MachineBasicBlock.h.

◆ const_reverse_instr_iterator

Definition at line 291 of file MachineBasicBlock.h.

◆ const_reverse_iterator

Definition at line 296 of file MachineBasicBlock.h.

◆ const_succ_iterator

Definition at line 368 of file MachineBasicBlock.h.

◆ const_succ_reverse_iterator

Definition at line 375 of file MachineBasicBlock.h.

◆ instr_iterator

Definition at line 288 of file MachineBasicBlock.h.

◆ instr_range

Definition at line 322 of file MachineBasicBlock.h.

◆ iterator

Definition at line 293 of file MachineBasicBlock.h.

◆ livein_iterator

using llvm::MachineBasicBlock::livein_iterator = LiveInVector::const_iterator

Definition at line 459 of file MachineBasicBlock.h.

◆ pred_iterator

Definition at line 365 of file MachineBasicBlock.h.

◆ pred_reverse_iterator

Definition at line 369 of file MachineBasicBlock.h.

◆ reverse_instr_iterator

Definition at line 290 of file MachineBasicBlock.h.

◆ reverse_iterator

Definition at line 295 of file MachineBasicBlock.h.

◆ succ_iterator

Definition at line 367 of file MachineBasicBlock.h.

◆ succ_reverse_iterator

Definition at line 373 of file MachineBasicBlock.h.

Member Enumeration Documentation

◆ LivenessQueryResult

Possible outcome of a register liveness query to computeRegisterLiveness()

Enumerator
LQR_Live 

Register is known to be (at least partially) live.

LQR_Dead 

Register is known to be fully dead.

LQR_Unknown 

Register liveness not decidable from local neighborhood.

Definition at line 1136 of file MachineBasicBlock.h.

◆ PrintNameFlag

Enumerator
PrintNameIr 

Add IR name where available.

PrintNameAttributes 

Print attributes.

Definition at line 1162 of file MachineBasicBlock.h.

Member Function Documentation

◆ addLiveIn() [1/3]

void llvm::MachineBasicBlock::addLiveIn ( const RegisterMaskPair RegMaskPair)
inline

Definition at line 432 of file MachineBasicBlock.h.

◆ addLiveIn() [2/3]

Register MachineBasicBlock::addLiveIn ( MCRegister  PhysReg,
const TargetRegisterClass RC 
)

Add PhysReg as live in to this block, and ensure that there is a copy of PhysReg to a virtual register of class RC.

Return the virtual register that is a copy of the live in PhysReg.

Definition at line 637 of file MachineBasicBlock.cpp.

References addLiveIn(), llvm::MachineInstrBuilder::addReg(), assert(), begin(), llvm::BuildMI(), E, end(), front(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), I, isEHPad(), isLiveIn(), llvm::Register::isPhysicalRegister(), llvm::RegState::Kill, llvm_unreachable, MRI, SkipPHIsAndLabels(), and TII.

◆ addLiveIn() [3/3]

void llvm::MachineBasicBlock::addLiveIn ( MCRegister  PhysReg,
LaneBitmask  LaneMask = LaneBitmask::getAll() 
)
inline

Adds the specified register as a live in.

Note that it is an error to add the same register to the same set more than once unless the intention is to call sortUniqueLiveIns after all registers are added.

Definition at line 428 of file MachineBasicBlock.h.

Referenced by addLiveIn(), addLiveInRegs(), llvm::addLiveIns(), addSavedGPR(), llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::X86FrameLowering::adjustForSegmentedStacks(), buildGitPtr(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), llvm::RISCVInstrInfo::buildOutlinedFrame(), llvm::SIFrameLowering::determineCalleeSaves(), emitAlignedDPRCS2Spills(), llvm::SIFrameLowering::emitCSRSpillStores(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::SparcFrameLowering::emitEpilogue(), llvm::AArch64TargetLowering::EmitF128CSEL(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), llvm::MachineRegisterInfo::EmitLiveInCopies(), llvm::AArch64FrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::SystemZXPLINKFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), emitShadowCallStackPrologue(), emitXBegin(), llvm::getFunctionLiveInPhysReg(), handleMustTailForwardedRegisters(), llvm::MipsFunctionInfo::initGlobalBaseReg(), INITIALIZE_PASS(), llvm::AArch64InstrInfo::insertOutlinedCall(), llvm::ARMBaseInstrInfo::insertOutlinedCall(), llvm::MipsCallLowering::lowerFormalArguments(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::SIFrameLowering::processFunctionBeforeFrameFinalized(), pushRegsToStack(), llvm::IRTranslator::runOnMachineFunction(), llvm::SystemZELFFrameLowering::spillCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::spillCalleeSavedRegisters(), llvm::AArch64FrameLowering::spillCalleeSavedRegisters(), llvm::M68kFrameLowering::spillCalleeSavedRegisters(), llvm::Mips16FrameLowering::spillCalleeSavedRegisters(), llvm::MipsSEFrameLowering::spillCalleeSavedRegisters(), llvm::MSP430FrameLowering::spillCalleeSavedRegisters(), llvm::PPCFrameLowering::spillCalleeSavedRegisters(), llvm::RISCVFrameLowering::spillCalleeSavedRegisters(), llvm::X86FrameLowering::spillCalleeSavedRegisters(), llvm::XCoreFrameLowering::spillCalleeSavedRegisters(), SplitCriticalEdge(), splitEdge(), tryToSplitRestore(), updateLiveIn(), and updateLiveness().

◆ addSuccessor()

void MachineBasicBlock::addSuccessor ( MachineBasicBlock Succ,
BranchProbability  Prob = BranchProbability::getUnknown() 
)

Add Succ as a successor of this MachineBasicBlock.

The Predecessors list of Succ is automatically updated. PROB parameter is stored in Probabilities list. The default probability is set as unknown. Mixing known and unknown probabilities in successor list is not allowed. When all successors have unknown probabilities, 1 / N is returned as the probability for each successor, where N is the number of successors.

Note that duplicate Machine CFG edges are not allowed.

Definition at line 790 of file MachineBasicBlock.cpp.

Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::adjustForSegmentedStacks(), copySuccessor(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitReadCounterWidePseudo(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), llvm::VETargetLowering::emitSjLjDispatchBlock(), emitVecCondBranchPseudo(), emitXBegin(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::FastISel::fastEmitBranch(), llvm::FastISel::finishCondBranch(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), insertDivByZeroTrap(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), loadM0FromVGPR(), loadMBUFScalarOperandsFromVGPR(), LowerFPToInt(), llvm::PeelSingleBlockLoop(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), split(), splitAt(), splitBlockForLoop(), SplitCriticalEdge(), splitEdge(), splitMBB(), splitSuccessor(), transferSuccessors(), transferSuccessorsAndUpdatePHIs(), tryToSplitRestore(), and llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander().

◆ addSuccessorWithoutProb()

void MachineBasicBlock::addSuccessorWithoutProb ( MachineBasicBlock Succ)

Add Succ as a successor of this MachineBasicBlock.

The Predecessors list of Succ is automatically updated. The probability is not provided because BPI is not available (e.g. -O0 is used), in which case edge probabilities won't be used. Using this interface can save some space.

Definition at line 800 of file MachineBasicBlock.cpp.

Referenced by copySuccessor(), llvm::FastISel::fastEmitBranch(), llvm::FastISel::finishCondBranch(), transferSuccessors(), and transferSuccessorsAndUpdatePHIs().

◆ back() [1/2]

MachineInstr & llvm::MachineBasicBlock::back ( )
inline

◆ back() [2/2]

const MachineInstr & llvm::MachineBasicBlock::back ( ) const
inline

Definition at line 311 of file MachineBasicBlock.h.

References end().

◆ begin() [1/2]

iterator llvm::MachineBasicBlock::begin ( )
inline

Definition at line 329 of file MachineBasicBlock.h.

References instr_begin().

Referenced by addLiveIn(), llvm::LiveVariables::addNewBlock(), llvm::R600InstrInfo::analyzeBranch(), llvm::ARCInstrInfo::analyzeBranch(), llvm::BPFInstrInfo::analyzeBranch(), llvm::MSP430InstrInfo::analyzeBranch(), llvm::NVPTXInstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::SystemZInstrInfo::analyzeBranch(), llvm::XCoreInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::LanaiInstrInfo::analyzeBranch(), llvm::avoidZeroOffsetLandingPad(), bothUsedInPHI(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), llvm::RISCVInstrInfo::buildOutlinedFrame(), llvm::AArch64PAuth::checkAuthenticatedRegister(), computeRegisterLiveness(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), copyDebugInfoToSuccessor(), CountTerminators(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::CreateEmptyPHI(), llvm::SIInstrInfo::createPHIDestinationCopy(), createPHIsForCMOVsInSinkBB(), createPHIsForSelects(), llvm::MachineDominatorTree::dominates(), dominates(), llvm::M68kFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::M68kFrameLowering::emitEpilogue(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::AsmPrinter::emitFunctionBody(), emitGPDisp(), llvm::SITargetLowering::emitGWSMemViolTestLoop(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), llvm::MachineRegisterInfo::EmitLiveInCopies(), emitLoadM0FromVGPRLoop(), emitLoadScalarOpsFromVGPRLoop(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::AArch64FrameLowering::emitPrologue(), llvm::SIFrameLowering::emitPrologue(), llvm::ARCFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::CSKYFrameLowering::emitPrologue(), llvm::LanaiFrameLowering::emitPrologue(), llvm::LoongArchFrameLowering::emitPrologue(), llvm::M68kFrameLowering::emitPrologue(), llvm::Mips16FrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::MSP430FrameLowering::emitPrologue(), llvm::NVPTXFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::SparcFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::SystemZXPLINKFrameLowering::emitPrologue(), llvm::VEFrameLowering::emitPrologue(), llvm::WebAssemblyFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), emitReadCounterWidePseudo(), llvm::ScheduleDAGSDNodes::EmitSchedule(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), emitVecCondBranchPseudo(), emitXBegin(), llvm::RegScavenger::enterBasicBlock(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::AArch64InstrInfo::expandPostRAPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::SPIRVTargetLowering::finalizeLowering(), llvm::WebAssembly::findCatch(), llvm::findCMPToFoldIntoCBZ(), findFirstPredicateSetterFrom(), findHoistingInsertPosAndDeps(), findIncDecBefore(), findInsertLocation(), llvm::findPHICopyInsertPoint(), llvm::findSplitPointForStackProtector(), findSurvivorBackwards(), TransferTracker::flushDbgValues(), generateAssignInstrs(), llvm::rdf::Liveness::getAllReachingDefs(), getEarliestInsertPos(), getFirstNonDebugInstr(), getFirstTerminator(), llvm::getFunctionLiveInPhysReg(), llvm::CSKYInstrInfo::getGlobalBaseReg(), llvm::SparcInstrInfo::getGlobalBaseReg(), llvm::VEInstrInfo::getGlobalBaseReg(), llvm::ARMHazardRecognizerFPMLx::getHazardType(), getLatestInsertPos(), getNextMachineInstr(), llvm::ARMBasicBlockUtils::getOffsetOf(), llvm::SITargetLowering::getPrefLoopAlignment(), getPreviousInstr(), llvm::PhiLoweringHelper::getSaluInsertionAtEnd(), getSchedRegions(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), indirectCopyToAGPR(), llvm::MipsFunctionInfo::initGlobalBaseReg(), INITIALIZE_PASS(), initMBBRange(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), insertCSRRestores(), insertCSRSaves(), insertSEHRange(), isConvertibleToVMV_V_V(), isEFLAGSLive(), jumpTableFollowsTB(), llvm::SplitEditor::leaveIntvAtTop(), llvm::FastISel::leaveLocalValueArea(), TransferTracker::loadInlocs(), loadM0FromVGPR(), loadMBUFScalarOperandsFromVGPR(), LookForIdenticalPHI(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::X86CallLowering::lowerFormalArguments(), LowerFPToInt(), llvm::CombinerHelper::matchOptBrCondByInvertingCond(), llvm::AArch64RegisterInfo::materializeFrameBaseRegister(), llvm::SIRegisterInfo::materializeFrameBaseRegister(), llvm::ARMBaseRegisterInfo::materializeFrameBaseRegister(), llvm::PPCRegisterInfo::materializeFrameBaseRegister(), llvm::RISCVRegisterInfo::materializeFrameBaseRegister(), llvm::M68kFrameLowering::mergeSPUpdates(), llvm::X86FrameLowering::mergeSPUpdates(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::PeelingModuloScheduleExpander::peelKernel(), llvm::PeelSingleBlockLoop(), phis(), PrevCrossBBInst(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::AArch64FrameLowering::processFunctionBeforeFrameFinalized(), ProfitableToMerge(), llvm::RegPressureTracker::recede(), llvm::RegPressureTracker::recedeSkipDebugValues(), llvm::AArch64InstrInfo::removeBranch(), llvm::R600InstrInfo::removeBranch(), llvm::ARCInstrInfo::removeBranch(), llvm::ARMBaseInstrInfo::removeBranch(), llvm::BPFInstrInfo::removeBranch(), llvm::CSKYInstrInfo::removeBranch(), llvm::HexagonInstrInfo::removeBranch(), llvm::LanaiInstrInfo::removeBranch(), llvm::LoongArchInstrInfo::removeBranch(), llvm::M68kInstrInfo::removeBranch(), llvm::MSP430InstrInfo::removeBranch(), llvm::NVPTXInstrInfo::removeBranch(), llvm::PPCInstrInfo::removeBranch(), llvm::RISCVInstrInfo::removeBranch(), llvm::SparcInstrInfo::removeBranch(), llvm::SystemZInstrInfo::removeBranch(), llvm::VEInstrInfo::removeBranch(), llvm::X86InstrInfo::removeBranch(), llvm::XCoreInstrInfo::removeBranch(), llvm::SlotIndexes::repairIndexesInRange(), llvm::RegBankSelect::RepairingPlacement::RepairingPlacement(), llvm::LiveIntervals::repairIntervalsInRange(), llvm::X86InstrInfo::replaceBranchWithTailCall(), llvm::PPCFrameLowering::replaceFPWithRealFP(), llvm::Thumb2InstrInfo::ReplaceTailWithBranchTo(), rescheduleCanonically(), llvm::AArch64FrameLowering::resetCFIToInitialState(), llvm::CSKYFrameLowering::restoreCalleeSavedRegisters(), llvm::PPCFrameLowering::restoreCalleeSavedRegisters(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), llvm::XCoreFrameLowering::restoreCalleeSavedRegisters(), llvm::X86FrameLowering::restoreWinEHStackPointersInParent(), rollbackRestoreSplit(), llvm::CFIFixup::runOnMachineFunction(), llvm::InstructionSelect::runOnMachineFunction(), llvm::IRTranslator::runOnMachineFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::InsertNOPLoad::runOnMachineFunction(), llvm::FixAllFDIVSQRT::runOnMachineFunction(), scavengeFrameVirtualRegsInBlock(), signOutlinedFunction(), sizeWithoutDebugLargerThan(), skipBackwardPastNonInstructions(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), splitBlockForLoop(), llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander(), verifyCTRBranch(), llvm::MemorySSA::verifyOrderingDominationAndDefUses(), and VerifyPHIs().

◆ begin() [2/2]

const_iterator llvm::MachineBasicBlock::begin ( ) const
inline

Definition at line 330 of file MachineBasicBlock.h.

References instr_begin().

◆ canFallThrough()

bool MachineBasicBlock::canFallThrough ( )

Return true if the block can implicitly transfer control to the block after it by falling off the end of it.

This should return false if it can reach the block after it, but it uses an explicit branch to do so (e.g., a table jump). True is a conservative answer.

Definition at line 1013 of file MachineBasicBlock.cpp.

References getFallThrough().

Referenced by AlignBlocks(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), isImplicitFallthrough(), ProfitableToMerge(), and llvm::TailDuplicator::shouldTailDuplicate().

◆ canSplitCriticalEdge()

bool MachineBasicBlock::canSplitCriticalEdge ( const MachineBasicBlock Succ) const

Check if the edge between this block and the given successor Succ, can be split.

If this returns true a subsequent call to SplitCriticalEdge is guaranteed to return a valid basic block if no changes occurred in the meantime.

Definition at line 1359 of file MachineBasicBlock.cpp.

References llvm::HexagonInstrInfo::analyzeBranch(), Cond, llvm::dbgs(), findJumpTableIndex(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), isEHPad(), isInlineAsmBrIndirectTarget(), jumpTableHasOtherUses(), LLVM_DEBUG, llvm::printMBBReference(), llvm::TargetMachine::requiresStructuredCFG(), TBB, and TII.

Referenced by SplitCriticalEdge().

◆ clear()

void llvm::MachineBasicBlock::clear ( )
inline

Definition at line 1059 of file MachineBasicBlock.h.

Referenced by llvm::InstructionSelect::runOnMachineFunction().

◆ clearBasicBlock()

void llvm::MachineBasicBlock::clearBasicBlock ( )
inline

Remove the reference to the underlying IR BasicBlock.

This is for reduction tools and should generally not be used.

Definition at line 237 of file MachineBasicBlock.h.

◆ clearLiveIns()

void MachineBasicBlock::clearLiveIns ( )

Clear live in list.

Definition at line 1719 of file MachineBasicBlock.cpp.

Referenced by llvm::recomputeLiveIns().

◆ computeRegisterLiveness()

MachineBasicBlock::LivenessQueryResult MachineBasicBlock::computeRegisterLiveness ( const TargetRegisterInfo TRI,
MCRegister  Reg,
const_iterator  Before,
unsigned  Neighborhood = 10 
) const

Return whether (physical) register Reg has been defined and not killed as of just before Before.

Return whether (physical) register "Reg" has been <def>ined and not <kill>ed as of just before "MI".

Search is localised to a neighborhood of Neighborhood instructions before (searching for defs or kills) and Neighborhood instructions after (searching just for defs) Before.

Reg must be a physical register.

Search is localised to a neighborhood of Neighborhood instructions before (searching for defs or kills) and N instructions after (searching just for defs) MI.

Definition at line 1608 of file MachineBasicBlock.cpp.

References llvm::AnalyzePhysRegInBundle(), Before, begin(), end(), I, Info, liveins(), LQR_Dead, LQR_Live, LQR_Unknown, N, successors(), and TRI.

Referenced by llvm::Thumb1InstrInfo::copyPhysReg(), loadMBUFScalarOperandsFromVGPR(), and llvm::X86InstrInfo::reMaterialize().

◆ copySuccessor()

void MachineBasicBlock::copySuccessor ( const MachineBasicBlock Orig,
succ_iterator  I 
)

Copy a successor (and any probability info) from original block to this block's.

Uses an iterator into the original blocks successors.

This is useful when doing a partial clone of successors. Afterward, the probabilities may need to be normalized.

Definition at line 891 of file MachineBasicBlock.cpp.

References addSuccessor(), addSuccessorWithoutProb(), getSuccProbability(), and I.

◆ dump()

LLVM_DUMP_METHOD void MachineBasicBlock::dump ( ) const

◆ empty()

bool llvm::MachineBasicBlock::empty ( ) const
inline

Definition at line 301 of file MachineBasicBlock.h.

Referenced by llvm::SPIRVInstrInfo::analyzeBranch(), blockEndsInUnreachable(), bothUsedInPHI(), llvm::calculateDbgEntityHistory(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::CreateEmptyPHI(), dominatesAllUsesOf(), llvm::MipsAsmPrinter::emitBasicBlockEnd(), llvm::SIFrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::AsmPrinter::emitFunctionBody(), llvm::findPHICopyInsertPoint(), generateAssignInstrs(), getBBAddrMapMetadata(), getFallThrough(), getNextMachineInstr(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::AArch64InstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), llvm::SlotIndexes::insertMBBInMaps(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), isEHScopeReturnBlock(), isImplicitFallthrough(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), isReturnBlock(), jumpTableFollowsTB(), llvm::Legalizer::legalizeMachineFunction(), LookForIdenticalPHI(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::X86CallLowering::lowerFormalArguments(), performSink(), llvm::MIPrinter::print(), processSwitches(), llvm::InstructionSelect::runOnMachineFunction(), llvm::GCNRegPressurePrinter::runOnMachineFunction(), llvm::scavengeFrameVirtualRegs(), llvm::TailDuplicator::shouldTailDuplicate(), llvm::FastISel::startNewBlock(), and llvm::UpgradeDataLayoutString().

◆ end() [1/2]

iterator llvm::MachineBasicBlock::end ( )
inline

Definition at line 331 of file MachineBasicBlock.h.

References instr_end().

Referenced by addLiveIn(), llvm::LiveVariables::addNewBlock(), llvm::ScheduleDAGInstrs::addSchedBarrierDeps(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::RegPressureTracker::advance(), llvm::R600InstrInfo::analyzeBranch(), llvm::ARCInstrInfo::analyzeBranch(), llvm::BPFInstrInfo::analyzeBranch(), llvm::LoongArchInstrInfo::analyzeBranch(), llvm::MSP430InstrInfo::analyzeBranch(), llvm::NVPTXInstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::RISCVInstrInfo::analyzeBranch(), llvm::SystemZInstrInfo::analyzeBranch(), llvm::XCoreInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::SIInstrInfo::analyzeBranch(), llvm::CSKYInstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::LanaiInstrInfo::analyzeBranch(), llvm::SIInstrInfo::analyzeBranchImpl(), llvm::AArch64InstrInfo::analyzeBranchPredicate(), llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::HexagonInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), appendEndToFunction(), llvm::CombinerHelper::applyExtendThroughPhis(), back(), blockEndIsUnreachable(), llvm::BuildMI(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), llvm::RISCVInstrInfo::buildOutlinedFrame(), llvm::X86InstrInfo::buildOutlinedFrame(), llvm::SIRegisterInfo::buildSpillLoadStore(), checkAndUpdateCCRKill(), checkAndUpdateCPSRKill(), checkCCKill(), checkEFLAGSLive(), clearKillFlags(), ComputeCommonTailLength(), computeRegisterLiveness(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), CountTerminators(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::CreateEmptyPHI(), llvm::SIInstrInfo::createPHIDestinationCopy(), llvm::SIInstrInfo::createPHISourceCopy(), dominates(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::X86RegisterInfo::eliminateFrameIndex(), emitAlignedDPRCS2Restores(), emitAlignedDPRCS2Spills(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::X86AsmPrinter::emitBasicBlockEnd(), llvm::AsmPrinter::emitCFIInstruction(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::LoongArchFrameLowering::emitEpilogue(), llvm::M68kFrameLowering::emitEpilogue(), llvm::Mips16FrameLowering::emitEpilogue(), llvm::MipsSEFrameLowering::emitEpilogue(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::WebAssemblyFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::AsmPrinter::emitFunctionBody(), llvm::SITargetLowering::emitGWSMemViolTestLoop(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), emitLoadScalarOpsFromVGPRLoop(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), llvm::AArch64FrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::M68kFrameLowering::emitPrologue(), llvm::MSP430FrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::SystemZXPLINKFrameLowering::emitPrologue(), llvm::WebAssemblyFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), emitReadCounterWidePseudo(), llvm::ScheduleDAGSDNodes::EmitSchedule(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), llvm::VETargetLowering::emitSjLjDispatchBlock(), emitVecCondBranchPseudo(), emitXBegin(), llvm::RegScavenger::enterBasicBlockEnd(), llvm::ScheduleDAGMILive::enterRegion(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::SPIRVTargetLowering::finalizeLowering(), findBranchDebugLoc(), llvm::WebAssembly::findCatch(), llvm::X86RegisterInfo::findDeadCallerSavedReg(), findDeadCallerSavedReg(), findHoistingInsertPosAndDeps(), findIncDecAfter(), findIncDecBefore(), findJumpTableIndex(), FindLastAluClause(), findNextInsertLocation(), findSurvivorBackwards(), llvm::fixStackStores(), fixupPHIOpBanks(), forEachJumpTableBranch(), generateAssignInstrs(), llvm::rdf::Liveness::getAllReachingDefs(), getArgumentStackToRestore(), getBranchDebugLoc(), llvm::RegPressureTracker::getCurrSlot(), getEarliestInsertPos(), llvm::getEHScopeMembership(), getFallThrough(), getFirstNonDebugInstr(), getFirstNonPrologue(), getFirstTerminator(), llvm::InsertPointAnalysis::getLastInsertPointIter(), getLastNonDebugInstr(), getLatestInsertPos(), llvm::ReachingDefAnalysis::getLiveInUses(), llvm::ReachingDefAnalysis::getLocalLiveOutMIDef(), getNextFPInstruction(), getNextMachineInstr(), llvm::ARMBasicBlockUtils::getOffsetOf(), getOrCreateFrameHelper(), getPreviousInstr(), llvm::ReachingDefAnalysis::getReachingLocalUses(), llvm::PhiLoweringHelper::getSaluInsertionAtEnd(), getSchedRegions(), llvm::X86InstrInfo::getSPAdjust(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::guessSuccessors(), handleADRP(), HashEndOfMBB(), hasTailCall(), llvm::GCNSchedStage::initGCNRegion(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::X86FrameLowering::inlineStackProbe(), insert(), insertAfter(), llvm::R600InstrInfo::insertBranch(), llvm::HexagonInstrInfo::insertBranch(), insertDivByZeroTrap(), llvm::AArch64InstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertReturn(), IsBetterFallthrough(), IsBranchOnlyBlock(), isEFLAGSLiveAfter(), IsEmptyBlock(), llvm::Thumb2InstrInfo::isLegalToSplitMBBAt(), llvm::TargetInstrInfo::isMBBSafeToOutlineFrom(), llvm::CombinerHelper::isPredecessor(), llvm::ReachingDefAnalysis::isReachingDefLiveOut(), llvm::ReachingDefAnalysis::isRegDefinedAfter(), llvm::ReachingDefAnalysis::isSafeToDefRegAt(), isSafeToMove(), llvm::AArch64InstrInfo::isSchedulingBoundary(), llvm::ARMBaseInstrInfo::isSchedulingBoundary(), llvm::TailDuplicator::isSimpleBB(), llvm::SIInstrInfo::legalizeOperands(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), llvm::SystemZInstrInfo::loadImmediate(), llvm::XCoreInstrInfo::loadImmediate(), loadMBUFScalarOperandsFromVGPR(), llvm::Mips16InstrInfo::loadRegFromStack(), llvm::MipsSEInstrInfo::loadRegFromStack(), llvm::SystemZInstrInfo::loadRegFromStackSlot(), llvm::ARMBaseInstrInfo::loadRegFromStackSlot(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), llvm::BPFInstrInfo::loadRegFromStackSlot(), llvm::SparcInstrInfo::loadRegFromStackSlot(), llvm::VEInstrInfo::loadRegFromStackSlot(), llvm::MSP430InstrInfo::loadRegFromStackSlot(), llvm::CSKYInstrInfo::loadRegFromStackSlot(), llvm::XCoreInstrInfo::loadRegFromStackSlot(), llvm::LanaiInstrInfo::loadRegFromStackSlot(), llvm::PPCInstrInfo::loadRegFromStackSlotNoUpd(), LookForIdenticalPHI(), LowerFPToInt(), lowerWaveReduce(), llvm::MachineInstrSpan::MachineInstrSpan(), llvm::CombinerHelper::matchOptBrCondByInvertingCond(), llvm::AArch64RegisterInfo::materializeFrameBaseRegister(), llvm::SIRegisterInfo::materializeFrameBaseRegister(), llvm::ARMBaseRegisterInfo::materializeFrameBaseRegister(), llvm::PPCRegisterInfo::materializeFrameBaseRegister(), llvm::RISCVRegisterInfo::materializeFrameBaseRegister(), maybeRewriteToFallthrough(), mergeOperations(), llvm::M68kFrameLowering::mergeSPUpdates(), llvm::X86FrameLowering::mergeSPUpdates(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), MoveVPNOTBeforeFirstUser(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::PeelSingleBlockLoop(), performSink(), llvm::ScheduleDAGMI::placeDebugValues(), popRegsFromStack(), llvm::SystemZInstrInfo::prepareCompareSwapOperands(), PrevCrossBBInst(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::AArch64FrameLowering::processFunctionBeforeFrameFinalized(), ProfitableToMerge(), llvm::SIInstrInfo::reMaterialize(), llvm::AArch64InstrInfo::removeBranch(), llvm::R600InstrInfo::removeBranch(), llvm::ARCInstrInfo::removeBranch(), llvm::ARMBaseInstrInfo::removeBranch(), llvm::BPFInstrInfo::removeBranch(), llvm::CSKYInstrInfo::removeBranch(), llvm::HexagonInstrInfo::removeBranch(), llvm::LanaiInstrInfo::removeBranch(), llvm::LoongArchInstrInfo::removeBranch(), llvm::M68kInstrInfo::removeBranch(), llvm::MSP430InstrInfo::removeBranch(), llvm::NVPTXInstrInfo::removeBranch(), llvm::PPCInstrInfo::removeBranch(), llvm::RISCVInstrInfo::removeBranch(), llvm::SparcInstrInfo::removeBranch(), llvm::SystemZInstrInfo::removeBranch(), llvm::VEInstrInfo::removeBranch(), llvm::X86InstrInfo::removeBranch(), llvm::XCoreInstrInfo::removeBranch(), removeImplicitFallthroughs(), llvm::SlotIndexes::repairIndexesInRange(), llvm::RegBankSelect::RepairingPlacement::RepairingPlacement(), llvm::LiveIntervals::repairIntervalsInRange(), llvm::X86InstrInfo::replaceBranchWithTailCall(), llvm::PPCFrameLowering::replaceFPWithRealFP(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::SystemZELFFrameLowering::restoreCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::restoreCalleeSavedRegisters(), llvm::AArch64FrameLowering::restoreCalleeSavedRegisters(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::CSKYFrameLowering::restoreCalleeSavedRegisters(), llvm::MSP430FrameLowering::restoreCalleeSavedRegisters(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), llvm::Mips16InstrInfo::restoreFrame(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), rollbackRestoreSplit(), llvm::InstructionSelect::runOnMachineFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::InsertNOPLoad::runOnMachineFunction(), llvm::FixAllFDIVSQRT::runOnMachineFunction(), scavengeFrameVirtualRegsInBlock(), llvm::RegScavenger::scavengeRegisterBackwards(), llvm::PPCInstrInfo::shouldReduceRegisterPressure(), shouldUseFrameHelper(), sizeWithoutDebugLargerThan(), skipBackwardPastNonInstructions(), SkipPHIsAndLabels(), SkipPHIsLabelsAndDebug(), llvm::CSKYFrameLowering::spillCalleeSavedRegisters(), llvm::MSP430FrameLowering::spillCalleeSavedRegisters(), llvm::RISCVFrameLowering::spillCalleeSavedRegisters(), llvm::XCoreFrameLowering::spillCalleeSavedRegisters(), llvm::SIRegisterInfo::spillEmergencySGPR(), split(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), splitBlockForLoop(), SplitCriticalEdge(), splitMBB(), llvm::Mips16InstrInfo::storeRegToStack(), llvm::Thumb1InstrInfo::storeRegToStackSlot(), llvm::Thumb2InstrInfo::storeRegToStackSlot(), llvm::BPFInstrInfo::storeRegToStackSlot(), llvm::SparcInstrInfo::storeRegToStackSlot(), llvm::SystemZInstrInfo::storeRegToStackSlot(), llvm::VEInstrInfo::storeRegToStackSlot(), llvm::CSKYInstrInfo::storeRegToStackSlot(), llvm::MSP430InstrInfo::storeRegToStackSlot(), llvm::XCoreInstrInfo::storeRegToStackSlot(), llvm::LanaiInstrInfo::storeRegToStackSlot(), terminators(), llvm::ScheduleDAGMILive::updatePressureDiffs(), llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander(), verifyCFIntrinsic(), verifyCTRBranch(), llvm::MemorySSA::verifyOrderingDominationAndDefUses(), and VerifyPHIs().

◆ end() [2/2]

const_iterator llvm::MachineBasicBlock::end ( ) const
inline

Definition at line 332 of file MachineBasicBlock.h.

References instr_end().

◆ erase() [1/4]

Remove an instruction from the instruction list and delete it.

If the instruction is part of a bundle, the other instructions in the bundle will still be bundled after removing the single instruction.

Definition at line 1418 of file MachineBasicBlock.cpp.

References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase(), I, and unbundleSingleMI().

Referenced by llvm::BPFInstrInfo::analyzeBranch(), llvm::MSP430InstrInfo::analyzeBranch(), llvm::SystemZInstrInfo::analyzeBranch(), llvm::LanaiInstrInfo::analyzeBranch(), convertCalleeSaveRestoreToSPPrePostIncDec(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), llvm::AArch64FrameLowering::eliminateCallFramePseudoInstr(), llvm::ARCFrameLowering::eliminateCallFramePseudoInstr(), llvm::HexagonFrameLowering::eliminateCallFramePseudoInstr(), llvm::LanaiFrameLowering::eliminateCallFramePseudoInstr(), llvm::MipsFrameLowering::eliminateCallFramePseudoInstr(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::NVPTXFrameLowering::eliminateCallFramePseudoInstr(), llvm::PPCFrameLowering::eliminateCallFramePseudoInstr(), llvm::SparcFrameLowering::eliminateCallFramePseudoInstr(), llvm::VEFrameLowering::eliminateCallFramePseudoInstr(), llvm::WebAssemblyFrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::Thumb1FrameLowering::eliminateCallFramePseudoInstr(), llvm::CSKYFrameLowering::eliminateCallFramePseudoInstr(), llvm::LoongArchFrameLowering::eliminateCallFramePseudoInstr(), llvm::M68kFrameLowering::eliminateCallFramePseudoInstr(), llvm::RISCVFrameLowering::eliminateCallFramePseudoInstr(), llvm::SystemZFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreRegisterInfo::eliminateFrameIndex(), llvm::CSKYRegisterInfo::eliminateFrameIndex(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), erase(), erase_instr(), llvm::MachineInstr::eraseFromParent(), llvm::AArch64InstrInfo::expandPostRAPseudo(), llvm::R600InstrInfo::expandPostRAPseudo(), llvm::HexagonInstrInfo::expandPostRAPseudo(), llvm::Mips16InstrInfo::expandPostRAPseudo(), llvm::MipsSEInstrInfo::expandPostRAPseudo(), llvm::HexagonInstrInfo::expandVGatherPseudo(), INITIALIZE_PASS(), insertSEH(), llvm::PPCRegisterInfo::lowerACCRestore(), llvm::PPCRegisterInfo::lowerACCSpilling(), llvm::PPCRegisterInfo::lowerCRBitRestore(), llvm::PPCRegisterInfo::lowerCRBitSpilling(), llvm::PPCRegisterInfo::lowerCRRestore(), llvm::PPCRegisterInfo::lowerCRSpilling(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::PPCRegisterInfo::lowerDynamicAreaOffset(), llvm::PPCRegisterInfo::lowerOctWordSpilling(), llvm::PPCRegisterInfo::lowerPrepareProbedAlloca(), llvm::PPCRegisterInfo::lowerQuadwordRestore(), llvm::PPCRegisterInfo::lowerQuadwordSpilling(), llvm::PPCRegisterInfo::lowerWACCRestore(), llvm::PPCRegisterInfo::lowerWACCSpilling(), llvm::M68kFrameLowering::mergeSPUpdates(), llvm::X86FrameLowering::mergeSPUpdates(), popRegsFromStack(), llvm::HexagonInstrInfo::removeBranch(), removeDebugInstrs(), replaceFrameIndex(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::ThumbRegisterInfo::rewriteFrameIndex(), and rollbackRestoreSplit().

◆ erase() [2/4]

iterator llvm::MachineBasicBlock::erase ( iterator  I)
inline

Remove an instruction or bundle from the instruction list and delete it.

If I points to a bundle of instructions, they are all erased.

Definition at line 1030 of file MachineBasicBlock.h.

References erase(), and I.

◆ erase() [3/4]

iterator llvm::MachineBasicBlock::erase ( iterator  I,
iterator  E 
)
inline

Remove a range of instructions from the instruction list and delete them.

Definition at line 1023 of file MachineBasicBlock.h.

References E, and I.

◆ erase() [4/4]

iterator llvm::MachineBasicBlock::erase ( MachineInstr I)
inline

Remove an instruction from the instruction list and delete it.

If I is the head of a bundle of instructions, the whole bundle will be erased.

Definition at line 1038 of file MachineBasicBlock.h.

References erase(), and I.

◆ erase_instr()

instr_iterator llvm::MachineBasicBlock::erase_instr ( MachineInstr I)
inline

Remove an instruction from the instruction list and delete it.

If the instruction is part of a bundle, the other instructions in the bundle will still be bundled after removing the single instruction.

Definition at line 1018 of file MachineBasicBlock.h.

References erase(), and I.

Referenced by llvm::MachineInstr::eraseFromBundle().

◆ eraseFromParent()

void MachineBasicBlock::eraseFromParent ( )

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

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

Definition at line 1451 of file MachineBasicBlock.cpp.

References assert(), llvm::MachineFunction::erase(), and getParent().

Referenced by llvm::X86TargetLowering::EmitKCFICheck(), eraseDeadBBsAndChildren(), processSwitches(), llvm::Thumb2InstrInfo::ReplaceTailWithBranchTo(), rollbackRestoreSplit(), and GCEmptyBasicBlocks::runOnMachineFunction().

◆ findBranchDebugLoc()

DebugLoc MachineBasicBlock::findBranchDebugLoc ( )

Find and return the merged DebugLoc of the branch instructions of the block.

Return UnknownLoc if there is none.

Definition at line 1535 of file MachineBasicBlock.cpp.

References DL, end(), getFirstTerminator(), and llvm::DILocation::getMergedLocation().

Referenced by FixTail(), llvm::MIRProfileLoader::setBranchProbs(), updateBranches(), updateTerminator(), and updateTerminator().

◆ findDebugLoc() [1/2]

DebugLoc MachineBasicBlock::findDebugLoc ( instr_iterator  MBBI)

Find the next valid DebugLoc starting at MBBI, skipping any debug instructions.

Return UnknownLoc if there is none.

Definition at line 1492 of file MachineBasicBlock.cpp.

References instr_end(), MBBI, and llvm::skipDebugInstructionsForward().

Referenced by llvm::R600InstrInfo::buildDefaultInstruction(), emitCalleeSavedRestores(), llvm::AArch64TargetLowering::EmitDynamicProbedAlloc(), llvm::ARCFrameLowering::emitEpilogue(), emitGPDisp(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::M68kFrameLowering::emitSPUpdate(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::VEInstrInfo::expandGetStackTopPseudo(), llvm::SIInstrInfo::expandMovDPP64(), llvm::SIInstrInfo::expandPostRAPseudo(), findDebugLoc(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::X86FrameLowering::inlineStackProbe(), llvm::SIInstrInfo::insertNoops(), llvm::SIInstrInfo::legalizeOpWithMove(), llvm::ARCInstrInfo::loadImmediate(), llvm::HexagonInstrInfo::loadRegFromStackSlot(), llvm::SIInstrInfo::loadRegFromStackSlot(), llvm::ARCInstrInfo::loadRegFromStackSlot(), llvm::M68kInstrInfo::loadRegFromStackSlot(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::X86InstrInfo::replaceBranchWithTailCall(), llvm::M68kFrameLowering::restoreCalleeSavedRegisters(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), rfindDebugLoc(), llvm::M68kFrameLowering::spillCalleeSavedRegisters(), llvm::X86FrameLowering::spillCalleeSavedRegisters(), llvm::HexagonInstrInfo::storeRegToStackSlot(), llvm::SIInstrInfo::storeRegToStackSlot(), llvm::ARCInstrInfo::storeRegToStackSlot(), and llvm::M68kInstrInfo::storeRegToStackSlot().

◆ findDebugLoc() [2/2]

DebugLoc llvm::MachineBasicBlock::findDebugLoc ( iterator  MBBI)
inline

Definition at line 1102 of file MachineBasicBlock.h.

References findDebugLoc(), and MBBI.

◆ findPrevDebugLoc() [1/2]

DebugLoc MachineBasicBlock::findPrevDebugLoc ( instr_iterator  MBBI)

Find the previous valid DebugLoc preceding MBBI, skipping any debug instructions.

It is possible to find the last DebugLoc in the MBB using findPrevDebugLoc(instr_end()). Return UnknownLoc if there is none.

Return UnknownLoc if there is none.

Definition at line 1512 of file MachineBasicBlock.cpp.

References instr_begin(), MBBI, and llvm::prev_nodbg().

Referenced by appendEndToFunction(), and findPrevDebugLoc().

◆ findPrevDebugLoc() [2/2]

DebugLoc llvm::MachineBasicBlock::findPrevDebugLoc ( iterator  MBBI)
inline

Definition at line 1118 of file MachineBasicBlock.h.

References findPrevDebugLoc(), and MBBI.

◆ front() [1/2]

MachineInstr & llvm::MachineBasicBlock::front ( )
inline

◆ front() [2/2]

const MachineInstr & llvm::MachineBasicBlock::front ( ) const
inline

Definition at line 310 of file MachineBasicBlock.h.

◆ getAddressTakenIRBlock()

BasicBlock * llvm::MachineBasicBlock::getAddressTakenIRBlock ( ) const
inline

Retrieves the BasicBlock which corresponds to this MachineBasicBlock.

Definition at line 266 of file MachineBasicBlock.h.

Referenced by llvm::AsmPrinter::emitBasicBlockStart(), and printName().

◆ getAlignment()

Align llvm::MachineBasicBlock::getAlignment ( ) const
inline

◆ getBasicBlock()

const BasicBlock * llvm::MachineBasicBlock::getBasicBlock ( ) const
inline

Return the LLVM basic block that this instance corresponded to originally.

Note that this may be NULL if this instance does not correspond directly to an LLVM basic block.

Definition at line 233 of file MachineBasicBlock.h.

Referenced by llvm::MachineFunction::addLandingPad(), llvm::AArch64PAuth::checkAuthenticatedRegister(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::SystemZ::emitBlockAfter(), llvm::SelectionDAGBuilder::EmitBranchForMergedCondition(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitReadCounterWidePseudo(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), emitVecCondBranchPseudo(), emitXBegin(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::FastISel::fastEmitBranch(), llvm::SelectionDAGBuilder::FindMergedConditions(), llvm::FastISel::finishCondBranch(), getBranchHint(), getFullName(), llvm::MachineLoop::getLoopID(), getName(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), insertDivByZeroTrap(), LowerFPToInt(), llvm::WebAssemblyException::print(), printName(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::SelectionDAG::shouldOptForSize(), llvm::shouldOptForSize(), splitAt(), and splitMBB().

◆ getBBID()

std::optional< UniqueBBID > llvm::MachineBasicBlock::getBBID ( ) const
inline

◆ getBeginClobberMask()

const uint32_t * MachineBasicBlock::getBeginClobberMask ( const TargetRegisterInfo TRI) const

Get the clobber mask for the start of this basic block.

Funclets use this to prevent register allocation across funclet transitions.

Definition at line 1706 of file MachineBasicBlock.cpp.

References isEHFuncletEntry(), and TRI.

◆ getCallFrameSize()

unsigned llvm::MachineBasicBlock::getCallFrameSize ( ) const
inline

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

Definition at line 1179 of file MachineBasicBlock.h.

Referenced by llvm::TargetInstrInfo::getCallFrameSizeAt(), and SplitCriticalEdge().

◆ getEHCatchretSymbol()

MCSymbol * MachineBasicBlock::getEHCatchretSymbol ( ) const

◆ getEndClobberMask()

const uint32_t * MachineBasicBlock::getEndClobberMask ( const TargetRegisterInfo TRI) const

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

See also
getBeginClobberMask()

Definition at line 1712 of file MachineBasicBlock.cpp.

References isReturnBlock(), succ_empty(), and TRI.

◆ getEndSymbol()

MCSymbol * MachineBasicBlock::getEndSymbol ( ) const

◆ getFallThrough()

MachineBasicBlock * MachineBasicBlock::getFallThrough ( bool  JumpToFallThrough = true)

◆ getFirstInstrTerminator()

MachineBasicBlock::instr_iterator MachineBasicBlock::getFirstInstrTerminator ( )

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

Definition at line 251 of file MachineBasicBlock.cpp.

References B, E, I, instr_begin(), and instr_end().

Referenced by llvm::PeelingModuloScheduleExpander::filterInstructions(), signOutlinedFunction(), and SplitCriticalEdge().

◆ getFirstNonDebugInstr() [1/2]

MachineBasicBlock::iterator MachineBasicBlock::getFirstNonDebugInstr ( bool  SkipPseudoOp = true)

Returns an iterator to the first non-debug instruction in the basic block, or end().

Skip any pseudo probe operation if SkipPseudoOp is true. Pseudo probes are like debug instructions which do not turn into real machine code. We try to use the function to skip both debug instructions and pseudo probe operations to avoid API proliferation. This should work most of the time when considering optimizing the rest of code in the block, except for certain cases where pseudo probes are designed to block the optimizations. For example, code merge like optimizations are supposed to be blocked by pseudo probes for better AutoFDO profile quality. Therefore, they should be considered as a valid instruction when this function is called in a context of such optimizations. On the other hand, SkipPseudoOp should be true when it's used in optimizations that unlikely hurt profile quality, e.g., without block merging. The default value of SkipPseudoOp is set to true to maximize code quality in general, with an explict false value passed in in a few places like branch folding and if-conversion to favor profile quality.

Definition at line 265 of file MachineBasicBlock.cpp.

References begin(), end(), and llvm::skipDebugInstructionsForward().

Referenced by getFirstNonDebugInstr(), IsBranchOnlyBlock(), IsEmptyBlock(), llvm::TargetInstrInfo::isMBBSafeToOutlineFrom(), and llvm::TailDuplicator::isSimpleBB().

◆ getFirstNonDebugInstr() [2/2]

const_iterator llvm::MachineBasicBlock::getFirstNonDebugInstr ( bool  SkipPseudoOp = true) const
inline

Definition at line 893 of file MachineBasicBlock.h.

References getFirstNonDebugInstr().

◆ getFirstNonPHI() [1/2]

MachineBasicBlock::iterator MachineBasicBlock::getFirstNonPHI ( )

◆ getFirstNonPHI() [2/2]

const_iterator llvm::MachineBasicBlock::getFirstNonPHI ( ) const
inline

Definition at line 844 of file MachineBasicBlock.h.

References getFirstNonPHI().

◆ getFirstTerminator() [1/2]

MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator ( )

Returns an iterator to the first terminator instruction of this basic block.

If a terminator does not exist, it returns end().

Definition at line 242 of file MachineBasicBlock.cpp.

References B, begin(), E, end(), and I.

Referenced by llvm::SIInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeLoopForPipelining(), llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::HexagonInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), copyDebugInfoToPredecessor(), llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitEpilogue(), llvm::ARCFrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::LoongArchFrameLowering::emitEpilogue(), llvm::M68kFrameLowering::emitEpilogue(), llvm::Mips16FrameLowering::emitEpilogue(), llvm::MipsSEFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::WebAssemblyFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::ScheduleDAGSDNodes::EmitSchedule(), findBranchDebugLoc(), findHoistingInsertPosAndDeps(), findInsertLocation(), findJumpTableIndex(), llvm::findPHICopyInsertPoint(), llvm::findSplitPointForStackProtector(), forEachJumpTableBranch(), llvm::getEHScopeMembership(), getFirstTerminator(), llvm::SITargetLowering::getPrefLoopAlignment(), llvm::PhiLoweringHelper::getSaluInsertionAtEnd(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::HexagonInstrInfo::insertBranch(), insertCSRRestores(), llvm::SIInstrInfo::insertReturn(), insertUndefLaneMask(), llvm::SystemZPostRASchedStrategy::leaveMBB(), llvm::SIInstrInfo::legalizeOperands(), llvm::LegalizerHelper::moreElementsVectorPhi(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::SelectionDAGISel::runOnMachineFunction(), SplitCriticalEdge(), splitMBB(), and terminators().

◆ getFirstTerminator() [2/2]

const_iterator llvm::MachineBasicBlock::getFirstTerminator ( ) const
inline

Definition at line 863 of file MachineBasicBlock.h.

References getFirstTerminator().

◆ getFirstTerminatorForward()

MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminatorForward ( )

Finds the first terminator in a block by scanning forward.

This can handle cases in GlobalISel where there may be non-terminator instructions between terminators, for which getFirstTerminator() will not work correctly.

Definition at line 260 of file MachineBasicBlock.cpp.

References llvm::find_if(), and instrs().

Referenced by llvm::LegalizerHelper::fewerElementsVectorPhi(), llvm::LegalizerHelper::narrowScalar(), and llvm::LegalizerHelper::widenScalar().

◆ getFullName()

std::string MachineBasicBlock::getFullName ( ) const

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

Return a hopefully unique identifier for this block.

Definition at line 326 of file MachineBasicBlock.cpp.

References getBasicBlock(), llvm::MachineFunction::getName(), llvm::Value::getName(), getNumber(), getParent(), and Name.

Referenced by llvm::ARMBlockPlacement::fixBackwardsWLS(), llvm::ScheduleDAGInstrs::getDAGName(), llvm::ScheduleDAGSDNodes::getDAGName(), and verifyCTRBranch().

◆ getIrrLoopHeaderWeight()

std::optional< uint64_t > llvm::MachineBasicBlock::getIrrLoopHeaderWeight ( ) const
inline

Definition at line 1189 of file MachineBasicBlock.h.

◆ getLastNonDebugInstr() [1/2]

MachineBasicBlock::iterator MachineBasicBlock::getLastNonDebugInstr ( bool  SkipPseudoOp = true)

Returns an iterator to the last non-debug instruction in the basic block, or end().

Skip any pseudo operation if SkipPseudoOp is true. Pseudo probes are like debug instructions which do not turn into real machine code. We try to use the function to skip both debug instructions and pseudo probe operations to avoid API proliferation. This should work most of the time when considering optimizing the rest of code in the block, except for certain cases where pseudo probes are designed to block the optimizations. For example, code merge like optimizations are supposed to be blocked by pseudo probes for better AutoFDO profile quality. Therefore, they should be considered as a valid instruction when this function is called in a context of such optimizations. On the other hand, SkipPseudoOp should be true when it's used in optimizations that unlikely hurt profile quality, e.g., without block merging. The default value of SkipPseudoOp is set to true to maximize code quality in general, with an explict false value passed in in a few places like branch folding and if-conversion to favor profile quality.

Definition at line 271 of file MachineBasicBlock.cpp.

References B, end(), I, instr_begin(), and instr_end().

Referenced by llvm::R600InstrInfo::analyzeBranch(), llvm::LoongArchInstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::RISCVInstrInfo::analyzeBranch(), llvm::XCoreInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::CSKYInstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::SPIRVInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranchPredicate(), llvm::X86AsmPrinter::emitBasicBlockEnd(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::LanaiFrameLowering::emitEpilogue(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::SparcFrameLowering::emitEpilogue(), llvm::SystemZELFFrameLowering::emitEpilogue(), llvm::SystemZXPLINKFrameLowering::emitEpilogue(), llvm::VEFrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitEpilogue(), getArgumentStackToRestore(), getBranchDebugLoc(), getLastNonDebugInstr(), llvm::ReachingDefAnalysis::getLiveInUses(), llvm::ReachingDefAnalysis::getLocalLiveOutMIDef(), llvm::guessSuccessors(), HashEndOfMBB(), hasTailCall(), IsBetterFallthrough(), llvm::TargetInstrInfo::isMBBSafeToOutlineFrom(), llvm::SystemZInstrInfo::isProfitableToIfCvt(), llvm::ReachingDefAnalysis::isReachingDefLiveOut(), llvm::ReachingDefAnalysis::isRegDefinedAfter(), llvm::AArch64InstrInfo::removeBranch(), llvm::ARCInstrInfo::removeBranch(), llvm::ARMBaseInstrInfo::removeBranch(), llvm::CSKYInstrInfo::removeBranch(), llvm::LoongArchInstrInfo::removeBranch(), llvm::PPCInstrInfo::removeBranch(), llvm::RISCVInstrInfo::removeBranch(), llvm::XCoreInstrInfo::removeBranch(), llvm::RegBankSelect::RepairingPlacement::RepairingPlacement(), llvm::restoreStatusRegister(), and verifyCTRBranch().

◆ getLastNonDebugInstr() [2/2]

const_iterator llvm::MachineBasicBlock::getLastNonDebugInstr ( bool  SkipPseudoOp = true) const
inline

Definition at line 915 of file MachineBasicBlock.h.

References getLastNonDebugInstr().

◆ getLiveIns()

std::vector< RegisterMaskPair > llvm::MachineBasicBlock::getLiveIns ( ) const
inline

Definition at line 480 of file MachineBasicBlock.h.

Referenced by llvm::recomputeLiveIns().

◆ getLogicalFallThrough()

MachineBasicBlock * llvm::MachineBasicBlock::getLogicalFallThrough ( )
inline

Return the fallthrough block if the block can implicitly transfer control to it's successor, whether by a branch or a fallthrough.

Non-null return is a conservative answer.

Definition at line 829 of file MachineBasicBlock.h.

References getFallThrough().

◆ getMaxBytesForAlignment()

unsigned llvm::MachineBasicBlock::getMaxBytesForAlignment ( ) const
inline

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

Definition at line 593 of file MachineBasicBlock.h.

Referenced by llvm::AsmPrinter::emitBasicBlockStart().

◆ getName()

StringRef MachineBasicBlock::getName ( ) const

◆ getNumber()

int llvm::MachineBasicBlock::getNumber ( ) const
inline

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

Definition at line 1175 of file MachineBasicBlock.h.

References Number.

Referenced by llvm::LiveVariables::addNewBlock(), llvm::ARMBasicBlockUtils::adjustBBOffsetsAfter(), assignSections(), llvm::SwitchCG::SwitchLowering::buildBitTests(), llvm::LiveIntervals::checkRegMaskInterference(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::AMDGPUAsmPrinter::emitBasicBlockStart(), llvm::AsmPrinter::emitJumpTableInfo(), llvm::SwitchCG::SwitchLowering::findBitTestClusters(), llvm::WebAssembly::SortRegionInfo::getBottom(), llvm::MachineTraceMetrics::Ensemble::getDepthResources(), getEHCatchretSymbol(), llvm::getEHScopeMembership(), getEndSymbol(), getFullName(), llvm::MachineTraceMetrics::Ensemble::getHeightResources(), getMCSymbolForMBB(), llvm::ARMBasicBlockUtils::getOffsetOf(), llvm::MachineTraceMetrics::Trace::getResourceLength(), llvm::MachineTraceMetrics::getResources(), getSymbol(), llvm::MachineTraceMetrics::Ensemble::getTrace(), llvm::LiveVariables::HandleVirtRegUse(), llvm::po_iterator_storage< LoopBounds, true >::insertEdge(), llvm::SlotIndexes::insertMBBInMaps(), llvm::MachineTraceMetrics::Ensemble::invalidate(), llvm::MachineTraceMetrics::invalidate(), llvm::ARMBasicBlockUtils::isBBInRange(), llvm::LiveRangeCalc::isJointlyDominated(), llvm::LiveVariables::VarInfo::isLiveIn(), TransferTracker::loadVarInloc(), llvm::LiveVariables::MarkVirtRegAliveInBlock(), maybeUpdateTerminator(), llvm::MIPrinter::print(), llvm::CSKYConstantPoolMBB::print(), llvm::WebAssemblyException::print(), printName(), llvm::SwiftErrorValueTracking::propagateVRegs(), llvm::WebAssemblyExceptionInfo::recalculate(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), llvm::MachineFunction::RenumberBlocks(), llvm::SlotIndexes::runOnMachineFunction(), llvm::CFIFixup::runOnMachineFunction(), llvm::MIRProfileLoader::setBranchProbs(), llvm::sortBasicBlocksAndUpdateBranches(), sortBlocks(), llvm::LoopTraversal::traverse(), updateBranches(), llvm::MachineTraceMetrics::Ensemble::updateDepth(), llvm::MachineTraceMetrics::Ensemble::verify(), VerifyPHIs(), llvm::yaml::WebAssemblyFunctionInfo::WebAssemblyFunctionInfo(), and llvm::WriteGraph().

◆ getParent() [1/2]

MachineFunction * llvm::MachineBasicBlock::getParent ( )
inline

Definition at line 286 of file MachineBasicBlock.h.

◆ getParent() [2/2]

const MachineFunction * llvm::MachineBasicBlock::getParent ( ) const
inline

Return the MachineFunction containing this basic block.

Definition at line 285 of file MachineBasicBlock.h.

Referenced by addLiveIn(), addLiveInRegs(), llvm::LivePhysRegs::addLiveIns(), llvm::LiveRegUnits::addLiveIns(), llvm::addLiveIns(), llvm::LivePhysRegs::addLiveOuts(), llvm::LiveRegUnits::addLiveOuts(), llvm::LivePhysRegs::addLiveOutsNoPristines(), llvm::MachineInstr::addOperand(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::AddPHIOperand(), addSavedGPR(), llvm::ARMBasicBlockUtils::adjustBBOffsetsAfter(), llvm::RISCVRegisterInfo::adjustReg(), llvm::ARMBaseInstrInfo::analyzeBranch(), llvm::WebAssemblyInstrInfo::analyzeBranch(), analyzeCompressibleUses(), llvm::AArch64InstrInfo::analyzeLoopForPipelining(), llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), llvm::CombinerHelper::applyExtendThroughPhis(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), assignSections(), bbHasFallthrough(), BBHasFallthrough(), llvm::DwarfCFIException::beginBasicBlockSection(), buildCFAOffs(), llvm::MSP430FrameLowering::BuildCFI(), llvm::X86FrameLowering::BuildCFI(), llvm::AArch64InstrInfo::buildClearRegister(), llvm::X86InstrInfo::buildClearRegister(), buildDefCFAReg(), buildGitPtr(), llvm::BuildMI(), BuildPACM(), llvm::SIRegisterInfo::buildSpillLoadStore(), canCombine(), canFallThroughTo(), llvm::AArch64InstrInfo::canInsertSelect(), llvm::PPCInstrInfo::canInsertSelect(), llvm::SystemZInstrInfo::canInsertSelect(), llvm::X86InstrInfo::canInsertSelect(), llvm::SIInstrInfo::canInsertSelect(), canSplitCriticalEdge(), llvm::Thumb1FrameLowering::canUseAsEpilogue(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::X86FrameLowering::canUseAsEpilogue(), llvm::AArch64FrameLowering::canUseAsPrologue(), llvm::RISCVFrameLowering::canUseAsPrologue(), llvm::X86FrameLowering::canUseAsPrologue(), llvm::AArch64PAuth::checkAuthenticatedRegister(), llvm::WebAssemblyDebugValueManager::cloneSink(), CombineCVTAToLocal(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::HexagonBlockRanges::computeDeadMap(), llvm::computeLiveIns(), llvm::constrainSelectedInstRegOperands(), convertCalleeSaveRestoreToSPPrePostIncDec(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), llvm::SIInstrInfo::convertToThreeAddress(), llvm::Thumb1InstrInfo::copyPhysReg(), llvm::NVPTXInstrInfo::copyPhysReg(), llvm::SystemZInstrInfo::copyPhysReg(), llvm::M68kInstrInfo::copyPhysReg(), llvm::WebAssemblyInstrInfo::copyPhysReg(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), createPHIsForCMOVsInSinkBB(), createPHIsForSelects(), llvm::MachineFunction::deleteMachineBasicBlock(), llvm::ilist_alloc_traits< MachineBasicBlock >::deleteNode(), llvm::LexicalScopes::dominates(), llvm::TargetInstrInfo::duplicate(), llvm::ARMBaseInstrInfo::duplicate(), llvm::AArch64RegisterInfo::eliminateFrameIndex(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::MSP430RegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::SystemZRegisterInfo::eliminateFrameIndex(), llvm::BPFRegisterInfo::eliminateFrameIndex(), llvm::WebAssemblyRegisterInfo::eliminateFrameIndex(), llvm::X86RegisterInfo::eliminateFrameIndex(), emitAlignedDPRCS2Restores(), emitAlignedDPRCS2Spills(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::SystemZ::emitBlockAfter(), emitBuildPairF64Pseudo(), llvm::MSP430FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMovesFullCFA(), emitCalleeSavedRestores(), llvm::AsmPrinter::emitCFIInstruction(), EmitCfiOffset(), EmitDefCfaOffset(), llvm::AArch64TargetLowering::EmitDynamicProbedAlloc(), llvm::PPCTargetLowering::emitEHSjLjLongJmp(), llvm::VETargetLowering::emitEHSjLjLongJmp(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::MachineInstr::emitError(), llvm::AArch64TargetLowering::EmitF128CSEL(), llvm::emitFrameOffset(), emitFrameOffsetAdj(), emitFROUND(), llvm::SITargetLowering::emitGWSMemViolTestLoop(), emitIndirectDst(), emitIndirectSrc(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), llvm::X86TargetLowering::EmitKCFICheck(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), llvm::ThumbRegisterInfo::emitLoadConstPool(), emitLoadM0FromVGPRLoop(), emitLoadScalarOpsFromVGPRLoop(), EmitLoweredCascadedSelect(), llvm::AArch64TargetLowering::EmitLoweredCatchRet(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitPrologueEpilogueSPUpdate(), emitPseudoXVINSGR2VR(), emitQuietFCMP(), emitReadCounterWidePseudo(), llvm::ScheduleDAGSDNodes::EmitSchedule(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), llvm::VETargetLowering::emitSjLjDispatchBlock(), emitSplitF64Pseudo(), llvm::X86FrameLowering::emitSPUpdate(), emitThumb1LoadConstPool(), emitThumb2LoadConstPool(), emitThumbRegPlusImmInReg(), emitVecCondBranchPseudo(), emitVFROUND_NOEXCEPT_MASK(), emitXBegin(), llvm::SIInstrInfo::enforceOperandRCAlignment(), eraseFromParent(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::VEInstrInfo::expandGetStackTopPseudo(), expandLoadStackGuard(), llvm::ARMBaseInstrInfo::expandLoadStackGuardBase(), llvm::SIInstrInfo::expandMovDPP64(), ExpandMOVImmSExti8(), llvm::AArch64InstrInfo::expandPostRAPseudo(), llvm::SIInstrInfo::expandPostRAPseudo(), llvm::HexagonInstrInfo::expandPostRAPseudo(), llvm::SparcTargetLowering::expandSelectCC(), expandXorFP(), extractRsrcPtr(), llvm::finalizeBundle(), llvm::X86RegisterInfo::findDeadCallerSavedReg(), findDeadCallerSavedReg(), findIncDecAfter(), findIncDecBefore(), findJumpTableIndex(), llvm::SelectionDAGBuilder::FindMergedConditions(), llvm::findPHICopyInsertPoint(), findRenameRegForSameLdStRegPair(), findScratchNonCalleeSaveRegister(), FixTail(), fixupPHIOpBanks(), llvm::TargetInstrInfo::foldMemoryOperand(), forceReg(), llvm::AArch64InstrInfo::genAlternativeCodeSequence(), generateEndPgm(), llvm::SIInstrInfo::getAddNoCarry(), getBBAddrMapMetadata(), getBBFallenThrough(), llvm::MachineLoop::getBottomBlock(), llvm::MachineInstr::getDebugInstrNum(), getEHCatchretSymbol(), getEndSymbol(), getFallThrough(), llvm::PPCInstrInfo::getFMAPatterns(), getFMULPatterns(), getFNEGPatterns(), getFoldableImm(), getFrameIndexMMO(), getFullName(), getImmedFromMO(), llvm::AArch64InstrInfo::getInstSizeInBytes(), llvm::ARMBaseInstrInfo::getInstSizeInBytes(), getLayoutSuccessorProbThreshold(), getLiveRegsForEntryMBB(), getLoadStoreOffsetSizeInBits(), getMCSymbolForMBB(), llvm::MipsInstrInfo::GetMemOperand(), llvm::MachineInstr::getMF(), getMFIfAvailable(), getNextBlock(), llvm::AArch64InstrInfo::getOutlinableRanges(), llvm::RISCVInstrInfo::getOutliningTypeImpl(), llvm::AArch64InstrInfo::getOutliningTypeImpl(), getSchedRegions(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::HexagonInstrInfo::getSize(), getSymbol(), GetSymbolRef(), llvm::MachineLoop::getTopBlock(), llvm::TargetInstrInfo::hasReassociableOperands(), llvm::TargetInstrInfo::hasReassociableSibling(), hoistAndMergeSGPRInits(), indirectCopyToAGPR(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::ARMBaseInstrInfo::insertBranch(), llvm::VEInstrInfo::insertBranch(), insertCSRRestores(), insertCSRSaves(), insertDivByZeroTrap(), llvm::SIInstrInfo::insertEQ(), llvm::AArch64InstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), llvm::SlotIndexes::insertMBBInMaps(), llvm::insertMultibyteShift(), llvm::SIInstrInfo::insertNE(), llvm::SIInstrInfo::insertReturn(), InsertSEH(), insertSEH(), llvm::SIInstrInfo::insertSelect(), llvm::AArch64InstrInfo::insertSelect(), llvm::PPCInstrInfo::insertSelect(), llvm::SystemZInstrInfo::insertSelect(), llvm::X86InstrInfo::insertSelect(), insertUndefLaneMask(), llvm::SIInstrInfo::insertVectorSelect(), llvm::InstrEmitter::InstrEmitter(), isAlwaysIndirectTarget(), llvm::AArch64InstrInfo::isAssociativeAndCommutative(), isCombineInstrCandidateFP(), isCVTAToLocalCombinationCandidate(), llvm::MachineInstr::isDereferenceableInvariantLoad(), isEntryBlock(), isFunctionEntryBlock(), llvm::LiveRangeCalc::isJointlyDominated(), llvm::SIInstrInfo::isLegalRegOperand(), isLibCallInTailPosition(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), llvm::AArch64InstrInfo::isMBBSafeToSplitToCold(), isNoReturnDef(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), jumpTableFollowsTB(), llvm::SIInstrInfo::legalizeOpWithMove(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), livein_begin(), liveout_begin(), llvm::MipsSEInstrInfo::loadImmediate(), llvm::SystemZInstrInfo::loadImmediate(), llvm::XCoreInstrInfo::loadImmediate(), loadM0FromVGPR(), loadMBUFScalarOperandsFromVGPR(), llvm::MipsSEInstrInfo::loadRegFromStack(), llvm::AArch64InstrInfo::loadRegFromStackSlot(), llvm::ARMBaseInstrInfo::loadRegFromStackSlot(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), llvm::HexagonInstrInfo::loadRegFromStackSlot(), llvm::SparcInstrInfo::loadRegFromStackSlot(), llvm::VEInstrInfo::loadRegFromStackSlot(), llvm::LoongArchInstrInfo::loadRegFromStackSlot(), llvm::RISCVInstrInfo::loadRegFromStackSlot(), llvm::MSP430InstrInfo::loadRegFromStackSlot(), llvm::SIInstrInfo::loadRegFromStackSlot(), llvm::ARCInstrInfo::loadRegFromStackSlot(), llvm::CSKYInstrInfo::loadRegFromStackSlot(), llvm::M68kInstrInfo::loadRegFromStackSlot(), llvm::X86InstrInfo::loadRegFromStackSlot(), llvm::XCoreInstrInfo::loadRegFromStackSlot(), llvm::PPCInstrInfo::loadRegFromStackSlotNoUpd(), llvm::X86InstrInfo::loadStoreTileReg(), llvm::PPCRegisterInfo::lowerACCRestore(), llvm::PPCRegisterInfo::lowerACCSpilling(), LowerCallResults(), llvm::PPCRegisterInfo::lowerCRBitRestore(), llvm::PPCRegisterInfo::lowerCRBitSpilling(), llvm::PPCRegisterInfo::lowerCRRestore(), llvm::PPCRegisterInfo::lowerCRSpilling(), llvm::VETargetLowering::LowerCustomJumpTableEntry(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::PPCRegisterInfo::lowerDynamicAreaOffset(), LowerFPToInt(), llvm::PPCRegisterInfo::lowerOctWordSpilling(), llvm::PPCRegisterInfo::lowerPrepareProbedAlloca(), llvm::PPCRegisterInfo::lowerQuadwordRestore(), llvm::PPCRegisterInfo::lowerQuadwordSpilling(), lowerRISCVVMachineInstrToMCInst(), llvm::RISCVRegisterInfo::lowerVRELOAD(), llvm::RISCVRegisterInfo::lowerVSPILL(), llvm::PPCRegisterInfo::lowerWACCRestore(), llvm::PPCRegisterInfo::lowerWACCSpilling(), lowerWaveReduce(), llvm::Mips16InstrInfo::makeFrame(), mapWasmLandingPadIndex(), llvm::AArch64RegisterInfo::materializeFrameBaseRegister(), llvm::SIRegisterInfo::materializeFrameBaseRegister(), llvm::ARMBaseRegisterInfo::materializeFrameBaseRegister(), llvm::PPCRegisterInfo::materializeFrameBaseRegister(), llvm::RISCVRegisterInfo::materializeFrameBaseRegister(), llvm::SIInstrInfo::materializeImmediate(), llvm::PPCInstrInfo::materializeImmPostRA(), maybeUpdateTerminator(), mergeOperations(), llvm::X86FrameLowering::mergeSPUpdates(), moveAfter(), llvm::ARMBlockPlacement::moveBasicBlock(), moveBefore(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::CSKYInstrInfo::movImm(), llvm::PPCRegisterInfo::needsFrameBaseReg(), llvm::PPCInstrInfo::optimizeCmpPostRA(), llvm::AArch64InstrInfo::optimizeCondBranch(), llvm::RISCVInstrInfo::optimizeCondBranch(), popRegsFromStack(), llvm::SystemZInstrInfo::prepareCompareSwapOperands(), llvm::PPCRegisterInfo::prepareDynamicAlloca(), llvm::VETargetLowering::prepareMBB(), llvm::VETargetLowering::prepareSymbol(), PrevCrossBBInst(), llvm::MIPrinter::print(), print(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::ARMBaseInstrInfo::produceSameValue(), ProfitableToMerge(), propagateLocalCopies(), pushRegsToStack(), llvm::recomputeLivenessFlags(), reduceDbgValsForwardScan(), llvm::TargetInstrInfo::reMaterialize(), llvm::SIInstrInfo::reMaterialize(), llvm::ARMBaseInstrInfo::reMaterialize(), llvm::X86InstrInfo::reMaterialize(), removeFromParent(), replaceDominatedUses(), replaceFrameIndex(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::Thumb2InstrInfo::ReplaceTailWithBranchTo(), reportIllegalCopy(), rescheduleCanonically(), llvm::AArch64FrameLowering::resetCFIToInitialState(), llvm::ARMBaseRegisterInfo::resolveFrameIndex(), llvm::PPCRegisterInfo::resolveFrameIndex(), llvm::SystemZELFFrameLowering::restoreCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::restoreCalleeSavedRegisters(), llvm::AArch64FrameLowering::restoreCalleeSavedRegisters(), llvm::ARCFrameLowering::restoreCalleeSavedRegisters(), llvm::ARMFrameLowering::restoreCalleeSavedRegisters(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::CSKYFrameLowering::restoreCalleeSavedRegisters(), llvm::MSP430FrameLowering::restoreCalleeSavedRegisters(), llvm::PPCFrameLowering::restoreCalleeSavedRegisters(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), llvm::XCoreFrameLowering::restoreCalleeSavedRegisters(), restoreCRs(), llvm::Mips16InstrInfo::restoreFrame(), llvm::X86FrameLowering::restoreWin32EHStackPointers(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::ThumbRegisterInfo::rewriteFrameIndex(), llvm::MachineFunction::salvageCopySSAImpl(), llvm::Mips16RegisterInfo::saveScavengerRegister(), llvm::RegScavenger::scavengeRegisterBackwards(), scavengeVReg(), llvm::VLIWMachineScheduler::schedule(), setCallTargetReg(), llvm::SGPRSpillBuilder::setMI(), llvm::AArch64InstrInfo::shouldClusterMemOps(), llvm::ARMBaseRegisterInfo::shouldCoalesce(), llvm::shouldOptForSize(), llvm::PPCInstrInfo::shouldReduceRegisterPressure(), llvm::TailDuplicator::shouldTailDuplicate(), shouldUseFrameHelper(), llvm::WebAssemblyDebugValueManager::sink(), SkipPHIsAndLabels(), SkipPHIsLabelsAndDebug(), llvm::SystemZELFFrameLowering::spillCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::spillCalleeSavedRegisters(), llvm::AArch64FrameLowering::spillCalleeSavedRegisters(), llvm::ARCFrameLowering::spillCalleeSavedRegisters(), llvm::ARMFrameLowering::spillCalleeSavedRegisters(), llvm::Thumb1FrameLowering::spillCalleeSavedRegisters(), llvm::CSKYFrameLowering::spillCalleeSavedRegisters(), llvm::LoongArchFrameLowering::spillCalleeSavedRegisters(), llvm::M68kFrameLowering::spillCalleeSavedRegisters(), llvm::Mips16FrameLowering::spillCalleeSavedRegisters(), llvm::MipsSEFrameLowering::spillCalleeSavedRegisters(), llvm::MSP430FrameLowering::spillCalleeSavedRegisters(), llvm::PPCFrameLowering::spillCalleeSavedRegisters(), llvm::RISCVFrameLowering::spillCalleeSavedRegisters(), llvm::X86FrameLowering::spillCalleeSavedRegisters(), llvm::XCoreFrameLowering::spillCalleeSavedRegisters(), spillVGPRtoAGPR(), split(), splitAt(), splitBlock(), splitBlockForLoop(), SplitCriticalEdge(), splitEdge(), splitMBB(), llvm::stableHashValue(), llvm::MipsSEInstrInfo::storeRegToStack(), llvm::AArch64InstrInfo::storeRegToStackSlot(), llvm::ARMBaseInstrInfo::storeRegToStackSlot(), llvm::Thumb1InstrInfo::storeRegToStackSlot(), llvm::Thumb2InstrInfo::storeRegToStackSlot(), llvm::HexagonInstrInfo::storeRegToStackSlot(), llvm::LoongArchInstrInfo::storeRegToStackSlot(), llvm::RISCVInstrInfo::storeRegToStackSlot(), llvm::SparcInstrInfo::storeRegToStackSlot(), llvm::VEInstrInfo::storeRegToStackSlot(), llvm::SIInstrInfo::storeRegToStackSlot(), llvm::ARCInstrInfo::storeRegToStackSlot(), llvm::CSKYInstrInfo::storeRegToStackSlot(), llvm::M68kInstrInfo::storeRegToStackSlot(), llvm::MSP430InstrInfo::storeRegToStackSlot(), llvm::X86InstrInfo::storeRegToStackSlot(), llvm::XCoreInstrInfo::storeRegToStackSlot(), llvm::PPCInstrInfo::storeRegToStackSlotNoUpd(), llvm::HexagonInstrInfo::translateInstrsForDup(), tryToSplitRestore(), unstackifyVRegsUsedInSplitBB(), updateLiveIn(), UpdateOperandRegClass(), updateTerminator(), verifyCFIntrinsic(), verifyCTRBranch(), and llvm::SelectionDAGBuilder::visitSPDescriptorParent().

◆ getSectionID()

MBBSectionID llvm::MachineBasicBlock::getSectionID ( ) const
inline

◆ getSectionIDNum()

unsigned llvm::MachineBasicBlock::getSectionIDNum ( ) const
inline

◆ getSinglePredecessor() [1/2]

MachineBasicBlock * llvm::MachineBasicBlock::getSinglePredecessor ( )
inline

Definition at line 814 of file MachineBasicBlock.h.

References getSinglePredecessor().

◆ getSinglePredecessor() [2/2]

const MachineBasicBlock * MachineBasicBlock::getSinglePredecessor ( ) const

Return the predecessor of this block if it has a single predecessor.

Otherwise return a null pointer.

Definition at line 965 of file MachineBasicBlock.cpp.

Referenced by getSinglePredecessor().

◆ getSingleSuccessor() [1/2]

MachineBasicBlock * llvm::MachineBasicBlock::getSingleSuccessor ( )
inline

Definition at line 805 of file MachineBasicBlock.h.

References getSingleSuccessor().

◆ getSingleSuccessor() [2/2]

const MachineBasicBlock * MachineBasicBlock::getSingleSuccessor ( ) const

Return the successor of this block if it has a single successor.

Otherwise return a null pointer.

Definition at line 961 of file MachineBasicBlock.cpp.

Referenced by getSingleSuccessor().

◆ getSublistAccess()

static Instructions MachineBasicBlock::* llvm::MachineBasicBlock::getSublistAccess ( MachineInstr )
inlinestatic

Support for MachineInstr::getNextNode().

Definition at line 345 of file MachineBasicBlock.h.

◆ getSuccProbability()

BranchProbability MachineBasicBlock::getSuccProbability ( const_succ_iterator  Succ) const

Return probability of the edge from this block to MBB.

This method should NOT be called directly, but by using getEdgeProbability method from MachineBranchProbabilityInfo class.

Definition at line 1552 of file MachineBasicBlock.cpp.

References llvm::BranchProbability::getZero(), P, and succ_size().

Referenced by copySuccessor(), llvm::MIPrinter::print(), and print().

◆ getSymbol()

MCSymbol * MachineBasicBlock::getSymbol ( ) const

Return the MCSymbol for this basic block.

Definition at line 61 of file MachineBasicBlock.cpp.

References llvm::MBBSectionID::ColdSectionID, llvm::MBBSectionID::ExceptionSectionID, llvm::MCContext::getAsmInfo(), llvm::MachineFunction::getContext(), llvm::MachineFunction::getFunctionNumber(), llvm::MachineFunction::getName(), getNumber(), llvm::MCContext::getOrCreateSymbol(), getParent(), llvm::MCAsmInfo::getPrivateLabelPrefix(), llvm::MachineFunction::hasBBSections(), isBeginSection(), and llvm::MBBSectionID::Number.

Referenced by llvm::DebugHandlerBase::beginBasicBlockSection(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::AsmPrinter::emitBBAddrMapSection(), EmitInlineAsmStr(), llvm::ARMAsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), llvm::AsmPrinter::emitJumpTableInfo(), llvm::ARMAsmPrinter::emitJumpTableInsts(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::SystemZMCInstLower::getExpr(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::M68kMCInstLower::GetSymbolFromOperand(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::M68kTargetLowering::LowerCustomJumpTableEntry(), llvm::RISCVTargetLowering::LowerCustomJumpTableEntry(), llvm::VETargetLowering::LowerCustomJumpTableEntry(), llvm::X86TargetLowering::LowerCustomJumpTableEntry(), llvm::lowerLoongArchMachineOperandToMCOperand(), LowerOperand(), llvm::ARMAsmPrinter::lowerOperand(), llvm::AArch64MCInstLower::lowerOperand(), AMDGPUMCInstLower::lowerOperand(), llvm::CSKYMCInstLower::lowerOperand(), llvm::LowerPPCMachineOperandToMCOperand(), LowerSymbolOperand(), llvm::WebAssemblyAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::printOperand(), llvm::MipsAsmPrinter::printOperand(), llvm::AVRAsmPrinter::printOperand(), and llvm::HexagonAsmPrinter::printOperand().

◆ hasAddressTaken()

bool llvm::MachineBasicBlock::hasAddressTaken ( ) const
inline

Test whether this block is used as something other than the target of a terminator, exception-handling target, or jump table.

This is either the result of an IR-level "blockaddress", or some form of target-specific branch lowering.

Definition at line 251 of file MachineBasicBlock.h.

Referenced by llvm::MachineLoopInfo::findLoopPreheader(), isAlwaysIndirectTarget(), llvm::HexagonAsmPrinter::isBlockOnlyReachableByFallthrough(), GCEmptyBasicBlocks::runOnMachineFunction(), and llvm::TailDuplicator::tailDuplicateAndUpdate().

◆ hasEHPadSuccessor()

bool MachineBasicBlock::hasEHPadSuccessor ( ) const

Definition at line 287 of file MachineBasicBlock.cpp.

References successors().

Referenced by isLegalToHoistInto().

◆ hasLabelMustBeEmitted()

bool llvm::MachineBasicBlock::hasLabelMustBeEmitted ( ) const
inline

Test whether this block must have its label emitted.

Definition at line 278 of file MachineBasicBlock.h.

Referenced by llvm::AsmPrinter::emitBasicBlockStart().

◆ hasSuccessorProbabilities()

bool llvm::MachineBasicBlock::hasSuccessorProbabilities ( ) const
inline

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

Definition at line 786 of file MachineBasicBlock.h.

◆ insert() [1/3]

MachineBasicBlock::instr_iterator MachineBasicBlock::insert ( instr_iterator  I,
MachineInstr M 
)

Insert MI into the instruction list before I, possibly inside a bundle.

If the insertion point is inside a bundle, MI will be added to the bundle, otherwise MI will not be added to any bundle. That means this function alone can't be used to prepend or append instructions to bundles. See MIBundleBuilder::insert() for a more reliable way of doing that.

Definition at line 1431 of file MachineBasicBlock.cpp.

References assert(), llvm::MachineInstr::BundledPred, llvm::MachineInstr::BundledSucc, I, llvm::iplist_impl< IntrusiveListT, TraitsT >::insert(), instr_end(), and MI.

Referenced by llvm::M68kInstrInfo::AnalyzeBranchImpl(), llvm::BuildMI(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::RISCVInstrInfo::buildOutlinedFrame(), llvm::X86InstrInfo::buildOutlinedFrame(), llvm::MachineFunction::cloneMachineInstrBundle(), llvm::WebAssemblyDebugValueManager::cloneSink(), CombineCVTAToLocal(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), llvm::ARMBaseInstrInfo::convertToThreeAddress(), llvm::X86InstrInfo::convertToThreeAddress(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86TargetLowering::EmitKCFICheck(), llvm::TargetLoweringBase::emitPatchPoint(), llvm::X86FrameLowering::emitPrologue(), llvm::ScheduleDAGSDNodes::EmitSchedule(), llvm::TargetInstrInfo::foldMemoryOperand(), FuseInst(), FuseTwoAddrInst(), llvm::RegBankSelect::InsertPoint::insert(), insertDeleteInstructions(), llvm::MachineIRBuilder::insertInstr(), llvm::AArch64InstrInfo::insertOutlinedCall(), llvm::ARMBaseInstrInfo::insertOutlinedCall(), llvm::RISCVInstrInfo::insertOutlinedCall(), llvm::X86InstrInfo::insertOutlinedCall(), llvm::PPCInstrInfo::loadRegFromStackSlotNoUpd(), LowerCallResults(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::PeelSingleBlockLoop(), performSink(), popRegsFromStack(), ProcessSDDbgValues(), pushRegsToStack(), llvm::TargetInstrInfo::reMaterialize(), llvm::SIInstrInfo::reMaterialize(), llvm::ARMBaseInstrInfo::reMaterialize(), llvm::X86InstrInfo::reMaterialize(), restoreCRs(), llvm::GCNSchedStage::revertScheduling(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::GCNIterativeScheduler::scheduleRegion(), llvm::WebAssemblyDebugValueManager::sink(), llvm::PPCFrameLowering::spillCalleeSavedRegisters(), and llvm::PPCInstrInfo::storeRegToStackSlotNoUpd().

◆ insert() [2/3]

template<typename IT >
void llvm::MachineBasicBlock::insert ( iterator  I,
IT  S,
IT  E 
)
inline

Insert a range of instructions into the instruction list before I.

Definition at line 972 of file MachineBasicBlock.h.

References assert(), E, end(), and I.

◆ insert() [3/3]

iterator llvm::MachineBasicBlock::insert ( iterator  I,
MachineInstr MI 
)
inline

Insert MI into the instruction list before I.

Definition at line 979 of file MachineBasicBlock.h.

References assert(), end(), I, and MI.

◆ insertAfter()

iterator llvm::MachineBasicBlock::insertAfter ( iterator  I,
MachineInstr MI 
)
inline

Insert MI into the instruction list after I.

Definition at line 988 of file MachineBasicBlock.h.

References assert(), end(), I, and MI.

Referenced by llvm::ARMFrameLowering::emitPrologue(), INITIALIZE_PASS(), InsertSEH(), insertSEH(), LowerCallResults(), packCmovGroup(), and llvm::SelectionDAGISel::runOnMachineFunction().

◆ insertAfterBundle()

instr_iterator llvm::MachineBasicBlock::insertAfterBundle ( instr_iterator  I,
MachineInstr MI 
)
inline

If I is bundled then insert MI into the instruction list after the end of the bundle, otherwise insert MI immediately after I.

Definition at line 998 of file MachineBasicBlock.h.

References assert(), I, instr_end(), and MI.

◆ instr_back() [1/2]

MachineInstr & llvm::MachineBasicBlock::instr_back ( )
inline

Definition at line 304 of file MachineBasicBlock.h.

◆ instr_back() [2/2]

const MachineInstr & llvm::MachineBasicBlock::instr_back ( ) const
inline

Definition at line 306 of file MachineBasicBlock.h.

◆ instr_begin() [1/2]

instr_iterator llvm::MachineBasicBlock::instr_begin ( )
inline

◆ instr_begin() [2/2]

const_instr_iterator llvm::MachineBasicBlock::instr_begin ( ) const
inline

Definition at line 314 of file MachineBasicBlock.h.

◆ instr_end() [1/2]

instr_iterator llvm::MachineBasicBlock::instr_end ( )
inline

◆ instr_end() [2/2]

const_instr_iterator llvm::MachineBasicBlock::instr_end ( ) const
inline

Definition at line 316 of file MachineBasicBlock.h.

◆ instr_front() [1/2]

MachineInstr & llvm::MachineBasicBlock::instr_front ( )
inline

Definition at line 303 of file MachineBasicBlock.h.

◆ instr_front() [2/2]

const MachineInstr & llvm::MachineBasicBlock::instr_front ( ) const
inline

Definition at line 305 of file MachineBasicBlock.h.

◆ instr_rbegin() [1/2]

reverse_instr_iterator llvm::MachineBasicBlock::instr_rbegin ( )
inline

◆ instr_rbegin() [2/2]

const_reverse_instr_iterator llvm::MachineBasicBlock::instr_rbegin ( ) const
inline

Definition at line 318 of file MachineBasicBlock.h.

◆ instr_rend() [1/2]

reverse_instr_iterator llvm::MachineBasicBlock::instr_rend ( )
inline

◆ instr_rend() [2/2]

const_reverse_instr_iterator llvm::MachineBasicBlock::instr_rend ( ) const
inline

Definition at line 320 of file MachineBasicBlock.h.

◆ instrs() [1/2]

instr_range llvm::MachineBasicBlock::instrs ( )
inline

◆ instrs() [2/2]

const_instr_range llvm::MachineBasicBlock::instrs ( ) const
inline

Definition at line 325 of file MachineBasicBlock.h.

References instr_begin(), and instr_end().

◆ isBeginSection()

bool llvm::MachineBasicBlock::isBeginSection ( ) const
inline

◆ isCleanupFuncletEntry()

bool llvm::MachineBasicBlock::isCleanupFuncletEntry ( ) const
inline

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

Definition at line 634 of file MachineBasicBlock.h.

Referenced by llvm::WinException::beginFunclet(), llvm::X86FrameLowering::emitPrologue(), and getMCSymbolForMBB().

◆ isEHCatchretTarget()

bool llvm::MachineBasicBlock::isEHCatchretTarget ( ) const
inline

Returns true if this is a target block of a catchret.

Definition at line 622 of file MachineBasicBlock.h.

Referenced by llvm::AsmPrinter::emitBasicBlockStart().

◆ isEHFuncletEntry()

bool llvm::MachineBasicBlock::isEHFuncletEntry ( ) const
inline

◆ isEHPad()

bool llvm::MachineBasicBlock::isEHPad ( ) const
inline

◆ isEHScopeEntry()

bool llvm::MachineBasicBlock::isEHScopeEntry ( ) const
inline

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.

Definition at line 615 of file MachineBasicBlock.h.

Referenced by llvm::getEHScopeMembership().

◆ isEHScopeReturnBlock()

bool llvm::MachineBasicBlock::isEHScopeReturnBlock ( ) const
inline

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

Definition at line 928 of file MachineBasicBlock.h.

References back(), empty(), and llvm::MachineInstr::isEHScopeReturn().

Referenced by collectEHScopeMembers().

◆ isEndSection()

bool llvm::MachineBasicBlock::isEndSection ( ) const
inline

◆ isEntryBlock()

bool MachineBasicBlock::isEntryBlock ( ) const

◆ isInlineAsmBrIndirectTarget()

bool llvm::MachineBasicBlock::isInlineAsmBrIndirectTarget ( ) const
inline

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

Definition at line 678 of file MachineBasicBlock.h.

Referenced by canSplitCriticalEdge(), llvm::TailDuplicator::canTailDuplicate(), llvm::findPHICopyInsertPoint(), llvm::AArch64InstrInfo::isMBBSafeToSplitToCold(), and printName().

◆ isIRBlockAddressTaken()

bool llvm::MachineBasicBlock::isIRBlockAddressTaken ( ) const
inline

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.)

Definition at line 263 of file MachineBasicBlock.h.

Referenced by llvm::AsmPrinter::emitBasicBlockStart(), and printName().

◆ isLayoutSuccessor()

bool MachineBasicBlock::isLayoutSuccessor ( const MachineBasicBlock MBB) const

Return true if the specified MBB will be emitted immediately after this block, such that if this block exits by falling through, control will transfer to the specified MBB.

Note that MBB need not be a successor at all, for example if this block ends with an unconditional branch to some other block.

Definition at line 956 of file MachineBasicBlock.cpp.

References I, and MBB.

Referenced by llvm::BPFInstrInfo::analyzeBranch(), llvm::HexagonInstrInfo::analyzeBranch(), llvm::MSP430InstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::SystemZInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeBranch(), llvm::LanaiInstrInfo::analyzeBranch(), llvm::M68kInstrInfo::AnalyzeBranchImpl(), llvm::FastISel::fastEmitBranch(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::CombinerHelper::matchOptBrCondByInvertingCond(), ProfitableToMerge(), SplitCriticalEdge(), splitEdge(), updateTerminator(), and updateTerminator().

◆ isLegalToHoistInto()

bool MachineBasicBlock::isLegalToHoistInto ( ) const

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

Definition at line 312 of file MachineBasicBlock.cpp.

References hasEHPadSuccessor(), isReturnBlock(), and mayHaveInlineAsmBr().

◆ isLiveIn()

bool MachineBasicBlock::isLiveIn ( MCPhysReg  Reg,
LaneBitmask  LaneMask = LaneBitmask::getAll() 
) const

◆ isMachineBlockAddressTaken()

bool llvm::MachineBasicBlock::isMachineBlockAddressTaken ( ) const
inline

Test whether this block is used as something other than the target of a terminator, exception-handling target, jump table, or IR blockaddress.

For example, its address might be loaded into a register, or stored in some branch table that isn't part of MachineJumpTableInfo.

Definition at line 259 of file MachineBasicBlock.h.

Referenced by llvm::AsmPrinter::emitBasicBlockStart(), and printName().

◆ isPredecessor()

bool MachineBasicBlock::isPredecessor ( const MachineBasicBlock MBB) const

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

Definition at line 948 of file MachineBasicBlock.cpp.

References llvm::is_contained(), MBB, and predecessors().

Referenced by getPreviousInstr(), llvm::MachineTraceMetrics::Ensemble::invalidate(), and llvm::MachineTraceMetrics::Ensemble::verify().

◆ isReturnBlock()

bool llvm::MachineBasicBlock::isReturnBlock ( ) const
inline

◆ isSuccessor()

bool MachineBasicBlock::isSuccessor ( const MachineBasicBlock MBB) const

◆ livein_begin()

MachineBasicBlock::livein_iterator MachineBasicBlock::livein_begin ( ) const

Definition at line 1723 of file MachineBasicBlock.cpp.

References assert(), getParent(), and llvm::MachineFunctionProperties::TracksLiveness.

Referenced by liveins().

◆ livein_begin_dbg()

livein_iterator llvm::MachineBasicBlock::livein_begin_dbg ( ) const
inline

Unlike livein_begin, this method does not check that the liveness information is accurate.

Still for debug purposes it may be useful to have iterators that won't assert if the liveness information is not current.

Definition at line 465 of file MachineBasicBlock.h.

Referenced by liveins_dbg().

◆ livein_empty()

bool llvm::MachineBasicBlock::livein_empty ( ) const
inline

Definition at line 472 of file MachineBasicBlock.h.

Referenced by llvm::addLiveIns(), llvm::MIPrinter::print(), and print().

◆ livein_end()

livein_iterator llvm::MachineBasicBlock::livein_end ( ) const
inline

Definition at line 471 of file MachineBasicBlock.h.

Referenced by isLiveIn(), liveins(), and liveins_dbg().

◆ liveins()

iterator_range< livein_iterator > llvm::MachineBasicBlock::liveins ( ) const
inline

◆ liveins_dbg()

iterator_range< livein_iterator > llvm::MachineBasicBlock::liveins_dbg ( ) const
inline

Definition at line 466 of file MachineBasicBlock.h.

References livein_begin_dbg(), livein_end(), and llvm::make_range().

Referenced by llvm::MIPrinter::print().

◆ liveout_begin()

MachineBasicBlock::liveout_iterator MachineBasicBlock::liveout_begin ( ) const

◆ liveout_end()

liveout_iterator llvm::MachineBasicBlock::liveout_end ( ) const
inline

Definition at line 566 of file MachineBasicBlock.h.

Referenced by liveouts().

◆ liveouts()

iterator_range< liveout_iterator > llvm::MachineBasicBlock::liveouts ( ) const
inline

Definition at line 569 of file MachineBasicBlock.h.

References liveout_begin(), liveout_end(), and llvm::make_range().

Referenced by emitThumbRegPlusImmInReg().

◆ mayHaveInlineAsmBr()

bool MachineBasicBlock::mayHaveInlineAsmBr ( ) const

Returns true if this block may have an INLINEASM_BR (overestimate, by checking if any of the successors are indirect targets of any inlineasm_br in the function).

Definition at line 304 of file MachineBasicBlock.cpp.

References successors().

Referenced by isLegalToHoistInto().

◆ moveAfter()

void MachineBasicBlock::moveAfter ( MachineBasicBlock NewBefore)

◆ moveBefore()

void MachineBasicBlock::moveBefore ( MachineBasicBlock NewAfter)

Move 'this' block before or after the specified block.

This only moves the block, it does not modify the CFG or adjust potential fall-throughs at the end of the block.

Definition at line 668 of file MachineBasicBlock.cpp.

References llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), llvm::ilist_node_impl< OptionsT >::getIterator(), getParent(), and llvm::MachineFunction::splice().

Referenced by llvm::ARMBlockPlacement::moveBasicBlock().

◆ normalizeSuccProbs()

void llvm::MachineBasicBlock::normalizeSuccProbs ( )
inline

Normalize probabilities of all successors so that the sum of them becomes one.

This is usually done when the current update on this MBB is done, and the sum of its successors' probabilities is not guaranteed to be one. The user is responsible for the correct use of this function. MBB::removeSuccessor() has an option to do this automatically.

Definition at line 738 of file MachineBasicBlock.h.

References llvm::BranchProbability::normalizeProbabilities().

Referenced by llvm::SwitchCG::SwitchLowering::buildJumpTable(), removeSuccessor(), splitSuccessor(), transferSuccessorsAndUpdatePHIs(), llvm::SelectionDAGBuilder::visitBitTestCase(), llvm::SelectionDAGBuilder::visitBitTestHeader(), and llvm::SelectionDAGBuilder::visitSwitchCase().

◆ phis() [1/2]

iterator_range< iterator > llvm::MachineBasicBlock::phis ( )
inline

◆ phis() [2/2]

iterator_range< const_iterator > llvm::MachineBasicBlock::phis ( ) const
inline

Definition at line 360 of file MachineBasicBlock.h.

References phis().

◆ pop_back()

void llvm::MachineBasicBlock::pop_back ( )
inline

Definition at line 959 of file MachineBasicBlock.h.

◆ pop_front()

void llvm::MachineBasicBlock::pop_front ( )
inline

Definition at line 958 of file MachineBasicBlock.h.

◆ pred_begin() [1/2]

pred_iterator llvm::MachineBasicBlock::pred_begin ( )
inline

◆ pred_begin() [2/2]

const_pred_iterator llvm::MachineBasicBlock::pred_begin ( ) const
inline

Definition at line 378 of file MachineBasicBlock.h.

◆ pred_empty()

bool llvm::MachineBasicBlock::pred_empty ( ) const
inline

◆ pred_end() [1/2]

pred_iterator llvm::MachineBasicBlock::pred_end ( )
inline

◆ pred_end() [2/2]

const_pred_iterator llvm::MachineBasicBlock::pred_end ( ) const
inline

Definition at line 380 of file MachineBasicBlock.h.

◆ pred_rbegin() [1/2]

pred_reverse_iterator llvm::MachineBasicBlock::pred_rbegin ( )
inline

Definition at line 381 of file MachineBasicBlock.h.

Referenced by llvm::LiveVariables::MarkVirtRegAliveInBlock().

◆ pred_rbegin() [2/2]

const_pred_reverse_iterator llvm::MachineBasicBlock::pred_rbegin ( ) const
inline

Definition at line 383 of file MachineBasicBlock.h.

◆ pred_rend() [1/2]

pred_reverse_iterator llvm::MachineBasicBlock::pred_rend ( )
inline

Definition at line 385 of file MachineBasicBlock.h.

Referenced by llvm::LiveVariables::MarkVirtRegAliveInBlock().

◆ pred_rend() [2/2]

const_pred_reverse_iterator llvm::MachineBasicBlock::pred_rend ( ) const
inline

Definition at line 387 of file MachineBasicBlock.h.

◆ pred_size()

unsigned llvm::MachineBasicBlock::pred_size ( ) const
inline

◆ predecessors() [1/2]

iterator_range< pred_iterator > llvm::MachineBasicBlock::predecessors ( )
inline

◆ predecessors() [2/2]

iterator_range< const_pred_iterator > llvm::MachineBasicBlock::predecessors ( ) const
inline

Definition at line 413 of file MachineBasicBlock.h.

References llvm::make_range(), pred_begin(), and pred_end().

◆ print() [1/2]

void MachineBasicBlock::print ( raw_ostream OS,
const SlotIndexes Indexes = nullptr,
bool  IsStandalone = true 
) const

◆ print() [2/2]

void MachineBasicBlock::print ( raw_ostream OS,
ModuleSlotTracker MST,
const SlotIndexes Indexes = nullptr,
bool  IsStandalone = true 
) const

◆ printAsOperand()

void MachineBasicBlock::printAsOperand ( raw_ostream OS,
bool  PrintType = true 
) const

◆ printName()

void MachineBasicBlock::printName ( raw_ostream os,
unsigned  printNameFlags = PrintNameIr,
ModuleSlotTracker moduleSlotTracker = nullptr 
) const

Print the basic block's name as:

bb.{number}[.{ir-name}] [(attributes...)]

The {ir-name} is only printed when the PrintNameIr flag is passed (which is the default). If the IR block has no name, it is identified numerically using the attribute syntax as "(%ir-block.{ir-slot})".

When the PrintNameAttributes flag is passed, additional attributes of the block are printed when set.

Parameters
printNameFlagsCombination of PrintNameFlag flags indicating the parts to print.
moduleSlotTrackerOptional ModuleSlotTracker. This method will incorporate its own tracker when necessary to determine the block's IR name.

Definition at line 482 of file MachineBasicBlock.cpp.

References llvm::MBBSectionID::Cold, llvm::MBBSectionID::Exception, getAddressTakenIRBlock(), getAlignment(), getBasicBlock(), getBBID(), llvm::ModuleSlotTracker::getLocalSlot(), getNumber(), getSectionID(), llvm::ModuleSlotTracker::incorporateFunction(), isEHFuncletEntry(), isEHPad(), isInlineAsmBrIndirectTarget(), isIRBlockAddressTaken(), isMachineBlockAddressTaken(), llvm::MBBSectionID::Number, PrintNameAttributes, PrintNameIr, llvm::MBBSectionID::Type, and llvm::Align::value().

Referenced by llvm::MIPrinter::print(), print(), printAsOperand(), and llvm::GCNRegPressurePrinter::runOnMachineFunction().

◆ push_back()

void llvm::MachineBasicBlock::push_back ( MachineInstr MI)
inline

◆ rbegin() [1/2]

reverse_iterator llvm::MachineBasicBlock::rbegin ( )
inline

◆ rbegin() [2/2]

const_reverse_iterator llvm::MachineBasicBlock::rbegin ( ) const
inline

◆ remove()

MachineInstr * llvm::MachineBasicBlock::remove ( MachineInstr I)
inline

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

This function can not be used to remove bundled instructions, use remove_instr to remove individual instructions from a bundle.

Definition at line 1047 of file MachineBasicBlock.h.

References assert(), and I.

Referenced by llvm::X86InstrInfo::optimizeCompareInstr(), llvm::MachineInstr::removeFromParent(), llvm::GCNSchedStage::revertScheduling(), and llvm::GCNIterativeScheduler::scheduleRegion().

◆ remove_instr()

MachineInstr * MachineBasicBlock::remove_instr ( MachineInstr I)

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

If the instruction is part of a bundle, the other instructions in the bundle will still be bundled after removing the single instruction.

Definition at line 1423 of file MachineBasicBlock.cpp.

References llvm::MachineInstr::BundledPred, llvm::MachineInstr::BundledSucc, MI, llvm::iplist_impl< IntrusiveListT, TraitsT >::remove(), and unbundleSingleMI().

Referenced by llvm::MachineInstr::removeFromBundle().

◆ removeFromParent()

MachineBasicBlock * MachineBasicBlock::removeFromParent ( )

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

Definition at line 1444 of file MachineBasicBlock.cpp.

References assert(), getParent(), and llvm::MachineFunction::remove().

◆ removeLiveIn() [1/2]

Remove entry from the livein set and return iterator to the next.

Definition at line 604 of file MachineBasicBlock.cpp.

References I.

◆ removeLiveIn() [2/2]

void MachineBasicBlock::removeLiveIn ( MCPhysReg  Reg,
LaneBitmask  LaneMask = LaneBitmask::getAll() 
)

Remove the specified register from the live in set.

Definition at line 592 of file MachineBasicBlock.cpp.

References llvm::find_if(), I, and llvm::MachineBasicBlock::RegisterMaskPair::PhysReg.

Referenced by emitGPDisp(), llvm::SIMachineFunctionInfo::shiftSpillPhysVGPRsToLowestRange(), and updateLiveIn().

◆ removeSuccessor() [1/2]

void MachineBasicBlock::removeSuccessor ( MachineBasicBlock Succ,
bool  NormalizeSuccProbs = false 
)

Remove successor from the successors list of this MachineBasicBlock.

The Predecessors list of Succ is automatically updated. If NormalizeSuccProbs is true, then normalize successors' probabilities after the successor is removed.

Definition at line 828 of file MachineBasicBlock.cpp.

References llvm::find(), I, and removeSuccessor().

Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock(), eraseDeadBBsAndChildren(), loadM0FromVGPR(), processSwitches(), removeSuccessor(), replaceSuccessor(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), rollbackRestoreSplit(), GCEmptyBasicBlocks::runOnMachineFunction(), transferSuccessors(), transferSuccessorsAndUpdatePHIs(), and llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander().

◆ removeSuccessor() [2/2]

MachineBasicBlock::succ_iterator MachineBasicBlock::removeSuccessor ( succ_iterator  I,
bool  NormalizeSuccProbs = false 
)

Remove specified successor from the successors list of this MachineBasicBlock.

The Predecessors list of Succ is automatically updated. If NormalizeSuccProbs is true, then normalize successors' probabilities after the successor is removed. Return the iterator to the element after the one removed.

Definition at line 835 of file MachineBasicBlock.cpp.

References assert(), I, and normalizeSuccProbs().

◆ rend() [1/2]

reverse_iterator llvm::MachineBasicBlock::rend ( )
inline

◆ rend() [2/2]

const_reverse_iterator llvm::MachineBasicBlock::rend ( ) const
inline

Definition at line 340 of file MachineBasicBlock.h.

References instr_rend().

◆ replacePhiUsesWith()

void MachineBasicBlock::replacePhiUsesWith ( MachineBasicBlock Old,
MachineBasicBlock New 
)

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

Definition at line 1479 of file MachineBasicBlock.cpp.

References llvm::MachineOperand::getMBB(), MI, phis(), and llvm::MachineOperand::setMBB().

Referenced by SplitCriticalEdge(), and transferSuccessorsAndUpdatePHIs().

◆ replaceSuccessor()

void MachineBasicBlock::replaceSuccessor ( MachineBasicBlock Old,
MachineBasicBlock New 
)

Replace successor OLD with NEW and update probability info.

Definition at line 851 of file MachineBasicBlock.cpp.

References assert(), E, I, removeSuccessor(), succ_begin(), and succ_end().

Referenced by llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), ReplaceUsesOfBlockWith(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), and splitEdge().

◆ ReplaceUsesOfBlockWith()

void MachineBasicBlock::ReplaceUsesOfBlockWith ( MachineBasicBlock Old,
MachineBasicBlock New 
)

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

Definition at line 1458 of file MachineBasicBlock.cpp.

References assert(), I, instr_begin(), instr_end(), and replaceSuccessor().

Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::PeelSingleBlockLoop(), and SplitCriticalEdge().

◆ rfindDebugLoc() [1/2]

DebugLoc MachineBasicBlock::rfindDebugLoc ( reverse_instr_iterator  MBBI)

Has exact same behavior as findDebugLoc (it also searches towards the end of this MBB) except that this function takes a reverse iterator to identify the starting MI.

Definition at line 1500 of file MachineBasicBlock.cpp.

References findDebugLoc(), instr_begin(), instr_rbegin(), instr_rend(), MBBI, and llvm::skipDebugInstructionsBackward().

Referenced by llvm::M68kInstrInfo::AnalyzeBranchImpl(), and rfindDebugLoc().

◆ rfindDebugLoc() [2/2]

DebugLoc llvm::MachineBasicBlock::rfindDebugLoc ( reverse_iterator  MBBI)
inline

Definition at line 1110 of file MachineBasicBlock.h.

References MBBI, and rfindDebugLoc().

◆ rfindPrevDebugLoc() [1/2]

DebugLoc MachineBasicBlock::rfindPrevDebugLoc ( reverse_instr_iterator  MBBI)

Has exact same behavior as findPrevDebugLoc (it also searches towards the beginning of this MBB) except that this function takes reverse iterator to identify the starting MI.

A minor difference compared to findPrevDebugLoc is that we can't start scanning at "instr_end".

Definition at line 1522 of file MachineBasicBlock.cpp.

References instr_rend(), MBBI, and llvm::next_nodbg().

Referenced by rfindPrevDebugLoc().

◆ rfindPrevDebugLoc() [2/2]

DebugLoc llvm::MachineBasicBlock::rfindPrevDebugLoc ( reverse_iterator  MBBI)
inline

Definition at line 1127 of file MachineBasicBlock.h.

References MBBI, and rfindPrevDebugLoc().

◆ sameSection()

bool llvm::MachineBasicBlock::sameSection ( const MachineBasicBlock MBB) const
inline

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

Definition at line 699 of file MachineBasicBlock.h.

References getSectionID(), and MBB.

Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), and llvm::AsmPrinter::emitFunctionBody().

◆ setAddressTakenIRBlock()

void llvm::MachineBasicBlock::setAddressTakenIRBlock ( BasicBlock BB)
inline

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

Definition at line 275 of file MachineBasicBlock.h.

Referenced by llvm::IRTranslator::runOnMachineFunction(), and llvm::FunctionLoweringInfo::set().

◆ setAlignment() [1/2]

void llvm::MachineBasicBlock::setAlignment ( Align  A)
inline

Set alignment of the basic block.

Definition at line 585 of file MachineBasicBlock.h.

References A.

Referenced by AlignBlocks(), and setAlignment().

◆ setAlignment() [2/2]

void llvm::MachineBasicBlock::setAlignment ( Align  A,
unsigned  MaxBytes 
)
inline

Definition at line 587 of file MachineBasicBlock.h.

References A, setAlignment(), and setMaxBytesForAlignment().

◆ setBBID()

void llvm::MachineBasicBlock::setBBID ( const UniqueBBID V)
inline

Sets the fixed BBID of this basic block.

Definition at line 661 of file MachineBasicBlock.h.

References assert().

Referenced by llvm::MachineFunction::CreateMachineBasicBlock().

◆ setCallFrameSize()

void llvm::MachineBasicBlock::setCallFrameSize ( unsigned  N)
inline

◆ setIrrLoopHeaderWeight()

void llvm::MachineBasicBlock::setIrrLoopHeaderWeight ( uint64_t  Weight)
inline

Definition at line 1193 of file MachineBasicBlock.h.

◆ setIsBeginSection()

void llvm::MachineBasicBlock::setIsBeginSection ( bool  V = true)
inline

Definition at line 645 of file MachineBasicBlock.h.

Referenced by llvm::MachineFunction::assignBeginEndSections().

◆ setIsCleanupFuncletEntry()

void llvm::MachineBasicBlock::setIsCleanupFuncletEntry ( bool  V = true)
inline

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

Definition at line 637 of file MachineBasicBlock.h.

◆ setIsEHCatchretTarget()

void llvm::MachineBasicBlock::setIsEHCatchretTarget ( bool  V = true)
inline

Indicates if this is a target block of a catchret.

Definition at line 625 of file MachineBasicBlock.h.

◆ setIsEHFuncletEntry()

void llvm::MachineBasicBlock::setIsEHFuncletEntry ( bool  V = true)
inline

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

Definition at line 631 of file MachineBasicBlock.h.

◆ setIsEHPad()

void llvm::MachineBasicBlock::setIsEHPad ( bool  V = true)
inline

Indicates the block is a landing pad.

That is this basic block is entered via an exception handler.

Definition at line 606 of file MachineBasicBlock.h.

Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock(), and llvm::FunctionLoweringInfo::set().

◆ setIsEHScopeEntry()

void llvm::MachineBasicBlock::setIsEHScopeEntry ( bool  V = true)
inline

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.

Definition at line 619 of file MachineBasicBlock.h.

◆ setIsEndSection()

void llvm::MachineBasicBlock::setIsEndSection ( bool  V = true)
inline

Definition at line 647 of file MachineBasicBlock.h.

Referenced by llvm::MachineFunction::assignBeginEndSections().

◆ setIsInlineAsmBrIndirectTarget()

void llvm::MachineBasicBlock::setIsInlineAsmBrIndirectTarget ( bool  V = true)
inline

Indicates if this is the indirect dest of an INLINEASM_BR.

Definition at line 683 of file MachineBasicBlock.h.

◆ setLabelMustBeEmitted()

void llvm::MachineBasicBlock::setLabelMustBeEmitted ( )
inline

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

Definition at line 282 of file MachineBasicBlock.h.

◆ setMachineBlockAddressTaken()

void llvm::MachineBasicBlock::setMachineBlockAddressTaken ( )
inline

Set this block to indicate that its address is used as something other than the target of a terminator, exception-handling target, jump table, or IR-level "blockaddress".

Definition at line 271 of file MachineBasicBlock.h.

Referenced by llvm::VETargetLowering::emitEHSjLjSetJmp().

◆ setMaxBytesForAlignment()

void llvm::MachineBasicBlock::setMaxBytesForAlignment ( unsigned  MaxBytes)
inline

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

Definition at line 596 of file MachineBasicBlock.h.

Referenced by setAlignment().

◆ setNumber()

void llvm::MachineBasicBlock::setNumber ( int  N)
inline

Definition at line 1176 of file MachineBasicBlock.h.

References N, and Number.

Referenced by llvm::MachineFunction::RenumberBlocks().

◆ setSectionID()

void llvm::MachineBasicBlock::setSectionID ( MBBSectionID  V)
inline

Sets the section ID for this basic block.

Definition at line 667 of file MachineBasicBlock.h.

Referenced by assignSections().

◆ setSuccProbability()

void MachineBasicBlock::setSuccProbability ( succ_iterator  I,
BranchProbability  Prob 
)

Set successor probability of a given iterator.

Definition at line 1574 of file MachineBasicBlock.cpp.

References assert(), I, and llvm::BranchProbability::isUnknown().

Referenced by llvm::MIRProfileLoader::setBranchProbs(), and splitMBB().

◆ size()

unsigned llvm::MachineBasicBlock::size ( ) const
inline

◆ sizeWithoutDebugLargerThan()

bool MachineBasicBlock::sizeWithoutDebugLargerThan ( unsigned  Limit) const

Definition at line 1747 of file MachineBasicBlock.cpp.

References begin(), E, end(), I, and llvm::instructionsWithoutDebug().

◆ SkipPHIsAndLabels()

MachineBasicBlock::iterator MachineBasicBlock::SkipPHIsAndLabels ( MachineBasicBlock::iterator  I)

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

This is the correct point to insert lowered copies at the beginning of a basic block that must be before any debugging information.

Definition at line 210 of file MachineBasicBlock.cpp.

References assert(), E, end(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), I, and TII.

Referenced by addLiveIn(), copyDebugInfoToSuccessor(), and llvm::findPHICopyInsertPoint().

◆ SkipPHIsLabelsAndDebug()

MachineBasicBlock::iterator MachineBasicBlock::SkipPHIsLabelsAndDebug ( MachineBasicBlock::iterator  I,
Register  Reg = Register(),
bool  SkipPseudoOp = true 
)

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

This is the correct point to insert copies at the beginning of a basic block. Reg is the register being used by a spill or defined for a restore/split during register allocation.

Definition at line 225 of file MachineBasicBlock.cpp.

References assert(), E, end(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), I, and TII.

Referenced by findInsertLocation(), and llvm::SplitEditor::leaveIntvAtTop().

◆ sortUniqueLiveIns()

void MachineBasicBlock::sortUniqueLiveIns ( )

◆ splice() [1/2]

void llvm::MachineBasicBlock::splice ( iterator  Where,
MachineBasicBlock Other,
iterator  From 
)
inline

Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before 'Where'.

If From points to a bundle of instructions, the whole bundle is moved.

Definition at line 1067 of file MachineBasicBlock.h.

References From, llvm::Other, and splice().

Referenced by llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitReadCounterWidePseudo(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), emitVecCondBranchPseudo(), emitXBegin(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), hoistAndMergeSGPRInits(), llvm::PPCFrameLowering::inlineStackProbe(), loadMBUFScalarOperandsFromVGPR(), LowerFPToInt(), llvm::MachineInstr::moveBefore(), llvm::ScheduleDAGMI::moveInstruction(), MoveVPNOTBeforeFirstUser(), performSink(), llvm::ScheduleDAGMI::placeDebugValues(), llvm::AArch64InstrInfo::probedStackAlloc(), rescheduleCanonically(), rescheduleLexographically(), llvm::IRTranslator::runOnMachineFunction(), llvm::WebAssemblyDebugValueManager::sink(), splice(), split(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), splitBlockForLoop(), and splitMBB().

◆ splice() [2/2]

void llvm::MachineBasicBlock::splice ( iterator  Where,
MachineBasicBlock Other,
iterator  From,
iterator  To 
)
inline

Take a block of instructions from MBB 'Other' in the range [From, To), and insert them into this MBB right before 'Where'.

The instruction at 'Where' must not be included in the range of instructions to move.

Definition at line 1078 of file MachineBasicBlock.h.

References From, llvm::MachineInstrBundleIterator< Ty, IsReverse >::getInstrIterator(), and llvm::Other.

◆ splitAt()

MachineBasicBlock * MachineBasicBlock::splitAt ( MachineInstr SplitInst,
bool  UpdateLiveIns = true,
LiveIntervals LIS = nullptr 
)

Split a basic block into 2 pieces at SplitPoint.

A new block will be inserted after this block, and all instructions after SplitInst moved to it (SplitInst will be in the original block). If LIS is provided, LiveIntervals will be appropriately updated.

Returns
the newly inserted block.

If UpdateLiveIns is true, this will ensure the live ins list is accurate, including for physreg uses/defs in the original block.

Definition at line 1017 of file MachineBasicBlock.cpp.

References llvm::addLiveIns(), llvm::LivePhysRegs::addLiveOuts(), addSuccessor(), begin(), llvm::MachineFunction::CreateMachineBasicBlock(), E, end(), getBasicBlock(), getParent(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse(), llvm::MachineFunction::getSubtarget(), I, llvm::LivePhysRegs::init(), llvm::MachineFunction::insert(), llvm::LiveIntervals::insertMBBInMaps(), MI, rbegin(), splice(), llvm::LivePhysRegs::stepBackward(), and transferSuccessorsAndUpdatePHIs().

Referenced by llvm::AArch64PAuth::checkAuthenticatedRegister(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), splitBlock(), and llvm::SITargetLowering::splitKillBlock().

◆ SplitCriticalEdge()

MachineBasicBlock * MachineBasicBlock::SplitCriticalEdge ( MachineBasicBlock Succ,
Pass P,
std::vector< SparseBitVector<> > *  LiveInSets = nullptr 
)

Split the critical edge from this block to the given successor block, and return the newly created block, or null if splitting is not possible.

This function updates LiveVariables, MachineDominatorTree, and MachineLoopInfo, as applicable.

Definition at line 1132 of file MachineBasicBlock.cpp.

References addLiveIn(), llvm::LiveVariables::addNewBlock(), llvm::LiveRange::addSegment(), addSuccessor(), assert(), canSplitCriticalEdge(), Cond, llvm::SmallSet< T, N, C >::count(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::dbgs(), DL, E, end(), llvm::MachineFunction::end(), findJumpTableIndex(), getCallFrameSize(), getFirstInstrTerminator(), getFirstTerminator(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::LiveIntervals::getInterval(), llvm::MachineFunction::getJumpTableInfo(), llvm::LiveIntervals::getMBBStartIdx(), llvm::ilist_node_with_parent< MachineBasicBlock, MachineFunction >::getNextNode(), getParent(), llvm::SlotIndex::getPrevSlot(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::LiveVariables::getVarInfo(), llvm::LiveRange::getVNInfoAt(), llvm::LiveIntervals::hasInterval(), I, llvm::Register::index2VirtReg(), llvm::SmallSet< T, N, C >::insert(), llvm::MachineFunction::insert(), llvm::HexagonInstrInfo::insertBranch(), llvm::LiveIntervals::insertMBBInMaps(), instr_begin(), instr_end(), llvm::is_contained(), isLayoutSuccessor(), isLiveOut(), llvm::MachineOperand::isUndef(), llvm::LiveVariables::VarInfo::Kills, llvm::LiveRange::liveAt(), liveins(), LLVM_DEBUG, llvm::make_range(), MI, MRI, P, llvm::printMBBReference(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::LiveVariables::VarInfo::removeKill(), llvm::LiveRange::removeSegment(), llvm::LiveIntervals::repairIntervalsInRange(), llvm::MachineJumpTableInfo::ReplaceMBBInJumpTable(), replacePhiUsesWith(), ReplaceUsesOfBlockWith(), setCallFrameSize(), llvm::LiveInterval::subranges(), TII, TRI, and updateTerminator().

◆ splitSuccessor()

void MachineBasicBlock::splitSuccessor ( MachineBasicBlock Old,
MachineBasicBlock New,
bool  NormalizeSuccProbs = false 
)

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

Definition at line 809 of file MachineBasicBlock.cpp.

References addSuccessor(), assert(), llvm::find(), llvm::BranchProbability::getUnknown(), llvm::is_contained(), normalizeSuccProbs(), succ_end(), and successors().

Referenced by llvm::AArch64PAuth::checkAuthenticatedRegister(), and splitEdge().

◆ succ_begin() [1/2]

succ_iterator llvm::MachineBasicBlock::succ_begin ( )
inline

◆ succ_begin() [2/2]

const_succ_iterator llvm::MachineBasicBlock::succ_begin ( ) const
inline

Definition at line 394 of file MachineBasicBlock.h.

◆ succ_empty()

bool llvm::MachineBasicBlock::succ_empty ( ) const
inline

◆ succ_end() [1/2]

succ_iterator llvm::MachineBasicBlock::succ_end ( )
inline

◆ succ_end() [2/2]

const_succ_iterator llvm::MachineBasicBlock::succ_end ( ) const
inline

Definition at line 396 of file MachineBasicBlock.h.

◆ succ_rbegin() [1/2]

succ_reverse_iterator llvm::MachineBasicBlock::succ_rbegin ( )
inline

Definition at line 397 of file MachineBasicBlock.h.

Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock(), and splitMBB().

◆ succ_rbegin() [2/2]

const_succ_reverse_iterator llvm::MachineBasicBlock::succ_rbegin ( ) const
inline

Definition at line 399 of file MachineBasicBlock.h.

◆ succ_rend() [1/2]

succ_reverse_iterator llvm::MachineBasicBlock::succ_rend ( )
inline

Definition at line 401 of file MachineBasicBlock.h.

Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock().

◆ succ_rend() [2/2]

const_succ_reverse_iterator llvm::MachineBasicBlock::succ_rend ( ) const
inline

Definition at line 403 of file MachineBasicBlock.h.

◆ succ_size()

unsigned llvm::MachineBasicBlock::succ_size ( ) const
inline

◆ successors() [1/2]

iterator_range< succ_iterator > llvm::MachineBasicBlock::successors ( )
inline

Definition at line 416 of file MachineBasicBlock.h.

References llvm::make_range(), succ_begin(), and succ_end().

Referenced by llvm::LiveRegUnits::addLiveOuts(), llvm::LivePhysRegs::addLiveOutsNoPristines(), llvm::ScheduleDAGInstrs::addSchedBarrierDeps(), llvm::X86InstrInfo::analyzeBranchPredicate(), areCFlagsAliveInSuccessors(), BBHasFallthrough(), blockEndIsUnreachable(), CanLowerPriorityDirectlyInPredecessors(), checkAndUpdateCCRKill(), checkAndUpdateCPSRKill(), checkCCKill(), checkEFLAGSLive(), collectEHScopeMembers(), computeRegisterLiveness(), llvm::AsmPrinter::emitBBAddrMapSection(), eraseDeadBBsAndChildren(), findFalseBlock(), llvm::MachineLoopInfo::findLoopPreheader(), flagsNeedToBePreservedBeforeTheTerminators(), getFallThroughMBB(), llvm::ReachingDefAnalysis::getGlobalUses(), getSingleLiveInSuccBB(), llvm::afdo_detail::IRTraits< MachineBasicBlock >::getSuccessors(), hasEHPadSuccessor(), hasSameSuccessors(), llvm::MachineTraceMetrics::Ensemble::invalidate(), isEFLAGSLiveAfter(), isLiveOut(), llvm::LiveVariables::isLiveOut(), isReachableAmongDominated(), llvm::HexagonInstrInfo::isSchedulingBoundary(), isSuccessor(), loadMBUFScalarOperandsFromVGPR(), mayHaveInlineAsmBr(), mbbHasBackEdge(), llvm::rdf::operator<<(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), OtherSucc(), llvm::LiveIntervals::pruneValue(), removeExternalCFGEdges(), removeImplicitFallthroughs(), llvm::CFIFixup::runOnMachineFunction(), salvageDebugInfoFromEmptyBlock(), llvm::MIRProfileLoader::setBranchProbs(), llvm::TailDuplicator::shouldTailDuplicate(), shouldUseFrameHelper(), sortBlocks(), splitBlock(), splitMBB(), splitSuccessor(), llvm::AggressiveAntiDepBreaker::StartBlock(), llvm::CriticalAntiDepBreaker::StartBlock(), llvm::successors(), llvm::LoopTraversal::traverse(), updateLiveness(), ValidateMVEStore(), and llvm::WriteGraph().

◆ successors() [2/2]

iterator_range< const_succ_iterator > llvm::MachineBasicBlock::successors ( ) const
inline

Definition at line 419 of file MachineBasicBlock.h.

References llvm::make_range(), succ_begin(), and succ_end().

◆ terminators() [1/2]

iterator_range< iterator > llvm::MachineBasicBlock::terminators ( )
inline

◆ terminators() [2/2]

iterator_range< const_iterator > llvm::MachineBasicBlock::terminators ( ) const
inline

Definition at line 352 of file MachineBasicBlock.h.

References end(), getFirstTerminator(), and llvm::make_range().

◆ transferSuccessors()

void MachineBasicBlock::transferSuccessors ( MachineBasicBlock FromMBB)

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).

Definition at line 909 of file MachineBasicBlock.cpp.

References addSuccessor(), addSuccessorWithoutProb(), removeSuccessor(), succ_begin(), and succ_empty().

Referenced by splitMBB().

◆ transferSuccessorsAndUpdatePHIs()

void MachineBasicBlock::transferSuccessorsAndUpdatePHIs ( MachineBasicBlock FromMBB)

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

Definition at line 929 of file MachineBasicBlock.cpp.

References addSuccessor(), addSuccessorWithoutProb(), normalizeSuccProbs(), removeSuccessor(), replacePhiUsesWith(), succ_begin(), and succ_empty().

Referenced by llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitReadCounterWidePseudo(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), emitVecCondBranchPseudo(), emitXBegin(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::PPCFrameLowering::inlineStackProbe(), loadMBUFScalarOperandsFromVGPR(), LowerFPToInt(), llvm::AArch64InstrInfo::probedStackAlloc(), split(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), and splitBlockForLoop().

◆ updateTerminator()

void MachineBasicBlock::updateTerminator ( MachineBasicBlock PreviousLayoutSuccessor)

Update the terminator instructions in block to account for changes to block layout which may have been made.

PreviousLayoutSuccessor should be set to the block which may have been used as fallthrough before the block layout was modified. If the block previously fell through to that block, it may now need a branch. If it previously branched to another block, it may now be able to fallthrough to the current layout successor.

Definition at line 685 of file MachineBasicBlock.cpp.

References llvm::HexagonInstrInfo::analyzeBranch(), assert(), B, Cond, llvm::dbgs(), DL, findBranchDebugLoc(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), llvm::HexagonInstrInfo::insertBranch(), isEHPad(), isLayoutSuccessor(), isSuccessor(), LLVM_DEBUG, llvm::printMBBReference(), llvm::HexagonInstrInfo::removeBranch(), llvm::HexagonInstrInfo::reverseBranchCondition(), succ_empty(), TBB, and TII.

Referenced by maybeUpdateTerminator(), llvm::PeelSingleBlockLoop(), SplitCriticalEdge(), and updateBranches().

◆ validateSuccProbs()

void MachineBasicBlock::validateSuccProbs ( ) const

Validate successors' probabilities and check if the sum of them is approximate one.

This only works in DEBUG mode.

Definition at line 776 of file MachineBasicBlock.cpp.

References assert(), and llvm::BranchProbability::getDenominator().

Friends And Related Function Documentation

◆ ilist_callback_traits< MachineBasicBlock >

friend struct ilist_callback_traits< MachineBasicBlock >
friend

Definition at line 1209 of file MachineBasicBlock.h.

◆ MachineBranchProbabilityInfo

friend class MachineBranchProbabilityInfo
friend

Definition at line 1208 of file MachineBasicBlock.h.

◆ MachineFunction

friend class MachineFunction
friend

Definition at line 227 of file MachineBasicBlock.h.

◆ MIPrinter

friend class MIPrinter
friend

Definition at line 1209 of file MachineBasicBlock.h.


The documentation for this class was generated from the following files: