LLVM 22.0.0git
|
#include "llvm/CodeGen/MachineBasicBlock.h"
Classes | |
class | liveout_iterator |
struct | RegisterMaskPair |
Pair of physical register and lane mask. More... | |
struct | SplitCriticalEdgeAnalyses |
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. More... | |
Public Member Functions | |
const BasicBlock * | getBasicBlock () const |
Return the LLVM basic block that this instance corresponded to originally. | |
void | clearBasicBlock () |
Remove the reference to the underlying IR BasicBlock. | |
LLVM_ABI bool | hasName () const |
Check if there is a name of corresponding LLVM basic block. | |
LLVM_ABI StringRef | getName () const |
Return the name of the corresponding LLVM basic block, or an empty string. | |
LLVM_ABI 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. | |
BasicBlock * | getAddressTakenIRBlock () 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 MachineFunction * | getParent () const |
Return the MachineFunction containing this basic block. | |
MachineFunction * | getParent () |
bool | terminatorIsComputedGotoWithSuccessors () const |
Returns true if the original IR terminator is an indirectbr with successor blocks. | |
unsigned | size () const |
LLVM_ABI bool | sizeWithoutDebugLargerThan (unsigned Limit) const |
bool | empty () const |
MachineInstr & | instr_front () |
MachineInstr & | instr_back () |
const MachineInstr & | instr_front () const |
const MachineInstr & | instr_back () const |
MachineInstr & | front () |
MachineInstr & | back () |
const MachineInstr & | front () const |
const MachineInstr & | back () 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< iterator > | terminators () |
iterator_range< const_iterator > | terminators () const |
iterator_range< iterator > | phis () |
Returns a range that iterates over the phis in the basic block. | |
iterator_range< const_iterator > | phis () 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_iterator > | predecessors () |
iterator_range< const_pred_iterator > | predecessors () const |
iterator_range< succ_iterator > | successors () |
iterator_range< const_succ_iterator > | successors () const |
void | addLiveIn (MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll()) |
Adds the specified register as a live in. | |
void | addLiveIn (const RegisterMaskPair &RegMaskPair) |
LLVM_ABI void | sortUniqueLiveIns () |
Sorts and uniques the LiveIns vector. | |
LLVM_ABI void | clearLiveIns () |
Clear live in list. | |
LLVM_ABI void | clearLiveIns (std::vector< RegisterMaskPair > &OldLiveIns) |
Clear the live in list, and return the removed live in's in OldLiveIns . | |
LLVM_ABI 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. | |
LLVM_ABI void | removeLiveIn (MCRegister Reg, LaneBitmask LaneMask=LaneBitmask::getAll()) |
Remove the specified register from the live in set. | |
LLVM_ABI bool | isLiveIn (MCRegister 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_iterator > | liveins_dbg () const |
LLVM_ABI livein_iterator | livein_begin () const |
livein_iterator | livein_end () const |
bool | livein_empty () const |
iterator_range< livein_iterator > | liveins () const |
LLVM_ABI livein_iterator | removeLiveIn (livein_iterator I) |
Remove entry from the livein set and return iterator to the next. | |
const std::vector< RegisterMaskPair > & | getLiveIns () const |
LLVM_ABI 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_iterator > | liveouts () const |
LLVM_ABI const uint32_t * | getBeginClobberMask (const TargetRegisterInfo *TRI) const |
Get the clobber mask for the start of this basic block. | |
LLVM_ABI const uint32_t * | getEndClobberMask (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. | |
LLVM_ABI bool | hasEHPadSuccessor () const |
LLVM_ABI 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 | isEHContTarget () const |
Returns true if this is a target of Windows EH Continuation Guard. | |
void | setIsEHContTarget (bool V=true) |
Indicates if this is a target of Windows EH Continuation Guard. | |
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< UniqueBBID > | getBBID () const |
MBBSectionID | getSectionID () const |
Returns the section ID 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. | |
LLVM_ABI MCSymbol * | getEndSymbol () const |
Returns the MCSymbol marking the end of this basic block. | |
LLVM_ABI 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. | |
LLVM_ABI bool | isLegalToHoistInto () const |
Returns true if it is legal to hoist instructions into this block. | |
LLVM_ABI void | moveBefore (MachineBasicBlock *NewAfter) |
Move 'this' block before or after the specified block. | |
LLVM_ABI void | moveAfter (MachineBasicBlock *NewBefore) |
bool | sameSection (const MachineBasicBlock *MBB) const |
Returns true if this and MBB belong to the same section. | |
LLVM_ABI void | updateTerminator (MachineBasicBlock *PreviousLayoutSuccessor) |
Update the terminator instructions in block to account for changes to block layout which may have been made. | |
LLVM_ABI void | addSuccessor (MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown()) |
Add Succ as a successor of this MachineBasicBlock. | |
LLVM_ABI void | addSuccessorWithoutProb (MachineBasicBlock *Succ) |
Add Succ as a successor of this MachineBasicBlock. | |
LLVM_ABI 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. | |
LLVM_ABI void | validateSuccProbs () const |
Validate successors' probabilities and check if the sum of them is approximate one. | |
LLVM_ABI void | removeSuccessor (MachineBasicBlock *Succ, bool NormalizeSuccProbs=false) |
Remove successor from the successors list of this MachineBasicBlock. | |
LLVM_ABI succ_iterator | removeSuccessor (succ_iterator I, bool NormalizeSuccProbs=false) |
Remove specified successor from the successors list of this MachineBasicBlock. | |
LLVM_ABI void | replaceSuccessor (MachineBasicBlock *Old, MachineBasicBlock *New) |
Replace successor OLD with NEW and update probability info. | |
LLVM_ABI void | copySuccessor (const MachineBasicBlock *Orig, succ_iterator I) |
Copy a successor (and any probability info) from original block to this block's. | |
LLVM_ABI void | splitSuccessor (MachineBasicBlock *Old, MachineBasicBlock *New, bool NormalizeSuccProbs=false) |
Split the old successor into old plus new and updates the probability info. | |
LLVM_ABI 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). | |
LLVM_ABI 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. | |
LLVM_ABI bool | isPredecessor (const MachineBasicBlock *MBB) const |
Return true if the specified MBB is a predecessor of this block. | |
LLVM_ABI bool | isSuccessor (const MachineBasicBlock *MBB) const |
Return true if the specified MBB is a successor of this block. | |
LLVM_ABI 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. | |
LLVM_ABI const MachineBasicBlock * | getSingleSuccessor () const |
Return the successor of this block if it has a single successor. | |
MachineBasicBlock * | getSingleSuccessor () |
LLVM_ABI const MachineBasicBlock * | getSinglePredecessor () const |
Return the predecessor of this block if it has a single predecessor. | |
MachineBasicBlock * | getSinglePredecessor () |
LLVM_ABI MachineBasicBlock * | getFallThrough (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. | |
MachineBasicBlock * | getLogicalFallThrough () |
Return the fallthrough block if the block can implicitly transfer control to it's successor, whether by a branch or a fallthrough. | |
LLVM_ABI bool | canFallThrough () |
Return true if the block can implicitly transfer control to the block after it by falling off the end of it. | |
LLVM_ABI iterator | getFirstNonPHI () |
Returns a pointer to the first instruction in this block that is not a PHINode instruction. | |
const_iterator | getFirstNonPHI () const |
LLVM_ABI iterator | SkipPHIsAndLabels (iterator I) |
Return the first instruction in MBB after I that is not a PHI or a label. | |
LLVM_ABI 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. | |
LLVM_ABI iterator | getFirstTerminator () |
Returns an iterator to the first terminator instruction of this basic block. | |
const_iterator | getFirstTerminator () const |
LLVM_ABI instr_iterator | getFirstInstrTerminator () |
Same getFirstTerminator but it ignores bundles and return an instr_iterator instead. | |
LLVM_ABI iterator | getFirstTerminatorForward () |
Finds the first terminator in a block by scanning forward. | |
LLVM_ABI 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 |
LLVM_ABI 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. | |
LLVM_ABI MachineBasicBlock * | splitAt (MachineInstr &SplitInst, bool UpdateLiveIns=true, LiveIntervals *LIS=nullptr) |
Split a basic block into 2 pieces at SplitPoint . | |
MachineBasicBlock * | SplitCriticalEdge (MachineBasicBlock *Succ, Pass &P, std::vector< SparseBitVector<> > *LiveInSets=nullptr, MachineDomTreeUpdater *MDTU=nullptr) |
MachineBasicBlock * | SplitCriticalEdge (MachineBasicBlock *Succ, MachineFunctionAnalysisManager &MFAM, std::vector< SparseBitVector<> > *LiveInSets=nullptr, MachineDomTreeUpdater *MDTU=nullptr) |
LLVM_ABI MachineBasicBlock * | SplitCriticalEdge (MachineBasicBlock *Succ, const SplitCriticalEdgeAnalyses &Analyses, std::vector< SparseBitVector<> > *LiveInSets, MachineDomTreeUpdater *MDTU) |
LLVM_ABI MachineBasicBlock * | SplitCriticalEdge (MachineBasicBlock *Succ, Pass *P, MachineFunctionAnalysisManager *MFAM, std::vector< SparseBitVector<> > *LiveInSets, MachineDomTreeUpdater *MDTU) |
LLVM_ABI 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) |
LLVM_ABI 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. | |
LLVM_ABI 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. | |
MachineInstr * | remove (MachineInstr *I) |
Remove the unbundled instruction from the instruction list without deleting it. | |
LLVM_ABI MachineInstr * | remove_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'. | |
LLVM_ABI MachineBasicBlock * | removeFromParent () |
This method unlinks 'this' from the containing function, and returns it, but does not delete it. | |
LLVM_ABI void | eraseFromParent () |
This method unlinks 'this' from the containing function and deletes it. | |
LLVM_ABI 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. | |
LLVM_ABI 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 . | |
LLVM_ABI DebugLoc | findDebugLoc (instr_iterator MBBI) |
Find the next valid DebugLoc starting at MBBI, skipping any debug instructions. | |
DebugLoc | findDebugLoc (iterator MBBI) |
LLVM_ABI 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) |
LLVM_ABI DebugLoc | findPrevDebugLoc (instr_iterator MBBI) |
Find the previous valid DebugLoc preceding MBBI, skipping any debug instructions. | |
DebugLoc | findPrevDebugLoc (iterator MBBI) |
LLVM_ABI 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) |
LLVM_ABI DebugLoc | findBranchDebugLoc () |
Find and return the merged DebugLoc of the branch instructions of the block. | |
LLVM_ABI 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 . | |
LLVM_ABI void | dump () const |
LLVM_ABI void | print (raw_ostream &OS, const SlotIndexes *=nullptr, bool IsStandalone=true) const |
LLVM_ABI void | print (raw_ostream &OS, ModuleSlotTracker &MST, const SlotIndexes *=nullptr, bool IsStandalone=true) const |
LLVM_ABI void | printName (raw_ostream &os, unsigned printNameFlags=PrintNameIr, ModuleSlotTracker *moduleSlotTracker=nullptr) const |
Print the basic block's name as: | |
LLVM_ABI 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. | |
LLVM_ABI MCSymbol * | getSymbol () const |
Return the MCSymbol for this basic block. | |
LLVM_ABI MCSymbol * | getEHContSymbol () const |
Return the Windows EH Continuation Symbol for this basic block. | |
std::optional< uint64_t > | getIrrLoopHeaderWeight () const |
void | setIrrLoopHeaderWeight (uint64_t Weight) |
LLVM_ABI BranchProbability | getSuccProbability (const_succ_iterator Succ) const |
Return probability of the edge from this block to MBB. | |
LLVM_ABI bool | canPredictBranchProbabilities () const |
![]() | |
MachineBasicBlock * | getPrevNode () |
const MachineBasicBlock * | getPrevNode () const |
Get the previous node, or nullptr for the list head. | |
MachineBasicBlock * | getNextNode () |
Get the next node, or nullptr for the list tail. | |
const MachineBasicBlock * | getNextNode () const |
Get the next node, or nullptr for the list tail. | |
![]() | |
self_iterator | getIterator () |
const_self_iterator | getIterator () const |
reverse_self_iterator | getReverseIterator () |
const_reverse_self_iterator | getReverseIterator () const |
std::enable_if_t< T::is_sentinel_tracking_explicit, bool > | isSentinel () const |
Check whether this is the sentinel node. | |
![]() | |
const ParentTy * | getParent () const |
ParentTy * | getParent () |
void | setParent (ParentTy *Parent) |
Static Public Member Functions | |
static Instructions MachineBasicBlock::* | getSublistAccess (MachineInstr *) |
Support for MachineInstr::getNextNode(). | |
Friends | |
class | MachineFunction |
class | MachineBranchProbabilityInfo |
struct | ilist_callback_traits< MachineBasicBlock > |
Definition at line 121 of file MachineBasicBlock.h.
Definition at line 337 of file MachineBasicBlock.h.
Definition at line 371 of file MachineBasicBlock.h.
Definition at line 342 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_pred_iterator = SmallVectorImpl<MachineBasicBlock *>::const_iterator |
Definition at line 414 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_pred_reverse_iterator = SmallVectorImpl<MachineBasicBlock *>::const_reverse_iterator |
Definition at line 421 of file MachineBasicBlock.h.
Definition at line 339 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_reverse_iterator = MachineInstrBundleIterator<const MachineInstr, true> |
Definition at line 344 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_succ_iterator = SmallVectorImpl<MachineBasicBlock *>::const_iterator |
Definition at line 417 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_succ_reverse_iterator = SmallVectorImpl<MachineBasicBlock *>::const_reverse_iterator |
Definition at line 425 of file MachineBasicBlock.h.
Definition at line 336 of file MachineBasicBlock.h.
Definition at line 370 of file MachineBasicBlock.h.
Definition at line 341 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::livein_iterator = LiveInVector::const_iterator |
Definition at line 514 of file MachineBasicBlock.h.
Definition at line 413 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::pred_reverse_iterator = SmallVectorImpl<MachineBasicBlock *>::reverse_iterator |
Definition at line 419 of file MachineBasicBlock.h.
Definition at line 338 of file MachineBasicBlock.h.
Definition at line 343 of file MachineBasicBlock.h.
Definition at line 416 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::succ_reverse_iterator = SmallVectorImpl<MachineBasicBlock *>::reverse_iterator |
Definition at line 423 of file MachineBasicBlock.h.
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 1220 of file MachineBasicBlock.h.
Enumerator | |
---|---|
PrintNameIr | Add IR name where available. |
PrintNameAttributes | Print attributes. |
Definition at line 1246 of file MachineBasicBlock.h.
|
inline |
Definition at line 482 of file MachineBasicBlock.h.
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 643 of file MachineBasicBlock.cpp.
References addLiveIn(), llvm::MachineInstrBuilder::addReg(), assert(), begin(), llvm::BuildMI(), end(), front(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), I, isEHPad(), isLiveIn(), llvm::MCRegister::isPhysical(), llvm::RegState::Kill, llvm_unreachable, MRI, SkipPHIsAndLabels(), and TII.
|
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 478 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(), emitAlignedDPRCS2Spills(), llvm::SIFrameLowering::emitCSRSpillStores(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::SparcFrameLowering::emitEpilogue(), llvm::AArch64TargetLowering::EmitF128CSEL(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::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::SIFrameLowering::restoreCalleeSavedRegisters(), llvm::IRTranslator::runOnMachineFunction(), llvm::SystemZELFFrameLowering::spillCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::spillCalleeSavedRegisters(), llvm::AArch64FrameLowering::spillCalleeSavedRegisters(), llvm::SIFrameLowering::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(), llvm::XtensaFrameLowering::spillCalleeSavedRegisters(), SplitCriticalEdge(), splitEdge(), tryToSplitRestore(), updateLiveIn(), and updateLiveness().
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 796 of file MachineBasicBlock.cpp.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::adjustForSegmentedStacks(), copySuccessor(), createDedicatedExit(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::RISCVTargetLowering::emitDynamicProbedAlloc(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::SystemZTargetLowering::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(), emitStackProbeInline(), 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::SIInstrInfo::insertSimulatedTrap(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), loadM0FromVGPR(), loadMBUFScalarOperandsFromVGPR(), LowerFPToInt(), LowerMemcpy(), LowerMemset(), llvm::PeelSingleBlockLoop(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), splitAt(), splitBlockForLoop(), SplitCriticalEdge(), splitEdge(), splitMBB(), splitSuccessor(), transferSuccessors(), transferSuccessorsAndUpdatePHIs(), tryToSplitRestore(), and llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander().
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 806 of file MachineBasicBlock.cpp.
Referenced by copySuccessor(), llvm::FastISel::fastEmitBranch(), llvm::FastISel::finishCondBranch(), transferSuccessors(), and transferSuccessorsAndUpdatePHIs().
|
inline |
Definition at line 357 of file MachineBasicBlock.h.
References end().
Referenced by llvm::ARMBaseInstrInfo::analyzeBranch(), BBIsJumpedOver(), bbIsJumpedOver(), blockEndsInUnreachable(), llvm::calculateDbgEntityHistory(), cannotInsertTailCall(), llvm::ARMBasicBlockUtils::computeBlockSize(), getBBAddrMapMetadata(), getFallThrough(), llvm::XtensaInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), isEHScopeReturnBlock(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), isReturnBlock(), ProfitableToMerge(), llvm::HexagonInstrInfo::removeBranch(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::TailDuplicator::shouldTailDuplicate(), splitMBB(), llvm::FastISel::startNewBlock(), and terminatorIsComputedGotoWithSuccessors().
|
inline |
Definition at line 359 of file MachineBasicBlock.h.
References end().
|
inline |
Definition at line 377 of file MachineBasicBlock.h.
References instr_begin().
Referenced by addLiveIn(), llvm::LiveVariables::addNewBlock(), addUnreachableAfterTryTables(), 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::XtensaInstrInfo::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::GCNDownwardRPTracker::bumpDownwardPressure(), llvm::ErrataWorkaround::checkSeqTN0010(), llvm::ErrataWorkaround::checkSeqTN0010First(), llvm::ErrataWorkaround::checkSeqTN0012(), cloneCfiPrologue(), computeRegisterLiveness(), 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::LiveDebugVariables::LDVImpl::emitDebugValues(), llvm::RISCVTargetLowering::emitDynamicProbedAlloc(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::SystemZTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), 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::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), llvm::MachineRegisterInfo::EmitLiveInCopies(), emitLoadM0FromVGPRLoop(), emitLoadScalarOpsFromVGPRLoop(), EmitLoweredCascadedSelect(), emitLpad(), llvm::AArch64FrameLowering::emitPacRetPlusLeafHardening(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::XtensaFrameLowering::emitPrologue(), 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(), ensureEntrySetPrio(), 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(), fixupBlock(), TransferTracker::flushDbgValues(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), generateAssignInstrs(), llvm::rdf::Liveness::getAllReachingDefs(), getEarliestInsertPos(), getFirstNonDebugInstr(), getFirstTerminator(), llvm::getFirstValidInstructionInsertPoint(), llvm::getFunctionLiveInPhysReg(), getGatherLanePattern(), llvm::CSKYInstrInfo::getGlobalBaseReg(), llvm::SparcInstrInfo::getGlobalBaseReg(), llvm::VEInstrInfo::getGlobalBaseReg(), llvm::ARMHazardRecognizerFPMLx::getHazardType(), llvm::getInsertPtValidEnd(), getLatestInsertPos(), getNextMachineInstr(), llvm::ARMBasicBlockUtils::getOffsetOf(), llvm::getOpVariableMBBIt(), llvm::SITargetLowering::getPrefLoopAlignment(), getPreviousInstr(), llvm::RISCVRegisterInfo::getRegAllocationHints(), llvm::PhiLoweringHelper::getSaluInsertionAtEnd(), getSchedRegions(), llvm::WindowScheduler::getScheduleRange(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), indirectCopyToAGPR(), llvm::MipsFunctionInfo::initGlobalBaseReg(), INITIALIZE_PASS(), initMBBRange(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), insertCSRRestores(), insertCSRSaves(), insertSEHRange(), insertSpeculationBarrier(), 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(), LowerMemcpy(), LowerMemset(), llvm::CombinerHelper::matchOptBrCondByInvertingCond(), llvm::AArch64RegisterInfo::materializeFrameBaseRegister(), llvm::SIRegisterInfo::materializeFrameBaseRegister(), llvm::ARMBaseRegisterInfo::materializeFrameBaseRegister(), llvm::PPCRegisterInfo::materializeFrameBaseRegister(), llvm::RISCVRegisterInfo::materializeFrameBaseRegister(), llvm::M68kFrameLowering::mergeSPUpdates(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::PeelingModuloScheduleExpander::peelKernel(), llvm::PeelSingleBlockLoop(), phis(), llvm::WindowScheduler::preProcess(), 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::XtensaInstrInfo::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::TargetFrameLowering::restoreCalleeSavedRegister(), llvm::CSKYFrameLowering::restoreCalleeSavedRegisters(), llvm::PPCFrameLowering::restoreCalleeSavedRegisters(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), llvm::XCoreFrameLowering::restoreCalleeSavedRegisters(), llvm::WindowScheduler::restoreTripleMBB(), llvm::X86FrameLowering::restoreWinEHStackPointersInParent(), rollbackRestoreSplit(), runImpl(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::CFIFixup::runOnMachineFunction(), llvm::IRTranslator::runOnMachineFunction(), llvm::InsertNOPLoad::runOnMachineFunction(), llvm::FixAllFDIVSQRT::runOnMachineFunction(), scavengeFrameVirtualRegsInBlock(), signOutlinedFunction(), sizeWithoutDebugLargerThan(), skipBackwardPastNonInstructions(), llvm::X86FrameLowering::spillFPBP(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), splitBlockForLoop(), splitEndLoopBB(), llvm::WindowScheduler::updateLiveIntervals(), llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander(), verifyCTRBranch(), llvm::MemorySSA::verifyOrderingDominationAndDefUses(), and VerifyPHIs().
|
inline |
Definition at line 378 of file MachineBasicBlock.h.
References instr_begin().
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 1019 of file MachineBasicBlock.cpp.
References getFallThrough().
Referenced by AlignBlocks(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), isImplicitFallthrough(), ProfitableToMerge(), and llvm::TailDuplicator::shouldTailDuplicate().
bool MachineBasicBlock::canPredictBranchProbabilities | ( | ) | const |
Definition at line 1603 of file MachineBasicBlock.cpp.
References llvm::equal(), hasSuccessorProbabilities(), llvm::BranchProbability::normalizeProbabilities(), llvm::SmallVectorBase< Size_T >::size(), and succ_size().
Referenced by printMBB().
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 1391 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().
|
inline |
Definition at line 1141 of file MachineBasicBlock.h.
Referenced by llvm::InstructionSelect::selectMachineFunction(), and llvm::TailDuplicator::tailDuplicateAndUpdate().
|
inline |
Remove the reference to the underlying IR BasicBlock.
This is for reduction tools and should generally not be used.
Definition at line 257 of file MachineBasicBlock.h.
void MachineBasicBlock::clearLiveIns | ( | ) |
Clear live in list.
Definition at line 1766 of file MachineBasicBlock.cpp.
Referenced by llvm::recomputeLiveIns().
void MachineBasicBlock::clearLiveIns | ( | std::vector< RegisterMaskPair > & | OldLiveIns | ) |
Clear the live in list, and return the removed live in's in OldLiveIns
.
Requires that the vector OldLiveIns
is empty.
Definition at line 1770 of file MachineBasicBlock.cpp.
References assert(), and std::swap().
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 1655 of file MachineBasicBlock.cpp.
References llvm::AnalyzePhysRegInBundle(), begin(), end(), I, Info, liveins(), LQR_Dead, LQR_Live, LQR_Unknown, N, successors(), and TRI.
Referenced by loadMBUFScalarOperandsFromVGPR(), and llvm::X86InstrInfo::reMaterialize().
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 897 of file MachineBasicBlock.cpp.
References addSuccessor(), addSuccessorWithoutProb(), getSuccProbability(), and I.
LLVM_DUMP_METHOD void MachineBasicBlock::dump | ( | ) | const |
Definition at line 299 of file MachineBasicBlock.cpp.
References llvm::dbgs(), and print().
Referenced by llvm::PPCRegisterInfo::emitAccCopyInfo(), emitAccSpillRestoreInfo(), emitWAccSpillRestoreInfo(), runOnBasicBlock(), and splitMBB().
|
inline |
Definition at line 349 of file MachineBasicBlock.h.
Referenced by 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::DwarfDebug::emitInitialLocDirective(), llvm::findPHICopyInsertPoint(), generateAssignInstrs(), getBBAddrMapMetadata(), getFallThrough(), getNextMachineInstr(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::XtensaInstrInfo::insertIndirectBranch(), 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(), printMBB(), llvm::GCNRegPressurePrinter::runOnMachineFunction(), llvm::scavengeFrameVirtualRegs(), llvm::InstructionSelect::selectMachineFunction(), llvm::TailDuplicator::shouldTailDuplicate(), llvm::FastISel::startNewBlock(), and llvm::UpgradeDataLayoutString().
|
inline |
Definition at line 379 of file MachineBasicBlock.h.
References instr_end().
Referenced by addLiveIn(), llvm::LiveVariables::addNewBlock(), llvm::ScheduleDAGInstrs::addSchedBarrierDeps(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::XtensaInstrInfo::adjustStackPtr(), 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::XtensaInstrInfo::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(), llvm::GCNDownwardRPTracker::bumpDownwardPressure(), checkAndUpdateCCRKill(), checkAndUpdateCPSRKill(), checkCCKill(), checkEFLAGSLive(), llvm::ErrataWorkaround::checkSeqTN0010(), llvm::ErrataWorkaround::checkSeqTN0010First(), llvm::ErrataWorkaround::checkSeqTN0012(), clearKillFlags(), cloneCfiPrologue(), ComputeCommonTailLength(), computeRegisterLiveness(), llvm::Thumb1InstrInfo::copyPhysReg(), 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::RISCVTargetLowering::emitDynamicProbedAlloc(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::SystemZTargetLowering::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::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), emitLoadScalarOpsFromVGPRLoop(), EmitLoweredCascadedSelect(), llvm::AArch64FrameLowering::emitPacRetPlusLeafHardening(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), llvm::XtensaFrameLowering::emitPrologue(), 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(), emitStackProbeInline(), emitVecCondBranchPseudo(), emitXBegin(), ensureEntrySetPrio(), 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(), findInsertLocation(), findJumpTableIndex(), FindLastAluClause(), findNextInsertLocation(), findSurvivorBackwards(), llvm::fixStackStores(), fixupPHIOpBanks(), forEachJumpTableBranch(), generateAssignInstrs(), llvm::rdf::Liveness::getAllReachingDefs(), getArgumentStackToRestore(), llvm::RegPressureTracker::getCurrSlot(), getEarliestInsertPos(), llvm::getEHScopeMembership(), getFallThrough(), getFirstNonDebugInstr(), getFirstNonPrologue(), getFirstTerminator(), llvm::getFirstValidInstructionInsertPoint(), llvm::getInsertPtValidEnd(), llvm::InsertPointAnalysis::getLastInsertPointIter(), getLastNonDebugInstr(), getLatestInsertPos(), llvm::ReachingDefAnalysis::getLiveInUses(), llvm::ReachingDefAnalysis::getLocalLiveOutMIDef(), getNextFPInstruction(), getNextMachineInstr(), llvm::ARMBasicBlockUtils::getOffsetOf(), llvm::getOpVariableMBBIt(), getOrCreateFrameHelper(), getPreviousInstr(), llvm::ReachingDefAnalysis::getReachingLocalUses(), llvm::PhiLoweringHelper::getSaluInsertionAtEnd(), getSchedRegions(), llvm::X86InstrInfo::getSPAdjust(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::guessSuccessors(), HashEndOfMBB(), hasTailCall(), llvm::GCNSchedStage::initGCNRegion(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::X86FrameLowering::inlineStackProbe(), insert(), insertAfter(), llvm::R600InstrInfo::insertBranch(), llvm::HexagonInstrInfo::insertBranch(), llvm::XtensaInstrInfo::insertBranch(), insertDivByZeroTrap(), llvm::XtensaInstrInfo::insertIndirectBranch(), llvm::AArch64InstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertReturn(), llvm::SIInstrInfo::insertSimulatedTrap(), insertSpeculationBarrier(), IsBetterFallthrough(), IsBranchOnlyBlock(), IsEmptyBlock(), isInvoke(), llvm::Thumb2InstrInfo::isLegalToSplitMBBAt(), llvm::TargetInstrInfo::isMBBSafeToOutlineFrom(), llvm::isPhysRegUsedAfter(), llvm::CombinerHelper::isPredecessor(), llvm::ReachingDefAnalysis::isReachingDefLiveOut(), llvm::ReachingDefAnalysis::isRegDefinedAfter(), llvm::ReachingDefAnalysis::isSafeToDefRegAt(), isSafeToMove(), llvm::AArch64InstrInfo::isSchedulingBoundary(), llvm::ARMBaseInstrInfo::isSchedulingBoundary(), llvm::LoongArchInstrInfo::isSchedulingBoundary(), llvm::TailDuplicator::isSimpleBB(), llvm::SIInstrInfo::legalizeOperands(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), llvm::XtensaInstrInfo::loadImmediate(), llvm::SystemZInstrInfo::loadImmediate(), llvm::XCoreInstrInfo::loadImmediate(), loadMBUFScalarOperandsFromVGPR(), llvm::Mips16InstrInfo::loadRegFromStack(), llvm::MipsSEInstrInfo::loadRegFromStack(), llvm::SystemZInstrInfo::loadRegFromStackSlot(), llvm::XtensaInstrInfo::loadRegFromStackSlot(), llvm::ARMBaseInstrInfo::loadRegFromStackSlot(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), llvm::BPFInstrInfo::loadRegFromStackSlot(), llvm::SparcInstrInfo::loadRegFromStackSlot(), llvm::VEInstrInfo::loadRegFromStackSlot(), llvm::LoongArchInstrInfo::loadRegFromStackSlot(), llvm::MSP430InstrInfo::loadRegFromStackSlot(), llvm::CSKYInstrInfo::loadRegFromStackSlot(), llvm::XCoreInstrInfo::loadRegFromStackSlot(), llvm::LanaiInstrInfo::loadRegFromStackSlot(), llvm::PPCInstrInfo::loadRegFromStackSlotNoUpd(), LookForIdenticalPHI(), LowerFPToInt(), LowerMemcpy(), LowerMemset(), 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::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(), 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::SPIRVInstrInfo::removeBranch(), llvm::SystemZInstrInfo::removeBranch(), llvm::VEInstrInfo::removeBranch(), llvm::X86InstrInfo::removeBranch(), llvm::XCoreInstrInfo::removeBranch(), llvm::XtensaInstrInfo::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(), runImpl(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::InsertNOPLoad::runOnMachineFunction(), llvm::FixAllFDIVSQRT::runOnMachineFunction(), scavengeFrameVirtualRegsInBlock(), llvm::RegScavenger::scavengeRegisterBackwards(), llvm::impl_detail::MachineSchedulerBase::scheduleRegions(), setInsertPtAfterDef(), llvm::PPCInstrInfo::shouldReduceRegisterPressure(), shouldUseFrameHelper(), sizeWithoutDebugLargerThan(), skipBackwardPastNonInstructions(), SkipPHIsAndLabels(), SkipPHIsLabelsAndDebug(), llvm::CSKYFrameLowering::spillCalleeSavedRegisters(), llvm::MSP430FrameLowering::spillCalleeSavedRegisters(), llvm::RISCVFrameLowering::spillCalleeSavedRegisters(), llvm::XCoreFrameLowering::spillCalleeSavedRegisters(), llvm::SIRegisterInfo::spillEmergencySGPR(), 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::XtensaInstrInfo::storeRegToStackSlot(), llvm::CSKYInstrInfo::storeRegToStackSlot(), llvm::MSP430InstrInfo::storeRegToStackSlot(), llvm::XCoreInstrInfo::storeRegToStackSlot(), llvm::LanaiInstrInfo::storeRegToStackSlot(), terminators(), updateGetPCBundle(), llvm::WindowScheduler::updateLiveIntervals(), llvm::ScheduleDAGMILive::updatePressureDiffs(), llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander(), verifyCFIntrinsic(), verifyCTRBranch(), llvm::MemorySSA::verifyOrderingDominationAndDefUses(), and VerifyPHIs().
|
inline |
Definition at line 380 of file MachineBasicBlock.h.
References instr_end().
MachineBasicBlock::instr_iterator MachineBasicBlock::erase | ( | MachineBasicBlock::instr_iterator | I | ) |
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 1450 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::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::XtensaFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::Thumb1FrameLowering::eliminateCallFramePseudoInstr(), llvm::CSKYFrameLowering::eliminateCallFramePseudoInstr(), llvm::LoongArchFrameLowering::eliminateCallFramePseudoInstr(), llvm::M68kFrameLowering::eliminateCallFramePseudoInstr(), llvm::RISCVFrameLowering::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::lowerDMRRestore(), llvm::PPCRegisterInfo::lowerDMRSpilling(), 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(), popRegsFromStack(), llvm::HexagonInstrInfo::removeBranch(), removeDebugInstrs(), replaceFrameIndex(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::ThumbRegisterInfo::rewriteFrameIndex(), and rollbackRestoreSplit().
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 1112 of file MachineBasicBlock.h.
Remove a range of instructions from the instruction list and delete them.
Definition at line 1105 of file MachineBasicBlock.h.
|
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 1120 of file MachineBasicBlock.h.
|
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 1100 of file MachineBasicBlock.h.
Referenced by llvm::MachineInstr::eraseFromBundle().
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 1483 of file MachineBasicBlock.cpp.
References assert(), llvm::MachineFunction::erase(), and getParent().
Referenced by llvm::XtensaInstrInfo::analyzeBranch(), llvm::VPBasicBlock::connectToPredecessors(), llvm::MachineDomTreeUpdater::deleteBB(), llvm::X86TargetLowering::EmitKCFICheck(), eraseDeadBBsAndChildren(), llvm::Thumb2InstrInfo::ReplaceTailWithBranchTo(), rollbackRestoreSplit(), and GCEmptyBasicBlocks::runOnMachineFunction().
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 1566 of file MachineBasicBlock.cpp.
References DL, end(), getFirstTerminator(), and llvm::DebugLoc::getMergedLocation().
Referenced by FixTail(), INITIALIZE_PASS(), llvm::MIRProfileLoader::setBranchProbs(), SplitCriticalEdge(), updateBranches(), updateTerminator(), and updateTerminator().
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 1523 of file MachineBasicBlock.cpp.
References instr_end(), MBBI, and llvm::skipDebugInstructionsForward().
Referenced by llvm::R600InstrInfo::buildDefaultInstruction(), llvm::RISCVTargetLowering::emitDynamicProbedAlloc(), llvm::ARCFrameLowering::emitEpilogue(), emitGPDisp(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), emitLpad(), 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::RISCVInstrInfo::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().
Definition at line 1186 of file MachineBasicBlock.h.
References findDebugLoc(), and MBBI.
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 1543 of file MachineBasicBlock.cpp.
References instr_begin(), MBBI, and llvm::prev_nodbg().
Referenced by appendEndToFunction(), and findPrevDebugLoc().
Definition at line 1202 of file MachineBasicBlock.h.
References findPrevDebugLoc(), and MBBI.
|
inline |
Definition at line 356 of file MachineBasicBlock.h.
Referenced by addLiveIn(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::X86AsmPrinter::emitInstruction(), INITIALIZE_PASS(), llvm::SlotIndexes::insertMBBInMaps(), insertNopBeforeInstruction(), llvm::GCNRegPressurePrinter::runOnMachineFunction(), and scavengeFrameVirtualRegsInBlock().
|
inline |
Definition at line 358 of file MachineBasicBlock.h.
|
inline |
Retrieves the BasicBlock which corresponds to this MachineBasicBlock.
Definition at line 304 of file MachineBasicBlock.h.
Referenced by llvm::AsmPrinter::emitBasicBlockStart(), and printName().
|
inline |
Return alignment of the basic block.
Definition at line 639 of file MachineBasicBlock.h.
Referenced by llvm::ARMBasicBlockUtils::adjustBBOffsetsAfter(), llvm::DwarfDebug::beginCodeAlignment(), llvm::WinException::beginFunclet(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::MachineFunction::estimateFunctionSizeInBytes(), llvm::SIProgramInfo::getFunctionCodeSize(), llvm::SITargetLowering::getPrefLoopAlignment(), llvm::dxil::ResourceTypeInfo::getStruct(), and printName().
|
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 253 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::addLandingPad(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::SystemZ::emitBlockAfter(), llvm::SelectionDAGBuilder::EmitBranchForMergedCondition(), llvm::RISCVTargetLowering::emitDynamicProbedAlloc(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::SystemZTargetLowering::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(), emitStackProbeInline(), emitVecCondBranchPseudo(), emitXBegin(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::FastISel::fastEmitBranch(), llvm::SelectionDAGBuilder::FindMergedConditions(), llvm::FastISel::finishCondBranch(), getBranchHint(), getFullName(), llvm::MachineLoop::getLoopID(), getName(), hasName(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), insertDivByZeroTrap(), LowerFPToInt(), LowerMemcpy(), LowerMemset(), llvm::WebAssemblyException::print(), printName(), llvm::AArch64InstrInfo::probedStackAlloc(), processBlockAddr(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::SelectionDAG::shouldOptForSize(), llvm::GIMatchTableExecutor::shouldOptForSize(), splitAt(), and splitMBB().
|
inline |
Definition at line 706 of file MachineBasicBlock.h.
Referenced by assignSections(), llvm::AsmPrinter::emitBBAddrMapSection(), and printName().
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 1753 of file MachineBasicBlock.cpp.
References isEHFuncletEntry(), and TRI.
|
inline |
Return the call frame size on entry to this basic block.
Definition at line 1264 of file MachineBasicBlock.h.
Referenced by llvm::TargetInstrInfo::getCallFrameSizeAt(), and SplitCriticalEdge().
MCSymbol * MachineBasicBlock::getEHContSymbol | ( | ) | const |
Return the Windows EH Continuation Symbol for this basic block.
Definition at line 93 of file MachineBasicBlock.cpp.
References llvm::MachineFunction::getContext(), llvm::MachineFunction::getFunctionNumber(), getNumber(), llvm::MCContext::getOrCreateSymbol(), and getParent().
Referenced by llvm::AsmPrinter::emitBasicBlockStart().
const uint32_t * MachineBasicBlock::getEndClobberMask | ( | const TargetRegisterInfo * | TRI | ) | const |
Get the clobber mask for the end of the basic block.
Definition at line 1759 of file MachineBasicBlock.cpp.
References isReturnBlock(), succ_empty(), and TRI.
MCSymbol * MachineBasicBlock::getEndSymbol | ( | ) | const |
Returns the MCSymbol marking the end of this basic block.
Definition at line 104 of file MachineBasicBlock.cpp.
References llvm::MCContext::createBlockSymbol(), llvm::MachineFunction::getContext(), llvm::MachineFunction::getFunctionNumber(), getNumber(), and getParent().
Referenced by llvm::AsmPrinter::emitBBAddrMapSection(), llvm::AsmPrinter::emitFunctionBody(), and llvm::DebugHandlerBase::endInstruction().
MachineBasicBlock * MachineBasicBlock::getFallThrough | ( | 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.
If an explicit branch to the fallthrough block is not allowed, set JumpToFallThrough to be false. Non-null return is a conservative answer.
Definition at line 975 of file MachineBasicBlock.cpp.
References llvm::HexagonInstrInfo::analyzeBranch(), back(), Cond, empty(), end(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), getParent(), llvm::MachineFunction::getSubtarget(), llvm::HexagonInstrInfo::isPredicated(), isSuccessor(), TBB, and TII.
Referenced by canFallThrough(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), getLogicalFallThrough(), INITIALIZE_PASS(), and llvm::sortBasicBlocksAndUpdateBranches().
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, I, instr_begin(), and instr_end().
Referenced by llvm::PeelingModuloScheduleExpander::filterInstructions(), llvm::FinalizeBundleTestPass::run(), signOutlinedFunction(), and SplitCriticalEdge().
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().
|
inline |
Definition at line 947 of file MachineBasicBlock.h.
References getFirstNonDebugInstr().
MachineBasicBlock::iterator MachineBasicBlock::getFirstNonPHI | ( | ) |
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
When adding instructions to the beginning of the basic block, they should be added before the returned value, not before the first instruction, which might be PHI. Returns end() is there's no non-PHI instruction.
Definition at line 200 of file MachineBasicBlock.cpp.
References assert(), I, instr_begin(), and instr_end().
Referenced by addConstantsToTrack(), llvm::CombinerHelper::applyExtendThroughPhis(), llvm::SwiftErrorValueTracking::createEntriesInEntryBlock(), llvm::ScheduleDAGSDNodes::EmitSchedule(), llvm::LegalizerHelper::fewerElementsVectorPhi(), llvm::PeelingModuloScheduleExpander::filterInstructions(), fixupPHIOpBanks(), getFirstNonPHI(), getFirstNonPrologue(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVBoolType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::GetPoisonVal(), INITIALIZE_PASS(), llvm::LegalizerHelper::moreElementsVectorPhi(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::LegalizerHelper::narrowScalar(), llvm::PeelSingleBlockLoop(), phis(), llvm::SwiftErrorValueTracking::propagateVRegs(), llvm::FastISel::recomputeInsertPt(), llvm::MachineSSAUpdater::RewriteUse(), llvm::MachineFunction::salvageCopySSAImpl(), llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander(), and llvm::LegalizerHelper::widenScalar().
|
inline |
Definition at line 897 of file MachineBasicBlock.h.
References getFirstNonPHI().
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(), end(), and I.
Referenced by llvm::SIInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeLoopForPipelining(), llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::HexagonInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), copyDebugInfoToPredecessor(), llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::LiveDebugVariables::LDVImpl::emitDebugValues(), 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::emitPacRetPlusLeafHardening(), llvm::AArch64FrameLowering::emitPrologue(), llvm::ScheduleDAGSDNodes::EmitSchedule(), llvm::SPIRVTargetLowering::finalizeLowering(), findBranchDebugLoc(), findHoistingInsertPosAndDeps(), findInsertLocation(), findJumpTableIndex(), llvm::findPHICopyInsertPoint(), llvm::findSplitPointForStackProtector(), forEachJumpTableBranch(), llvm::getEHScopeMembership(), getFirstTerminator(), llvm::SITargetLowering::getPrefLoopAlignment(), llvm::PhiLoweringHelper::getSaluInsertionAtEnd(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), INITIALIZE_PASS(), llvm::HexagonInstrInfo::insertBranch(), insertCSRRestores(), llvm::SIInstrInfo::insertReturn(), insertUndefLaneMask(), llvm::SystemZPostRASchedStrategy::leaveMBB(), llvm::SIInstrInfo::legalizeOperands(), llvm::LegalizerHelper::moreElementsVectorPhi(), llvm::WindowScheduler::preProcess(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::X86FrameLowering::spillFPBP(), SplitCriticalEdge(), splitMBB(), and terminators().
|
inline |
Definition at line 917 of file MachineBasicBlock.h.
References getFirstTerminator().
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(), II, and instrs().
Referenced by llvm::LegalizerHelper::fewerElementsVectorPhi(), llvm::LegalizerHelper::narrowScalar(), and llvm::LegalizerHelper::widenScalar().
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 332 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().
|
inline |
Definition at line 1274 of file MachineBasicBlock.h.
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::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(), llvm::XtensaFrameLowering::emitEpilogue(), getArgumentStackToRestore(), 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::SPIRVInstrInfo::removeBranch(), llvm::XCoreInstrInfo::removeBranch(), llvm::RegBankSelect::RepairingPlacement::RepairingPlacement(), llvm::restoreStatusRegister(), and verifyCTRBranch().
|
inline |
Definition at line 969 of file MachineBasicBlock.h.
References getLastNonDebugInstr().
|
inline |
Definition at line 535 of file MachineBasicBlock.h.
Referenced by llvm::recomputeLiveIns().
|
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 882 of file MachineBasicBlock.h.
References getFallThrough().
|
inline |
Return the maximum amount of padding allowed for aligning the basic block.
Definition at line 650 of file MachineBasicBlock.h.
Referenced by llvm::AsmPrinter::emitBasicBlockStart().
StringRef MachineBasicBlock::getName | ( | ) | const |
Return the name of the corresponding LLVM basic block, or an empty string.
Definition at line 324 of file MachineBasicBlock.cpp.
References getBasicBlock().
Referenced by llvm::ARMBasicBlockUtils::adjustBBOffsetsAfter(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::AsmPrinter::emitFunctionBody(), getBlockName(), getBranchHint(), getCallStackHashV0(), llvm::GCNSchedStage::initGCNRegion(), INITIALIZE_PASS(), llvm::ARMBlockPlacement::moveBasicBlock(), runOnBasicBlock(), GCEmptyBasicBlocks::runOnMachineFunction(), llvm::scavengeFrameVirtualRegs(), llvm::VLIWMachineScheduler::schedule(), llvm::impl_detail::MachineSchedulerBase::scheduleRegions(), and splitEdge().
|
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 1260 of file MachineBasicBlock.h.
References Number.
Referenced by llvm::LiveVariables::addNewBlock(), llvm::ARMBasicBlockUtils::adjustBBOffsetsAfter(), assignSections(), llvm::SwitchCG::SwitchLowering::buildBitTests(), llvm::LiveIntervals::checkRegMaskInterference(), computeBlockInfo(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::AsmPrinter::createCallsiteEndSymbol(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::AMDGPUAsmPrinter::emitBasicBlockStart(), llvm::AsmPrinter::emitJumpTableEntry(), llvm::SwitchCG::SwitchLowering::findBitTestClusters(), fixupBlock(), llvm::WebAssembly::SortRegionInfo::getBottom(), llvm::MachineTraceMetrics::Ensemble::getDepthResources(), getEHContSymbol(), llvm::getEHScopeMembership(), getEndSymbol(), getFullName(), llvm::MachineTraceMetrics::Ensemble::getHeightResources(), getMCSymbolForMBB(), llvm::GraphTraits< const MachineBasicBlock * >::getNumber(), llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::getNumber(), llvm::GraphTraits< MachineBasicBlock * >::getNumber(), llvm::GraphTraits< Inverse< MachineBasicBlock * > >::getNumber(), llvm::ARMBasicBlockUtils::getOffsetOf(), llvm::MachineTraceMetrics::Trace::getResourceLength(), llvm::MachineTraceMetrics::getResources(), getSymbol(), llvm::MachineTraceMetrics::Ensemble::getTrace(), llvm::LiveVariables::HandleVirtRegUse(), INITIALIZE_PASS(), 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::CSKYConstantPoolMBB::print(), llvm::XtensaConstantPoolMBB::print(), llvm::WebAssemblyException::print(), printMBB(), printName(), llvm::SwiftErrorValueTracking::propagateVRegs(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), llvm::MachineFunction::RenumberBlocks(), llvm::impl_detail::MachineSchedulerBase::scheduleRegions(), llvm::MIRProfileLoader::setBranchProbs(), llvm::sortBasicBlocksAndUpdateBranches(), sortBlocks(), llvm::LoopTraversal::traverse(), updateBranches(), llvm::MachineTraceMetrics::Ensemble::updateDepth(), llvm::MachineTraceMetrics::Ensemble::verify(), VerifyPHIs(), and llvm::WriteGraph().
|
inline |
Definition at line 324 of file MachineBasicBlock.h.
|
inline |
Return the MachineFunction containing this basic block.
Definition at line 323 of file MachineBasicBlock.h.
Referenced by llvm::SIRegisterInfo::addImplicitUsesForBlockCSRLoad(), 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::XtensaInstrInfo::adjustStackPtr(), llvm::ARMBaseInstrInfo::analyzeBranch(), llvm::WebAssemblyInstrInfo::analyzeBranch(), analyzeCompressibleUses(), llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), llvm::RISCVInstrInfo::analyzeLoopForPipelining(), llvm::CombinerHelper::applyExtendThroughPhis(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), assignSections(), bbHasFallthrough(), BBHasFallthrough(), llvm::DwarfCFIException::beginBasicBlockSection(), llvm::DwarfDebug::beginCodeAlignment(), buildCFAOffs(), llvm::MSP430FrameLowering::BuildCFI(), llvm::X86FrameLowering::BuildCFI(), llvm::AArch64InstrInfo::buildClearRegister(), llvm::X86InstrInfo::buildClearRegister(), buildDefCFAReg(), buildGitPtr(), llvm::BuildMI(), BuildPACM(), llvm::SIRegisterInfo::buildSpillLoadStore(), llvm::ModuloScheduleExpanderMVE::canApply(), canCombine(), canFallThroughTo(), llvm::AArch64InstrInfo::canInsertSelect(), llvm::PPCInstrInfo::canInsertSelect(), llvm::SystemZInstrInfo::canInsertSelect(), llvm::X86InstrInfo::canInsertSelect(), llvm::SIInstrInfo::canInsertSelect(), cannotInsertTailCall(), canPredictSuccessors(), canSplitCriticalEdge(), llvm::Thumb1FrameLowering::canUseAsEpilogue(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::X86FrameLowering::canUseAsEpilogue(), llvm::AArch64FrameLowering::canUseAsPrologue(), llvm::RISCVFrameLowering::canUseAsPrologue(), llvm::X86FrameLowering::canUseAsPrologue(), cloneCfiPrologue(), cloneInstr(), llvm::WebAssemblyDebugValueManager::cloneSink(), CombineCVTAToLocal(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::HexagonBlockRanges::computeDeadMap(), llvm::computeLiveIns(), llvm::constrainSelectedInstRegOperands(), convertCalleeSaveRestoreToSPPrePostIncDec(), 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(), llvm::XtensaRegisterInfo::eliminateFrameIndex(), emitAlignedDPRCS2Restores(), emitAlignedDPRCS2Spills(), llvm::AArch64TargetLowering::EmitAllocateSMESaveBuffer(), llvm::AArch64TargetLowering::EmitAllocateZABuffer(), 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::RISCVTargetLowering::emitDynamicProbedAlloc(), llvm::PPCTargetLowering::emitEHSjLjLongJmp(), llvm::SystemZTargetLowering::emitEHSjLjLongJmp(), llvm::VETargetLowering::emitEHSjLjLongJmp(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::SystemZTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64TargetLowering::EmitEntryPStateSM(), llvm::AArch64TargetLowering::EmitF128CSEL(), llvm::emitFrameOffset(), emitFrameOffsetAdj(), emitFROUND(), llvm::AArch64TargetLowering::EmitGetSMESaveSize(), llvm::SITargetLowering::emitGWSMemViolTestLoop(), emitIndirectDst(), emitIndirectSrc(), llvm::AArch64TargetLowering::EmitInitTPIDR2Object(), 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(), emitPACCFI(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitPrologueEpilogueSPUpdate(), emitPseudoCTPOP(), emitPseudoVMSKCOND(), emitPseudoXVINSGR2VR(), emitQuietFCMP(), emitReadCounterWidePseudo(), llvm::ScheduleDAGSDNodes::EmitSchedule(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), llvm::VETargetLowering::emitSjLjDispatchBlock(), emitSplitF64Pseudo(), emitSplitPairF64Pseudo(), llvm::X86FrameLowering::emitSPUpdate(), emitStackProbeInline(), emitThumb1LoadConstPool(), emitThumb2LoadConstPool(), emitThumbRegPlusImmInReg(), emitVecCondBranchPseudo(), emitVFROUND_NOEXCEPT_MASK(), emitXBegin(), llvm::SIInstrInfo::enforceOperandRCAlignment(), eraseFromParent(), llvm::VEInstrInfo::expandExtendStackPseudo(), expandFillPPRFromZPRSlotPseudo(), llvm::VEInstrInfo::expandGetStackTopPseudo(), expandLoadStackGuard(), llvm::ARMBaseInstrInfo::expandLoadStackGuardBase(), llvm::SIInstrInfo::expandMovDPP64(), ExpandMOVImmSExti8(), llvm::AArch64InstrInfo::expandPostRAPseudo(), llvm::SIInstrInfo::expandPostRAPseudo(), llvm::HexagonInstrInfo::expandPostRAPseudo(), llvm::PPCInstrInfo::expandPostRAPseudo(), llvm::SparcTargetLowering::expandSelectCC(), expandSpillPPRToZPRSlotPseudo(), expandXorFP(), extractRsrcPtr(), llvm::finalizeBundle(), llvm::X86RegisterInfo::findDeadCallerSavedReg(), findDeadCallerSavedReg(), findIncDecAfter(), findIncDecBefore(), findJumpTableIndex(), findLoopIncrementValue(), llvm::SelectionDAGBuilder::FindMergedConditions(), llvm::findPHICopyInsertPoint(), findRenameRegForSameLdStRegPair(), findScratchNonCalleeSaveRegister(), FixTail(), fixupBlock(), fixupPHIOpBanks(), llvm::SystemZInstrInfo::foldImmediate(), llvm::TargetInstrInfo::foldMemoryOperand(), forceReg(), llvm::TargetInstrInfo::genAlternativeCodeSequence(), llvm::AArch64InstrInfo::genAlternativeCodeSequence(), generateEndPgm(), generateGatherLanePattern(), llvm::TargetInstrInfo::getAccumulatorChain(), llvm::TargetInstrInfo::getAccumulatorReassociationPatterns(), llvm::SIInstrInfo::getAddNoCarry(), getBBAddrMapMetadata(), getBBFallenThrough(), llvm::MachineLoop::getBottomBlock(), llvm::MachineInstr::getDebugInstrNum(), getEHContSymbol(), getEndSymbol(), getFallThrough(), llvm::PPCInstrInfo::getFMAPatterns(), getFMULPatterns(), getFNEGPatterns(), getFoldableImm(), getFrameIndexMMO(), getFullName(), getImmedFromMO(), getIndVarInfo(), llvm::AArch64InstrInfo::getInstSizeInBytes(), llvm::ARMBaseInstrInfo::getInstSizeInBytes(), getLayoutSuccessorProbThreshold(), getLiveRegsForEntryMBB(), getLoadStoreOffsetSizeInBits(), getMCSymbolForMBB(), llvm::MipsInstrInfo::GetMemOperand(), llvm::MachineInstr::getMF(), getMFIfAvailable(), getNextBlock(), llvm::AArch64InstrInfo::getOutlinableRanges(), llvm::RISCVInstrInfo::getOutliningTypeImpl(), getSchedRegions(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::HexagonInstrInfo::getSize(), llvm::LiveIntervals::getSpillWeight(), getSymbol(), GetSymbolRef(), llvm::MachineLoop::getTopBlock(), llvm::TargetInstrInfo::hasReassociableOperands(), llvm::RISCVInstrInfo::hasReassociableOperands(), llvm::TargetInstrInfo::hasReassociableSibling(), hoistAndMergeSGPRInits(), indirectCopyToAGPR(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::ARMBaseInstrInfo::insertBranch(), llvm::VEInstrInfo::insertBranch(), insertCSRRestores(), insertCSRSaves(), insertDivByZeroTrap(), llvm::SIInstrInfo::insertEQ(), llvm::XtensaInstrInfo::insertIndirectBranch(), llvm::AArch64InstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), llvm::SlotIndexes::insertMBBInMaps(), llvm::insertMultibyteShift(), llvm::SIInstrInfo::insertNE(), insertRememberRestorePair(), llvm::SIInstrInfo::insertReturn(), InsertSEH(), insertSEH(), llvm::SIInstrInfo::insertSelect(), llvm::AArch64InstrInfo::insertSelect(), llvm::PPCInstrInfo::insertSelect(), llvm::SystemZInstrInfo::insertSelect(), llvm::X86InstrInfo::insertSelect(), llvm::SIInstrInfo::insertSimulatedTrap(), insertUndefLaneMask(), llvm::SIInstrInfo::insertVectorSelect(), llvm::InstrEmitter::InstrEmitter(), isCandidatePatchable(), isCombineInstrCandidateFP(), isCVTAToLocalCombinationCandidate(), isDefinedOutside(), llvm::MachineInstr::isDereferenceableInvariantLoad(), isEntryBlock(), 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::XtensaInstrInfo::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::lowerDMRRestore(), llvm::PPCRegisterInfo::lowerDMRSpilling(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::PPCRegisterInfo::lowerDynamicAreaOffset(), LowerFPToInt(), LowerMemcpy(), LowerMemset(), llvm::PPCRegisterInfo::lowerOctWordSpilling(), llvm::PPCRegisterInfo::lowerPrepareProbedAlloca(), llvm::PPCRegisterInfo::lowerQuadwordRestore(), llvm::PPCRegisterInfo::lowerQuadwordSpilling(), llvm::RISCVRegisterInfo::lowerSegmentSpillReload(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), 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::PPCInstrInfo::materializeImmPostRA(), maybeUpdateTerminator(), mergeOperations(), 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(), print(), printMBB(), 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::SIRegisterInfo::resolveFrameIndex(), llvm::ARMBaseRegisterInfo::resolveFrameIndex(), llvm::PPCRegisterInfo::resolveFrameIndex(), llvm::SystemZELFFrameLowering::restoreCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::restoreCalleeSavedRegisters(), llvm::AArch64FrameLowering::restoreCalleeSavedRegisters(), llvm::SIFrameLowering::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::shouldOptimizeForSize(), llvm::PPCInstrInfo::shouldReduceRegisterPressure(), llvm::TailDuplicator::shouldTailDuplicate(), shouldUseFrameHelper(), llvm::WebAssemblyDebugValueManager::sink(), SkipPHIsAndLabels(), SkipPHIsLabelsAndDebug(), llvm::SystemZELFFrameLowering::spillCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::spillCalleeSavedRegisters(), llvm::AArch64FrameLowering::spillCalleeSavedRegisters(), llvm::SIFrameLowering::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(), llvm::XtensaFrameLowering::spillCalleeSavedRegisters(), spillVGPRtoAGPR(), splitAt(), splitBlock(), splitBlockForLoop(), SplitCriticalEdge(), splitEdge(), splitEndLoopBB(), 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(), validateFunCall(), validateFunCallMachineDef(), validatePtrTypes(), verifyCFIntrinsic(), verifyCTRBranch(), llvm::SelectionDAGBuilder::visitSPDescriptorFailure(), and llvm::SelectionDAGBuilder::visitSPDescriptorParent().
|
inline |
Returns the section ID of this basic block.
Definition at line 709 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::assignBeginEndSections(), assignSections(), llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), llvm::DwarfDebug::beginInstruction(), llvm::EHStreamer::computeCallSiteTable(), llvm::AsmPrinter::emitBBAddrMapSection(), llvm::AsmPrinter::emitFunctionBody(), fixupBlock(), llvm::AsmPrinter::getMBBExceptionSym(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::AArch64InstrInfo::insertIndirectBranch(), printName(), llvm::CFIFixup::runOnMachineFunction(), and sameSection().
|
inline |
Definition at line 867 of file MachineBasicBlock.h.
References getSinglePredecessor().
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 971 of file MachineBasicBlock.cpp.
Referenced by getSinglePredecessor().
|
inline |
Definition at line 858 of file MachineBasicBlock.h.
References getSingleSuccessor().
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 967 of file MachineBasicBlock.cpp.
Referenced by getSingleSuccessor().
|
inlinestatic |
Support for MachineInstr::getNextNode().
Definition at line 393 of file MachineBasicBlock.h.
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 1583 of file MachineBasicBlock.cpp.
References llvm::BranchProbability::getZero(), P, and succ_size().
Referenced by copySuccessor(), print(), and printMBB().
MCSymbol * MachineBasicBlock::getSymbol | ( | ) | const |
Return the MCSymbol for this basic block.
Definition at line 61 of file MachineBasicBlock.cpp.
References llvm::MBBSectionID::ColdSectionID, llvm::MCContext::createBlockSymbol(), llvm::MBBSectionID::ExceptionSectionID, llvm::MachineFunction::getContext(), llvm::MachineFunction::getFunctionNumber(), llvm::MachineFunction::getName(), getNumber(), llvm::MCContext::getOrCreateSymbol(), getParent(), llvm::MachineFunction::hasBBSections(), hasLabelMustBeEmitted(), 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::emitJumpTableEntry(), llvm::ARMAsmPrinter::emitJumpTableInsts(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::XtensaAsmPrinter::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(), llvm::AMDGPUMCInstLower::lowerOperand(), llvm::CSKYMCInstLower::lowerOperand(), llvm::LowerPPCMachineOperandToMCOperand(), llvm::XtensaAsmPrinter::LowerSymbolOperand(), llvm::WebAssemblyAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::printOperand(), llvm::MipsAsmPrinter::printOperand(), and llvm::HexagonAsmPrinter::printOperand().
|
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.
The name of this function hasAddressTaken
implies that the address of the block is known and used in a general sense, but not necessarily that the address is used by an indirect branch instruction. So branch target enforcement need not put a BTI instruction (or equivalent) at the start of a block just because this function returns true. The decision about whether to add a BTI can be more subtle than that, and depends on the more detailed checks that this function aggregates together.
Definition at line 282 of file MachineBasicBlock.h.
Referenced by llvm::MachineLoopInfo::findLoopPreheader(), llvm::HexagonAsmPrinter::isBlockOnlyReachableByFallthrough(), GCEmptyBasicBlocks::runOnMachineFunction(), and llvm::TailDuplicator::tailDuplicateAndUpdate().
bool MachineBasicBlock::hasEHPadSuccessor | ( | ) | const |
Definition at line 287 of file MachineBasicBlock.cpp.
References successors().
Referenced by isInvoke(), and isLegalToHoistInto().
|
inline |
Test whether this block must have its label emitted.
Definition at line 316 of file MachineBasicBlock.h.
Referenced by llvm::AsmPrinter::emitBasicBlockStart(), and getSymbol().
bool MachineBasicBlock::hasName | ( | ) | const |
Check if there is a name of corresponding LLVM basic block.
Definition at line 318 of file MachineBasicBlock.cpp.
References getBasicBlock().
|
inline |
Return true if any of the successors have probabilities attached to them.
Definition at line 839 of file MachineBasicBlock.h.
Referenced by canPredictBranchProbabilities().
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 1463 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(), cloneCfiPrologue(), cloneInstr(), llvm::MachineFunction::cloneMachineInstrBundle(), llvm::WebAssemblyDebugValueManager::cloneSink(), CombineCVTAToLocal(), llvm::X86InstrInfo::convertToThreeAddress(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::LiveDebugVariables::LDVImpl::emitDebugValues(), llvm::X86TargetLowering::EmitKCFICheck(), llvm::TargetLoweringBase::emitPatchPoint(), llvm::X86FrameLowering::emitPrologue(), llvm::ScheduleDAGSDNodes::EmitSchedule(), llvm::SPIRVTargetLowering::finalizeLowering(), 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::ARMBlockPlacement::revertWhileToDoLoop(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::GCNIterativeScheduler::scheduleRegion(), llvm::WebAssemblyDebugValueManager::sink(), llvm::PPCFrameLowering::spillCalleeSavedRegisters(), and llvm::PPCInstrInfo::storeRegToStackSlotNoUpd().
|
inline |
|
inline |
Insert MI into the instruction list after I.
Definition at line 1070 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().
|
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 1080 of file MachineBasicBlock.h.
References assert(), I, instr_end(), and MI.
|
inline |
Definition at line 352 of file MachineBasicBlock.h.
Referenced by llvm::SIFrameLowering::emitCSRSpillRestores().
|
inline |
Definition at line 354 of file MachineBasicBlock.h.
|
inline |
Definition at line 361 of file MachineBasicBlock.h.
Referenced by llvm::HexagonInstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeBranch(), begin(), llvm::AArch64FrameLowering::emitPrologue(), llvm::finalizeBundles(), findPrevDebugLoc(), TransferTracker::flushDbgValues(), llvm::HexagonInstrInfo::getBranchingInstrs(), llvm::TargetInstrInfo::getCallFrameSizeAt(), getFirstInstrTerminator(), getFirstNonPHI(), getLastNonDebugInstr(), llvm::ReachingDefAnalysis::getLiveInUses(), INITIALIZE_PASS(), instrs(), isSignExtendedW(), llvm::PPCInstrInfo::isSignOrZeroExtended(), llvm::HexagonInstrInfo::nonDbgBBSize(), llvm::WebAssemblyInstrInfo::removeBranch(), ReplaceUsesOfBlockWith(), rescheduleCanonically(), rfindDebugLoc(), llvm::FinalizeBundleTestPass::run(), and SplitCriticalEdge().
|
inline |
Definition at line 362 of file MachineBasicBlock.h.
|
inline |
Definition at line 363 of file MachineBasicBlock.h.
Referenced by llvm::GCNSubtarget::adjustSchedDependency(), llvm::HexagonInstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeBranch(), analyzeCompressibleUses(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), llvm::AsmPrinter::emitCFIInstruction(), llvm::LiveDebugVariables::LDVImpl::emitDebugValues(), llvm::AMDGPUAsmPrinter::emitInstruction(), llvm::R600AsmPrinter::emitInstruction(), llvm::HexagonAsmPrinter::emitInstruction(), emitSelectPseudo(), emitThumbRegPlusImmInReg(), end(), llvm::examineCFlagsUse(), llvm::finalizeBundle(), llvm::finalizeBundles(), findDebugLoc(), findNextInsertLocation(), llvm::HexagonInstrInfo::getBranchingInstrs(), getFirstInstrTerminator(), getFirstNonPHI(), getLastNonDebugInstr(), llvm::ReachingDefAnalysis::getLiveInUses(), getLivePhysRegsUpTo(), llvm::HexagonInstrInfo::hasLoadFromStackSlot(), llvm::HexagonInstrInfo::hasStoreToStackSlot(), INITIALIZE_PASS(), insert(), insertAfterBundle(), instrs(), isLibCallInTailPosition(), llvm::HexagonInstrInfo::nonDbgBBSize(), llvm::WebAssemblyInstrInfo::removeBranch(), ReplaceUsesOfBlockWith(), rescheduleCanonically(), splitBlock(), SplitCriticalEdge(), and llvm::HexagonInstrInfo::translateInstrsForDup().
|
inline |
Definition at line 364 of file MachineBasicBlock.h.
|
inline |
Definition at line 351 of file MachineBasicBlock.h.
|
inline |
Definition at line 353 of file MachineBasicBlock.h.
|
inline |
Definition at line 365 of file MachineBasicBlock.h.
Referenced by forEachJumpTableBranch(), llvm::AArch64InstrInfo::getOutlinableRanges(), hasJumpTableInfoInBlock(), llvm::ReachingDefAnalysis::isRegUsedAfter(), rbegin(), and rfindDebugLoc().
|
inline |
Definition at line 366 of file MachineBasicBlock.h.
|
inline |
Definition at line 367 of file MachineBasicBlock.h.
Referenced by forAllMIsUntilDef(), forEachJumpTableBranch(), llvm::AArch64InstrInfo::getOutlinableRanges(), getWaitStatesSince(), hasHazard(), hasJumpTableInfoInBlock(), llvm::ReachingDefAnalysis::isRegUsedAfter(), rend(), rfindDebugLoc(), and rfindPrevDebugLoc().
|
inline |
Definition at line 368 of file MachineBasicBlock.h.
|
inline |
Definition at line 372 of file MachineBasicBlock.h.
References instr_begin(), and instr_end().
Referenced by llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::RegBankSelect::assignRegisterBanks(), llvm::WindowScheduler::backupMBB(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), copyDebugInfoToPredecessor(), copyDebugInfoToSuccessor(), llvm::PPCInstrInfo::findLoopInstr(), findPrologueEnd(), getFirstTerminatorForward(), llvm::instrs(), print(), printMBB(), propagateLocalCopies(), rescheduleCanonically(), and verifyConvergenceControl().
|
inline |
Definition at line 373 of file MachineBasicBlock.h.
References instr_begin(), and instr_end().
|
inline |
Returns true if this block begins any section.
Definition at line 697 of file MachineBasicBlock.h.
Referenced by llvm::avoidZeroOffsetLandingPad(), llvm::EHStreamer::computeCallSiteTable(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::AsmPrinter::emitBBAddrMapSection(), fixupBlock(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), and getSymbol().
|
inline |
Returns true if this is the entry block of a cleanup funclet.
Definition at line 691 of file MachineBasicBlock.h.
Referenced by llvm::WinException::beginFunclet(), llvm::X86FrameLowering::emitPrologue(), and getMCSymbolForMBB().
|
inline |
Returns true if this is a target of Windows EH Continuation Guard.
Definition at line 679 of file MachineBasicBlock.h.
Referenced by llvm::AsmPrinter::emitBasicBlockStart().
|
inline |
Returns true if this is the entry block of an EH funclet.
Definition at line 685 of file MachineBasicBlock.h.
Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::AArch64FrameLowering::emitPacRetPlusLeafHardening(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), getBeginClobberMask(), getMCSymbolForMBB(), printName(), llvm::X86FrameLowering::restoreWinEHStackPointersInParent(), and llvm::X86FrameLowering::spillCalleeSavedRegisters().
|
inline |
Returns true if the block is a landing pad.
That is this basic block is entered via an exception handler.
Definition at line 659 of file MachineBasicBlock.h.
Referenced by addLiveIn(), assignSections(), llvm::avoidZeroOffsetLandingPad(), canSplitCriticalEdge(), collectEHScopeMembers(), llvm::EHStreamer::computeCallSiteTable(), llvm::VETargetLowering::emitSjLjDispatchBlock(), llvm::WebAssembly::findCatch(), llvm::findPHICopyInsertPoint(), getBBAddrMapMetadata(), llvm::WebAssembly::SortRegionInfo::getBottom(), llvm::getEHScopeMembership(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), printName(), llvm::WebAssemblyExceptionInfo::recalculate(), llvm::X86FrameLowering::restoreWinEHStackPointersInParent(), GCEmptyBasicBlocks::runOnMachineFunction(), llvm::MIRParserImpl::setupRegisterInfo(), sortBlocks(), splitEdge(), and updateTerminator().
|
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 672 of file MachineBasicBlock.h.
Referenced by llvm::getEHScopeMembership().
|
inline |
Convenience function that returns true if the bock ends in a EH scope return instruction.
Definition at line 982 of file MachineBasicBlock.h.
References back(), empty(), and llvm::MachineInstr::isEHScopeReturn().
Referenced by collectEHScopeMembers().
|
inline |
Returns true if this block ends any section.
Definition at line 700 of file MachineBasicBlock.h.
Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), llvm::EHStreamer::computeCallSiteTable(), llvm::AsmPrinter::emitBasicBlockEnd(), llvm::AsmPrinter::emitBBAddrMapSection(), llvm::AsmPrinter::emitFunctionBody(), llvm::DebugHandlerBase::endInstruction(), and updateBranches().
bool MachineBasicBlock::isEntryBlock | ( | ) | const |
Returns true if this is the entry block of the function.
Definition at line 294 of file MachineBasicBlock.cpp.
References llvm::MachineFunction::begin(), llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), and getParent().
Referenced by llvm::DebugHandlerBase::beginBasicBlockSection(), llvm::AsmPrinter::emitBasicBlockStart(), and llvm::AsmPrinter::emitBBAddrMapSection().
|
inline |
Returns true if this is the indirect dest of an INLINEASM_BR.
Definition at line 729 of file MachineBasicBlock.h.
Referenced by canSplitCriticalEdge(), llvm::TailDuplicator::canTailDuplicate(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::findPHICopyInsertPoint(), llvm::AArch64InstrInfo::isMBBSafeToSplitToCold(), and printName().
|
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.)
If this function returns true, it does mean that branch target enforcement needs to put a BTI or equivalent at the start of the block.
Definition at line 301 of file MachineBasicBlock.h.
Referenced by llvm::AsmPrinter::emitBasicBlockStart(), printName(), and terminatorIsComputedGotoWithSuccessors().
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 962 of file MachineBasicBlock.cpp.
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().
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().
bool MachineBasicBlock::isLiveIn | ( | MCRegister | Reg, |
LaneBitmask | LaneMask = LaneBitmask::getAll() |
||
) | const |
Return true if the specified register is in the live in set.
Definition at line 616 of file MachineBasicBlock.cpp.
References llvm::find_if(), I, livein_end(), and llvm::MachineBasicBlock::RegisterMaskPair::PhysReg.
Referenced by addLiveIn(), addLiveInRegs(), addSavedGPR(), AnyAliasLiveIn(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), buildPrologSpill(), llvm::AArch64FrameLowering::canUseAsPrologue(), llvm::RISCVFrameLowering::canUseAsPrologue(), llvm::X86FrameLowering::canUseAsPrologue(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::SystemZXPLINKFrameLowering::emitPrologue(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::getFunctionLiveInPhysReg(), llvm::ReachingDefAnalysis::getGlobalUses(), INITIALIZE_PASS(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), llvm::AArch64InstrInfo::insertOutlinedCall(), llvm::ARMBaseInstrInfo::insertOutlinedCall(), isEFLAGSLive(), isLiveIntoMBB(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::SystemZELFFrameLowering::processFunctionBeforeFrameFinalized(), llvm::RISCVFrameLowering::spillCalleeSavedRegisters(), and updateLiveness().
|
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.
If this function returns true, it does mean that branch target enforcement needs to put a BTI or equivalent at the start of the block.
Definition at line 294 of file MachineBasicBlock.h.
Referenced by llvm::AsmPrinter::emitBasicBlockStart(), and printName().
bool MachineBasicBlock::isPredecessor | ( | const MachineBasicBlock * | MBB | ) | const |
Return true if the specified MBB is a predecessor of this block.
Definition at line 954 of file MachineBasicBlock.cpp.
References llvm::is_contained(), MBB, and predecessors().
Referenced by getPreviousInstr(), llvm::MachineTraceMetrics::Ensemble::invalidate(), and llvm::MachineTraceMetrics::Ensemble::verify().
|
inline |
Convenience function that returns true if the block ends in a return instruction.
Definition at line 976 of file MachineBasicBlock.h.
References back(), empty(), and llvm::MachineInstr::isReturn().
Referenced by llvm::LiveRegUnits::addLiveOuts(), llvm::LivePhysRegs::addLiveOutsNoPristines(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::X86FrameLowering::canUseAsEpilogue(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitPacRetPlusLeafHardening(), getBBAddrMapMetadata(), getEndClobberMask(), isLegalToHoistInto(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), llvm::AggressiveAntiDepBreaker::StartBlock(), and llvm::CriticalAntiDepBreaker::StartBlock().
bool MachineBasicBlock::isSuccessor | ( | const MachineBasicBlock * | MBB | ) | const |
Return true if the specified MBB is a successor of this block.
Definition at line 958 of file MachineBasicBlock.cpp.
References llvm::is_contained(), MBB, and successors().
Referenced by addIncomingValuesToPHIs(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::ScheduleDAGMILive::computeCyclicCriticalPath(), getFallThrough(), getLayoutSuccessorProbThreshold(), getNextMachineInstr(), llvm::MachineTraceMetrics::Ensemble::invalidate(), IsBetterFallthrough(), llvm::ARMBlockPlacement::moveBasicBlock(), llvm::TailDuplicator::shouldTailDuplicate(), splitEdge(), updatePHIs(), updateTerminator(), and llvm::MachineTraceMetrics::Ensemble::verify().
MachineBasicBlock::livein_iterator MachineBasicBlock::livein_begin | ( | ) | const |
Definition at line 1776 of file MachineBasicBlock.cpp.
References assert(), and getParent().
Referenced by liveins().
|
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 520 of file MachineBasicBlock.h.
Referenced by liveins_dbg().
|
inline |
Definition at line 527 of file MachineBasicBlock.h.
Referenced by llvm::addLiveIns(), print(), and printMBB().
|
inline |
Definition at line 526 of file MachineBasicBlock.h.
Referenced by isLiveIn(), liveins(), and liveins_dbg().
|
inline |
Definition at line 528 of file MachineBasicBlock.h.
References livein_begin(), livein_end(), and llvm::make_range().
Referenced by addBlockLiveIns(), llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::rdf::DataFlowGraph::build(), computeRegisterLiveness(), llvm::AArch64FrameLowering::emitPrologue(), isEAXLiveIn(), isRegLiveIn(), print(), llvm::AArch64FrameLowering::spillCalleeSavedRegisters(), SplitCriticalEdge(), splitEdge(), and tryToSplitRestore().
|
inline |
Definition at line 521 of file MachineBasicBlock.h.
References livein_begin_dbg(), livein_end(), and llvm::make_range().
Referenced by printMBB().
MachineBasicBlock::liveout_iterator MachineBasicBlock::liveout_begin | ( | ) | const |
Iterator scanning successor basic blocks' liveins to determine the registers potentially live at the end of this block.
There may be duplicates or overlapping registers in the list returned.
Definition at line 1782 of file MachineBasicBlock.cpp.
References llvm::TargetLoweringBase::getExceptionPointerRegister(), llvm::TargetLoweringBase::getExceptionSelectorRegister(), llvm::MachineFunction::getFunction(), getParent(), llvm::Function::getPersonalityFn(), llvm::MachineFunction::getSubtarget(), llvm::TargetSubtargetInfo::getTargetLowering(), and llvm::Function::hasPersonalityFn().
Referenced by liveouts().
|
inline |
Definition at line 621 of file MachineBasicBlock.h.
Referenced by liveouts().
|
inline |
Definition at line 624 of file MachineBasicBlock.h.
References liveout_begin(), liveout_end(), and llvm::make_range().
Referenced by addBlockLiveOuts(), emitThumbRegPlusImmInReg(), and llvm::isPhysRegUsedAfter().
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().
void MachineBasicBlock::moveAfter | ( | MachineBasicBlock * | NewBefore | ) |
Definition at line 678 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::ARMTargetLowering::EmitInstrWithCustomInserter(), and sortBlocks().
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 674 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().
|
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 790 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().
|
inline |
Returns a range that iterates over the phis in the basic block.
Definition at line 405 of file MachineBasicBlock.h.
References begin(), getFirstNonPHI(), and llvm::make_range().
Referenced by llvm::ModuloScheduleExpanderMVE::canApply(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PeelingModuloScheduleExpander::fixupBranches(), llvm::WindowScheduler::generateTripleMBB(), llvm::WindowScheduler::getIssueOrder(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), phis(), replacePhiUsesWith(), and llvm::WindowScheduler::schedulePhi().
|
inline |
Definition at line 408 of file MachineBasicBlock.h.
References phis().
|
inline |
Definition at line 1041 of file MachineBasicBlock.h.
|
inline |
Definition at line 1040 of file MachineBasicBlock.h.
|
inline |
Definition at line 427 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
Referenced by llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), BBIsJumpedOver(), bbIsJumpedOver(), llvm::ModuloScheduleExpander::expand(), llvm::SPIRVTargetLowering::finalizeLowering(), findWLS(), getSingleSchedPred(), INITIALIZE_PASS(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), isSaveReachableThroughClean(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::PeelingModuloScheduleExpander::peelPrologAndEpilogs(), llvm::pred_begin(), predecessors(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), searchPredecessors(), SinkingPreventsImplicitNullCheck(), and VerifyPHIs().
|
inline |
Definition at line 428 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
|
inline |
Definition at line 442 of file MachineBasicBlock.h.
References llvm::SmallVectorBase< Size_T >::empty().
Referenced by llvm::rdf::DataFlowGraph::build(), eraseDeadBBsAndChildren(), llvm::SPIRVTargetLowering::finalizeLowering(), llvm::getEHScopeMembership(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::TailDuplicator::isSimpleBB(), print(), llvm::TailDuplicator::tailDuplicateAndUpdate(), and validThroughout().
|
inline |
Definition at line 429 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by isSaveReachableThroughClean(), llvm::pred_end(), predecessors(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), searchPredecessors(), and VerifyPHIs().
|
inline |
Definition at line 430 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
|
inline |
Definition at line 431 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rbegin().
Referenced by llvm::LiveVariables::MarkVirtRegAliveInBlock().
|
inline |
Definition at line 433 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rbegin().
|
inline |
Definition at line 435 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rend().
Referenced by llvm::LiveVariables::MarkVirtRegAliveInBlock().
|
inline |
Definition at line 437 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rend().
|
inline |
Definition at line 439 of file MachineBasicBlock.h.
References llvm::SmallVectorBase< Size_T >::size().
Referenced by BBIsJumpedOver(), bbIsJumpedOver(), llvm::MachineLoopInfo::findLoopPreheader(), findWLS(), getIndVarInfo(), getSingleSchedPred(), llvm::LiveIntervals::hasPHIKill(), llvm::XtensaInstrInfo::insertIndirectBranch(), llvm::AArch64InstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), isSaveReachableThroughClean(), llvm::RegBankSelect::EdgeInsertPoint::isSplit(), isSplitEdge(), llvm::rdf::operator<<(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::pred_size(), llvm::IRTranslator::runOnMachineFunction(), salvageDebugInfoFromEmptyBlock(), llvm::TailDuplicator::shouldTailDuplicate(), SinkingPreventsImplicitNullCheck(), and sortBlocks().
|
inline |
Definition at line 460 of file MachineBasicBlock.h.
References llvm::make_range(), pred_begin(), and pred_end().
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), CanLowerPriorityDirectlyInPredecessors(), llvm::ConnectedVNInfoEqClasses::Classify(), llvm::HexagonInstrInfo::findLoopInstr(), llvm::MachineLoopInfo::findLoopPreheader(), findPotentialBlockers(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::FindPredecessorBlocks(), fixupBlock(), getBBFallenThrough(), llvm::ReachingDefAnalysis::getLiveOuts(), llvm::afdo_detail::IRTraits< MachineBasicBlock >::getPredecessors(), getSingleSchedPred(), llvm::ReachingDefAnalysis::getUniqueReachingMIDef(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), getWaitStatesSince(), llvm::LiveVariables::HandleVirtRegUse(), hasDirtyPred(), hasHazard(), llvm::LiveIntervals::hasPHIKill(), llvm::MachineTraceMetrics::Ensemble::invalidate(), isPredecessor(), jumpTableHasOtherUses(), llvm::rdf::operator<<(), llvm::predecessors(), print(), llvm::SwiftErrorValueTracking::propagateVRegs(), GCEmptyBasicBlocks::runOnMachineFunction(), salvageDebugInfoFromEmptyBlock(), searchPredecessors(), sortBlocks(), and verifyCTRBranch().
|
inline |
Definition at line 463 of file MachineBasicBlock.h.
References llvm::make_range(), pred_begin(), and pred_end().
void MachineBasicBlock::print | ( | raw_ostream & | OS, |
const SlotIndexes * | Indexes = nullptr , |
||
bool | IsStandalone = true |
||
) | const |
Definition at line 343 of file MachineBasicBlock.cpp.
References F, llvm::MachineFunction::getFunction(), getParent(), llvm::ModuleSlotTracker::incorporateFunction(), OS, and print().
Referenced by llvm::DwarfDebug::beginInstruction(), dump(), llvm::operator<<(), llvm::VPInstruction::print(), llvm::SDNode::print(), print(), llvm::MachineInstr::print(), and llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander().
void MachineBasicBlock::print | ( | raw_ostream & | OS, |
ModuleSlotTracker & | MST, | ||
const SlotIndexes * | Indexes = nullptr , |
||
bool | IsStandalone = true |
||
) | const |
Definition at line 358 of file MachineBasicBlock.cpp.
References llvm::MachineInstr::BundledSucc, llvm::format(), llvm::BranchProbability::getDenominator(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::SlotIndexes::getInstructionIndex(), llvm::SlotIndexes::getMBBStartIdx(), llvm::BranchProbability::getNumerator(), getParent(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), getSuccProbability(), llvm::SlotIndexes::hasIndex(), I, llvm::raw_ostream::indent(), instrs(), livein_empty(), liveins(), MI, MRI, OS, pred_empty(), predecessors(), llvm::Pass::print(), llvm::PrintLaneMask(), llvm::printMBBReference(), printName(), PrintNameAttributes, PrintNameIr, llvm::printReg(), PrintSlotIndexes, succ_begin(), succ_empty(), succ_end(), TII, and TRI.
void MachineBasicBlock::printAsOperand | ( | raw_ostream & | OS, |
bool | PrintType = true |
||
) | const |
Definition at line 592 of file MachineBasicBlock.cpp.
References OS, and printName().
Referenced by llvm::MachineInstr::print(), llvm::printMBBReference(), and printMI().
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.
printNameFlags | Combination of PrintNameFlag flags indicating the parts to print. |
moduleSlotTracker | Optional ModuleSlotTracker. This method will incorporate its own tracker when necessary to determine the block's IR name. |
Definition at line 488 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 print(), printAsOperand(), printMBB(), and llvm::GCNRegPressurePrinter::runOnMachineFunction().
|
inline |
Definition at line 1042 of file MachineBasicBlock.h.
References MI.
Referenced by llvm::M68kInstrInfo::AnalyzeBranchImpl(), emitSelectPseudo(), llvm::WindowScheduler::generateTripleMBB(), and llvm::PhiLoweringHelper::lowerPhis().
|
inline |
Definition at line 381 of file MachineBasicBlock.h.
References llvm::MachineInstrBundleIterator< MachineInstr, true >::getAtBundleBegin(), and instr_rbegin().
Referenced by llvm::MipsInstrInfo::analyzeBranch(), llvm::M68kInstrInfo::AnalyzeBranchImpl(), dominatesAllUsesOf(), FindLastAluClause(), llvm::findPHICopyInsertPoint(), getBBAddrMapMetadata(), isImplicitFallthrough(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), mergeOperations(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::MipsInstrInfo::removeBranch(), llvm::InstructionSelect::selectMachineFunction(), llvm::X86FrameLowering::spillFPBP(), splitAt(), and verifySameBranchInstructions().
|
inline |
Definition at line 384 of file MachineBasicBlock.h.
References llvm::MachineInstrBundleIterator< Ty, IsReverse >::getAtBundleBegin(), and instr_rbegin().
|
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 1129 of file MachineBasicBlock.h.
Referenced by llvm::WindowScheduler::backupMBB(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::MachineInstr::removeFromParent(), and llvm::GCNIterativeScheduler::scheduleRegion().
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 1455 of file MachineBasicBlock.cpp.
References llvm::MachineInstr::BundledPred, llvm::MachineInstr::BundledSucc, MI, llvm::iplist_impl< IntrusiveListT, TraitsT >::remove(), and unbundleSingleMI().
Referenced by llvm::AArch64TargetLowering::EmitAllocateSMESaveBuffer(), llvm::AArch64TargetLowering::EmitAllocateZABuffer(), llvm::AArch64TargetLowering::EmitGetSMESaveSize(), llvm::AArch64TargetLowering::EmitInitTPIDR2Object(), llvm::SPIRVTargetLowering::finalizeLowering(), and llvm::MachineInstr::removeFromBundle().
MachineBasicBlock * MachineBasicBlock::removeFromParent | ( | ) |
This method unlinks 'this' from the containing function, and returns it, but does not delete it.
Definition at line 1476 of file MachineBasicBlock.cpp.
References assert(), getParent(), and llvm::MachineFunction::remove().
MachineBasicBlock::livein_iterator MachineBasicBlock::removeLiveIn | ( | MachineBasicBlock::livein_iterator | I | ) |
Remove entry from the livein set and return iterator to the next.
Definition at line 610 of file MachineBasicBlock.cpp.
References I.
void MachineBasicBlock::removeLiveIn | ( | MCRegister | Reg, |
LaneBitmask | LaneMask = LaneBitmask::getAll() |
||
) |
Remove the specified register from the live in set.
Definition at line 598 of file MachineBasicBlock.cpp.
References llvm::find_if(), I, and llvm::MachineBasicBlock::RegisterMaskPair::PhysReg.
Referenced by emitGPDisp(), llvm::SIMachineFunctionInfo::shiftWwmVGPRsToLowestRange(), and updateLiveIn().
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 834 of file MachineBasicBlock.cpp.
References llvm::find(), I, and removeSuccessor().
Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock(), eraseDeadBBsAndChildren(), INITIALIZE_PASS(), removeSuccessor(), replaceSuccessor(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), rollbackRestoreSplit(), GCEmptyBasicBlocks::runOnMachineFunction(), transferSuccessors(), transferSuccessorsAndUpdatePHIs(), and llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander().
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 841 of file MachineBasicBlock.cpp.
References assert(), I, and normalizeSuccProbs().
|
inline |
Definition at line 387 of file MachineBasicBlock.h.
References instr_rend().
Referenced by llvm::LoongArchInstrInfo::analyzeBranch(), llvm::RISCVInstrInfo::analyzeBranch(), llvm::MipsInstrInfo::analyzeBranch(), llvm::CSKYInstrInfo::analyzeBranch(), llvm::M68kInstrInfo::AnalyzeBranchImpl(), collectCallSiteParameters(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), FindLastAluClause(), llvm::findPHICopyInsertPoint(), INITIALIZE_PASS(), isImplicitFallthrough(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), llvm::PPCRegisterInfo::lowerCRBitSpilling(), mergeOperations(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::RISCVInstrInfo::optimizeCondBranch(), performCopyPropagation(), llvm::MipsInstrInfo::removeBranch(), llvm::InstructionSelect::selectMachineFunction(), llvm::X86FrameLowering::spillFPBP(), validThroughout(), and verifySameBranchInstructions().
|
inline |
Definition at line 388 of file MachineBasicBlock.h.
References instr_rend().
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 1510 of file MachineBasicBlock.cpp.
References llvm::MachineOperand::getMBB(), MI, phis(), and llvm::MachineOperand::setMBB().
Referenced by SplitCriticalEdge(), and transferSuccessorsAndUpdatePHIs().
void MachineBasicBlock::replaceSuccessor | ( | MachineBasicBlock * | Old, |
MachineBasicBlock * | New | ||
) |
Replace successor OLD with NEW and update probability info.
Definition at line 857 of file MachineBasicBlock.cpp.
References assert(), I, removeSuccessor(), succ_begin(), and succ_end().
Referenced by llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), ReplaceUsesOfBlockWith(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), and splitEdge().
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 1490 of file MachineBasicBlock.cpp.
References assert(), I, instr_begin(), instr_end(), and replaceSuccessor().
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::PeelSingleBlockLoop(), and SplitCriticalEdge().
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 1531 of file MachineBasicBlock.cpp.
References findDebugLoc(), instr_begin(), instr_rbegin(), instr_rend(), MBBI, and llvm::skipDebugInstructionsBackward().
Referenced by llvm::M68kInstrInfo::AnalyzeBranchImpl(), and rfindDebugLoc().
|
inline |
Definition at line 1194 of file MachineBasicBlock.h.
References MBBI, and rfindDebugLoc().
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 1553 of file MachineBasicBlock.cpp.
References instr_rend(), MBBI, and llvm::next_nodbg().
Referenced by rfindPrevDebugLoc().
|
inline |
Definition at line 1211 of file MachineBasicBlock.h.
References MBBI, and rfindPrevDebugLoc().
|
inline |
Returns true if this and MBB belong to the same section.
Definition at line 750 of file MachineBasicBlock.h.
References getSectionID(), and MBB.
Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), and llvm::AsmPrinter::emitFunctionBody().
|
inline |
Set this block to reflect that it corresponds to an IR-level basic block with a BlockAddress.
Definition at line 313 of file MachineBasicBlock.h.
Referenced by llvm::IRTranslator::runOnMachineFunction(), and llvm::FunctionLoweringInfo::set().
|
inline |
Set alignment of the basic block.
Definition at line 642 of file MachineBasicBlock.h.
References A.
Referenced by AlignBlocks(), and setAlignment().
Definition at line 644 of file MachineBasicBlock.h.
References A, setAlignment(), and setMaxBytesForAlignment().
|
inline |
Sets the fixed BBID of this basic block.
Definition at line 712 of file MachineBasicBlock.h.
References assert().
Referenced by llvm::MachineFunction::CreateMachineBasicBlock().
|
inline |
Set the call frame size on entry to this basic block.
Definition at line 1266 of file MachineBasicBlock.h.
References N.
Referenced by llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), emitSelectPseudo(), SplitCriticalEdge(), and splitMBB().
|
inline |
Definition at line 1278 of file MachineBasicBlock.h.
|
inline |
Definition at line 702 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::assignBeginEndSections().
|
inline |
Indicates if this is the entry block of a cleanup funclet.
Definition at line 694 of file MachineBasicBlock.h.
|
inline |
Indicates if this is a target of Windows EH Continuation Guard.
Definition at line 682 of file MachineBasicBlock.h.
|
inline |
Indicates if this is the entry block of an EH funclet.
Definition at line 688 of file MachineBasicBlock.h.
|
inline |
Indicates the block is a landing pad.
That is this basic block is entered via an exception handler.
Definition at line 663 of file MachineBasicBlock.h.
Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock(), and llvm::FunctionLoweringInfo::set().
|
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 676 of file MachineBasicBlock.h.
|
inline |
Definition at line 704 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::assignBeginEndSections().
|
inline |
Indicates if this is the indirect dest of an INLINEASM_BR.
Definition at line 734 of file MachineBasicBlock.h.
|
inline |
Set this block to reflect that, regardless how we flow to it, we need its label be emitted.
Definition at line 320 of file MachineBasicBlock.h.
|
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 309 of file MachineBasicBlock.h.
Referenced by llvm::SystemZTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), and llvm::AArch64InstrInfo::expandPostRAPseudo().
|
inline |
Set the maximum amount of padding allowed for aligning the basic block.
Definition at line 653 of file MachineBasicBlock.h.
Referenced by setAlignment().
|
inline |
Definition at line 1261 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::RenumberBlocks().
|
inline |
Sets the section ID for this basic block.
Definition at line 718 of file MachineBasicBlock.h.
Referenced by assignSections().
void MachineBasicBlock::setSuccProbability | ( | succ_iterator | I, |
BranchProbability | Prob | ||
) |
Set successor probability of a given iterator.
Definition at line 1621 of file MachineBasicBlock.cpp.
References assert(), I, and llvm::BranchProbability::isUnknown().
Referenced by llvm::MIRProfileLoader::setBranchProbs(), and splitMBB().
|
inline |
Definition at line 347 of file MachineBasicBlock.h.
Referenced by llvm::AggressiveAntiDepState::AggressiveAntiDepState(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::ScheduleDAGMI::dumpScheduleTraceBottomUp(), llvm::ScheduleDAGMI::dumpScheduleTraceTopDown(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::LoongArchFrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitPrologue(), llvm::LoongArchFrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::VLIWMachineScheduler::getBBSize(), llvm::GCNRegPressurePrinter::runOnMachineFunction(), llvm::ARMBaseRegisterInfo::shouldCoalesce(), llvm::AggressiveAntiDepBreaker::StartBlock(), llvm::CriticalAntiDepBreaker::StartBlock(), llvm::TailDuplicator::tailDuplicateAndUpdate(), and llvm::MemorySSA::verifyOrderingDominationAndDefUses().
Definition at line 1795 of file MachineBasicBlock.cpp.
References begin(), end(), I, and llvm::instructionsWithoutDebug().
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(), end(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), I, and TII.
Referenced by addLiveIn(), llvm::AMDGPU::RegBankLegalizeHelper::applyMappingPHI(), RegBankSelectHelper::constrainRegBankUse(), copyDebugInfoToSuccessor(), llvm::findPHICopyInsertPoint(), llvm::getOpVariableMBBIt(), and RegBankSelectHelper::reAssignRegBankOnDef().
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(), end(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), I, and TII.
Referenced by findInsertLocation(), and llvm::SplitEditor::leaveIntvAtTop().
void MachineBasicBlock::sortUniqueLiveIns | ( | ) |
Sorts and uniques the LiveIns vector.
It can be significantly faster to do this than repeatedly calling isLiveIn before calling addLiveIn for every LiveIn insertion.
Definition at line 622 of file MachineBasicBlock.cpp.
References I, llvm::MachineBasicBlock::RegisterMaskPair::PhysReg, and llvm::sort().
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::SIFrameLowering::emitCSRSpillStores(), llvm::SIFrameLowering::processFunctionBeforeFrameFinalized(), llvm::recomputeLiveIns(), llvm::SIFrameLowering::restoreCalleeSavedRegisters(), llvm::IRTranslator::runOnMachineFunction(), llvm::SIMachineFunctionInfo::shiftWwmVGPRsToLowestRange(), llvm::SIFrameLowering::spillCalleeSavedRegisters(), updateLiveIn(), and updateLiveness().
|
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 1149 of file MachineBasicBlock.h.
References From, llvm::Other, and splice().
Referenced by llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::RISCVTargetLowering::emitDynamicProbedAlloc(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::SystemZTargetLowering::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(), emitStackProbeInline(), emitVecCondBranchPseudo(), emitXBegin(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), hoistAndMergeSGPRInits(), llvm::PPCFrameLowering::inlineStackProbe(), loadMBUFScalarOperandsFromVGPR(), LowerFPToInt(), LowerMemcpy(), LowerMemset(), llvm::MachineInstr::moveBefore(), llvm::ScheduleDAGMI::moveInstruction(), MoveVPNOTBeforeFirstUser(), performSink(), llvm::ScheduleDAGMI::placeDebugValues(), llvm::AArch64InstrInfo::probedStackAlloc(), rescheduleCanonically(), rescheduleLexographically(), llvm::WindowScheduler::restoreTripleMBB(), llvm::GCNSchedStage::revertScheduling(), llvm::IRTranslator::runOnMachineFunction(), llvm::WebAssemblyDebugValueManager::sink(), splice(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), splitBlockForLoop(), and splitMBB().
|
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 1160 of file MachineBasicBlock.h.
References From, llvm::MachineInstrBundleIterator< Ty, IsReverse >::getInstrIterator(), and llvm::Other.
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.
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 1023 of file MachineBasicBlock.cpp.
References llvm::addLiveIns(), addSuccessor(), begin(), llvm::MachineFunction::CreateMachineBasicBlock(), end(), getBasicBlock(), getParent(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse(), llvm::MachineFunction::getSubtarget(), I, llvm::MachineFunction::insert(), llvm::LiveIntervals::insertMBBInMaps(), MI, rbegin(), splice(), and transferSuccessorsAndUpdatePHIs().
Referenced by llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::SIInstrInfo::insertSimulatedTrap(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), splitBlock(), and llvm::SITargetLowering::splitKillBlock().
MachineBasicBlock * MachineBasicBlock::SplitCriticalEdge | ( | MachineBasicBlock * | Succ, |
const SplitCriticalEdgeAnalyses & | Analyses, | ||
std::vector< SparseBitVector<> > * | LiveInSets, | ||
MachineDomTreeUpdater * | MDTU | ||
) |
Definition at line 1160 of file MachineBasicBlock.cpp.
References addLiveIn(), llvm::LiveRange::addSegment(), addSuccessor(), assert(), canSplitCriticalEdge(), Cond, llvm::SmallSet< T, N, C >::count(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::dbgs(), DL, llvm::SmallVectorBase< Size_T >::empty(), end(), llvm::MachineFunction::end(), findBranchDebugLoc(), findJumpTableIndex(), getCallFrameSize(), llvm::DebugLoc::getCol(), getFirstInstrTerminator(), getFirstTerminator(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getJumpTableInfo(), llvm::DebugLoc::getLine(), 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::LiveRange::getVNInfoAt(), I, llvm::Register::index2VirtReg(), llvm::SmallSet< T, N, C >::insert(), llvm::MachineFunction::insert(), llvm::HexagonInstrInfo::insertBranch(), llvm::LiveIntervals::insertMBBInMaps(), llvm::SlotIndexes::insertMBBInMaps(), instr_begin(), instr_end(), llvm::is_contained(), isLayoutSuccessor(), isLiveOut(), llvm::MachineOperand::isUndef(), llvm::MachineBasicBlock::SplitCriticalEdgeAnalyses::LIS, llvm::LiveRange::liveAt(), liveins(), LLVM_DEBUG, llvm::MachineBasicBlock::SplitCriticalEdgeAnalyses::LV, llvm::make_range(), MI, llvm::MachineBasicBlock::SplitCriticalEdgeAnalyses::MLI, MRI, P, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::printMBBReference(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::LiveRange::removeSegment(), llvm::MachineJumpTableInfo::ReplaceMBBInJumpTable(), replacePhiUsesWith(), ReplaceUsesOfBlockWith(), setCallFrameSize(), llvm::MachineBasicBlock::SplitCriticalEdgeAnalyses::SI, llvm::GenericDomTreeUpdater< DerivedT, DomTreeT, PostDomTreeT >::splitCriticalEdge(), llvm::LiveInterval::subranges(), TII, TRI, and updateTerminator().
|
inline |
Definition at line 1018 of file MachineBasicBlock.h.
References SplitCriticalEdge().
|
inline |
Definition at line 1011 of file MachineBasicBlock.h.
References P, and SplitCriticalEdge().
Referenced by SplitCriticalEdge().
MachineBasicBlock * MachineBasicBlock::SplitCriticalEdge | ( | MachineBasicBlock * | Succ, |
Pass * | P, | ||
MachineFunctionAnalysisManager * | MFAM, | ||
std::vector< SparseBitVector<> > * | LiveInSets, | ||
MachineDomTreeUpdater * | MDTU | ||
) |
Definition at line 1138 of file MachineBasicBlock.cpp.
References assert(), GET_RESULT, getParent(), Info, P, and SplitCriticalEdge().
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 815 of file MachineBasicBlock.cpp.
References addSuccessor(), assert(), llvm::find(), llvm::BranchProbability::getUnknown(), llvm::is_contained(), normalizeSuccProbs(), succ_end(), and successors().
Referenced by splitEdge().
|
inline |
Definition at line 443 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
Referenced by bbHasFallthrough(), BBIsJumpedOver(), bbIsJumpedOver(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::BlkSucc_begin(), canPredictSuccessors(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), eraseDeadBBsAndChildren(), getLayoutSuccessorProbThreshold(), markAllReachable(), print(), printMBB(), replaceSuccessor(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::IRTranslator::runOnMachineFunction(), llvm::MIRProfileLoader::setBranchProbs(), splitMBB(), llvm::succ_begin(), successors(), llvm::TailDuplicator::tailDuplicateAndUpdate(), transferSuccessors(), and transferSuccessorsAndUpdatePHIs().
|
inline |
Definition at line 444 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
|
inline |
Definition at line 458 of file MachineBasicBlock.h.
References llvm::SmallVectorBase< Size_T >::empty().
Referenced by blockEndsInUnreachable(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::X86FrameLowering::canUseAsEpilogue(), llvm::ScheduleDAGSDNodes::computeOperandLatency(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), getEndClobberMask(), INITIALIZE_PASS(), llvm::SIInstrInfo::insertReturn(), llvm::SIInstrInfo::insertSimulatedTrap(), isNoReturnDef(), llvm::SystemZInstrInfo::isProfitableToIfCvt(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), popRegsFromStack(), print(), printMBB(), ProfitableToMerge(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::SelectionDAGISel::runOnMachineFunction(), GCEmptyBasicBlocks::runOnMachineFunction(), terminatorIsComputedGotoWithSuccessors(), transferSuccessors(), transferSuccessorsAndUpdatePHIs(), and updateTerminator().
|
inline |
Definition at line 445 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by bbHasFallthrough(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::BlkSucc_end(), canPredictSuccessors(), eraseDeadBBsAndChildren(), INITIALIZE_PASS(), markAllReachable(), print(), printMBB(), replaceSuccessor(), GCEmptyBasicBlocks::runOnMachineFunction(), llvm::MIRProfileLoader::setBranchProbs(), splitSuccessor(), llvm::succ_end(), successors(), and llvm::TailDuplicator::tailDuplicateAndUpdate().
|
inline |
Definition at line 446 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
|
inline |
Definition at line 447 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rbegin().
Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock(), and splitMBB().
|
inline |
Definition at line 449 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rbegin().
|
inline |
Definition at line 451 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rend().
Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock().
|
inline |
Definition at line 453 of file MachineBasicBlock.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rend().
|
inline |
Definition at line 455 of file MachineBasicBlock.h.
References llvm::SmallVectorBase< Size_T >::size().
Referenced by BBIsJumpedOver(), bbIsJumpedOver(), canPredictBranchProbabilities(), canPredictSuccessors(), llvm::TailDuplicator::canTailDuplicate(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::AsmPrinter::emitBBAddrMapSection(), getLayoutSuccessorProbThreshold(), llvm::RegionTraits< MachineFunction >::getNumSuccessors(), getSuccProbability(), hasSameSuccessors(), INITIALIZE_PASS(), llvm::TailDuplicator::isSimpleBB(), isSplitEdge(), llvm::rdf::operator<<(), ProfitableToMerge(), salvageDebugInfoFromEmptyBlock(), llvm::MIRProfileLoader::setBranchProbs(), llvm::TailDuplicator::shouldTailDuplicate(), splitMBB(), and llvm::succ_size().
|
inline |
Definition at line 466 of file MachineBasicBlock.h.
References llvm::make_range(), succ_begin(), and succ_end().
Referenced by llvm::ScheduleDAGInstrs::addSchedBarrierDeps(), llvm::X86InstrInfo::analyzeBranchPredicate(), areCFlagsAliveInSuccessors(), BBHasFallthrough(), blockEndIsUnreachable(), CanLowerPriorityDirectlyInPredecessors(), checkAndUpdateCCRKill(), checkAndUpdateCPSRKill(), checkCCKill(), checkEFLAGSLive(), collectEHScopeMembers(), computeBlockInfo(), 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(), isLiveOut(), llvm::LiveVariables::isLiveOut(), isReachableAmongDominated(), llvm::HexagonInstrInfo::isSchedulingBoundary(), isSuccessor(), loadMBUFScalarOperandsFromVGPR(), markAllReachable(), mayHaveInlineAsmBr(), llvm::rdf::operator<<(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), OtherSucc(), llvm::LiveIntervals::pruneValue(), removeImplicitFallthroughs(), llvm::MachineBranchProbabilityPrinterPass::run(), salvageDebugInfoFromEmptyBlock(), llvm::MIRProfileLoader::setBranchProbs(), llvm::TailDuplicator::shouldTailDuplicate(), shouldUseFrameHelper(), sortBlocks(), splitBlock(), splitMBB(), splitSuccessor(), llvm::AggressiveAntiDepBreaker::StartBlock(), llvm::CriticalAntiDepBreaker::StartBlock(), llvm::successors(), terminatorIsComputedGotoWithSuccessors(), llvm::LoopTraversal::traverse(), updateLiveness(), ValidateMVEStore(), visit(), and llvm::WriteGraph().
|
inline |
Definition at line 469 of file MachineBasicBlock.h.
References llvm::make_range(), succ_begin(), and succ_end().
|
inline |
Returns true if the original IR terminator is an indirectbr
with successor blocks.
This typically corresponds to a goto
in C, rather than jump tables.
Definition at line 329 of file MachineBasicBlock.h.
References llvm::all_of(), back(), llvm::MachineInstr::isIndirectBranch(), isIRBlockAddressTaken(), succ_empty(), and successors().
Referenced by llvm::TailDuplicator::shouldTailDuplicate().
|
inline |
Definition at line 397 of file MachineBasicBlock.h.
References end(), getFirstTerminator(), and llvm::make_range().
Referenced by AlignBlocks(), llvm::WebAssemblyInstrInfo::analyzeBranch(), explicitlyBranchesTo(), findLoopComponents(), llvm::ARMBlockPlacement::fixBackwardsWLS(), flagsNeedToBePreservedBeforeTheTerminators(), llvm::SIInstrInfo::hasDivergentBranch(), hasReturn(), INITIALIZE_PASS(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), maybeUpdateTerminator(), llvm::SIInstrInfo::removeBranch(), RevertWhileLoopSetup(), and llvm::ARMFrameLowering::updateLRRestored().
|
inline |
Definition at line 400 of file MachineBasicBlock.h.
References end(), getFirstTerminator(), and llvm::make_range().
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 915 of file MachineBasicBlock.cpp.
References addSuccessor(), addSuccessorWithoutProb(), removeSuccessor(), succ_begin(), and succ_empty().
Referenced by splitMBB().
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 935 of file MachineBasicBlock.cpp.
References addSuccessor(), addSuccessorWithoutProb(), normalizeSuccProbs(), removeSuccessor(), replacePhiUsesWith(), succ_begin(), and succ_empty().
Referenced by llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::RISCVTargetLowering::emitDynamicProbedAlloc(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::SystemZTargetLowering::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(), emitStackProbeInline(), emitVecCondBranchPseudo(), emitXBegin(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::PPCFrameLowering::inlineStackProbe(), loadMBUFScalarOperandsFromVGPR(), LowerFPToInt(), LowerMemcpy(), LowerMemset(), llvm::AArch64InstrInfo::probedStackAlloc(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), and splitBlockForLoop().
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 691 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().
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 782 of file MachineBasicBlock.cpp.
References assert(), and llvm::BranchProbability::getDenominator().
|
friend |
Definition at line 1296 of file MachineBasicBlock.h.
|
friend |
Definition at line 1296 of file MachineBasicBlock.h.
|
friend |
Definition at line 247 of file MachineBasicBlock.h.