LLVM 18.0.0git
|
#include "llvm/CodeGen/MachineBasicBlock.h"
Classes | |
class | liveout_iterator |
struct | RegisterMaskPair |
Pair of physical register and lane mask. 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. | |
StringRef | getName () const |
Return the name of the corresponding LLVM basic block, or an empty string. | |
std::string | getFullName () const |
Return a formatted string to identify this block and its parent function. | |
bool | hasAddressTaken () const |
Test whether this block is used as something other than the target of a terminator, exception-handling target, or jump table. | |
bool | isMachineBlockAddressTaken () const |
Test whether this block is used as something other than the target of a terminator, exception-handling target, jump table, or IR blockaddress. | |
bool | isIRBlockAddressTaken () const |
Test whether this block is the target of an IR BlockAddress. | |
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 () |
unsigned | size () const |
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) |
void | sortUniqueLiveIns () |
Sorts and uniques the LiveIns vector. | |
void | clearLiveIns () |
Clear live in list. | |
Register | addLiveIn (MCRegister PhysReg, const TargetRegisterClass *RC) |
Add PhysReg as live in to this block, and ensure that there is a copy of PhysReg to a virtual register of class RC. | |
void | removeLiveIn (MCPhysReg Reg, LaneBitmask LaneMask=LaneBitmask::getAll()) |
Remove the specified register from the live in set. | |
bool | isLiveIn (MCPhysReg Reg, LaneBitmask LaneMask=LaneBitmask::getAll()) const |
Return true if the specified register is in the live in set. | |
livein_iterator | livein_begin_dbg () const |
Unlike livein_begin, this method does not check that the liveness information is accurate. | |
iterator_range< livein_iterator > | liveins_dbg () const |
livein_iterator | livein_begin () const |
livein_iterator | livein_end () const |
bool | livein_empty () const |
iterator_range< livein_iterator > | liveins () const |
livein_iterator | removeLiveIn (livein_iterator I) |
Remove entry from the livein set and return iterator to the next. | |
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 |
const uint32_t * | getBeginClobberMask (const TargetRegisterInfo *TRI) const |
Get the clobber mask for the start of this basic block. | |
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. | |
bool | hasEHPadSuccessor () const |
bool | isEntryBlock () const |
Returns true if this is the entry block of the function. | |
bool | isEHScopeEntry () const |
Returns true if this is the entry block of an EH scope, i.e., the block that used to have a catchpad or cleanuppad instruction in the LLVM IR. | |
void | setIsEHScopeEntry (bool V=true) |
Indicates if this is the entry block of an EH scope, i.e., the block that that used to have a catchpad or cleanuppad instruction in the LLVM IR. | |
bool | isEHCatchretTarget () const |
Returns true if this is a target block of a catchret. | |
void | setIsEHCatchretTarget (bool V=true) |
Indicates if this is a target block of a catchret. | |
bool | isEHFuncletEntry () const |
Returns true if this is the entry block of an EH funclet. | |
void | setIsEHFuncletEntry (bool V=true) |
Indicates if this is the entry block of an EH funclet. | |
bool | isCleanupFuncletEntry () const |
Returns true if this is the entry block of a cleanup funclet. | |
void | setIsCleanupFuncletEntry (bool V=true) |
Indicates if this is the entry block of a cleanup funclet. | |
bool | isBeginSection () const |
Returns true if this block begins any section. | |
bool | isEndSection () const |
Returns true if this block ends any section. | |
void | setIsBeginSection (bool V=true) |
void | setIsEndSection (bool V=true) |
std::optional< UniqueBBID > | getBBID () const |
MBBSectionID | getSectionID () const |
Returns the section ID of this basic block. | |
unsigned | getSectionIDNum () const |
Returns the unique section ID number of this basic block. | |
void | setBBID (const UniqueBBID &V) |
Sets the fixed BBID of this basic block. | |
void | setSectionID (MBBSectionID V) |
Sets the section ID for this basic block. | |
MCSymbol * | getEndSymbol () const |
Returns the MCSymbol marking the end of this basic block. | |
bool | mayHaveInlineAsmBr () const |
Returns true if this block may have an INLINEASM_BR (overestimate, by checking if any of the successors are indirect targets of any inlineasm_br in the function). | |
bool | isInlineAsmBrIndirectTarget () const |
Returns true if this is the indirect dest of an INLINEASM_BR. | |
void | setIsInlineAsmBrIndirectTarget (bool V=true) |
Indicates if this is the indirect dest of an INLINEASM_BR. | |
bool | isLegalToHoistInto () const |
Returns true if it is legal to hoist instructions into this block. | |
void | moveBefore (MachineBasicBlock *NewAfter) |
Move 'this' block before or after the specified block. | |
void | moveAfter (MachineBasicBlock *NewBefore) |
bool | sameSection (const MachineBasicBlock *MBB) const |
Returns true if this and MBB belong to the same section. | |
void | updateTerminator (MachineBasicBlock *PreviousLayoutSuccessor) |
Update the terminator instructions in block to account for changes to block layout which may have been made. | |
void | addSuccessor (MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown()) |
Add Succ as a successor of this MachineBasicBlock. | |
void | addSuccessorWithoutProb (MachineBasicBlock *Succ) |
Add Succ as a successor of this MachineBasicBlock. | |
void | setSuccProbability (succ_iterator I, BranchProbability Prob) |
Set successor probability of a given iterator. | |
void | normalizeSuccProbs () |
Normalize probabilities of all successors so that the sum of them becomes one. | |
void | validateSuccProbs () const |
Validate successors' probabilities and check if the sum of them is approximate one. | |
void | removeSuccessor (MachineBasicBlock *Succ, bool NormalizeSuccProbs=false) |
Remove successor from the successors list of this MachineBasicBlock. | |
succ_iterator | removeSuccessor (succ_iterator I, bool NormalizeSuccProbs=false) |
Remove specified successor from the successors list of this MachineBasicBlock. | |
void | replaceSuccessor (MachineBasicBlock *Old, MachineBasicBlock *New) |
Replace successor OLD with NEW and update probability info. | |
void | copySuccessor (const MachineBasicBlock *Orig, succ_iterator I) |
Copy a successor (and any probability info) from original block to this block's. | |
void | splitSuccessor (MachineBasicBlock *Old, MachineBasicBlock *New, bool NormalizeSuccProbs=false) |
Split the old successor into old plus new and updates the probability info. | |
void | transferSuccessors (MachineBasicBlock *FromMBB) |
Transfers all the successors from MBB to this machine basic block (i.e., copies all the successors FromMBB and remove all the successors from FromMBB). | |
void | transferSuccessorsAndUpdatePHIs (MachineBasicBlock *FromMBB) |
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor blocks which refer to FromMBB to refer to this. | |
bool | hasSuccessorProbabilities () const |
Return true if any of the successors have probabilities attached to them. | |
bool | isPredecessor (const MachineBasicBlock *MBB) const |
Return true if the specified MBB is a predecessor of this block. | |
bool | isSuccessor (const MachineBasicBlock *MBB) const |
Return true if the specified MBB is a successor of this block. | |
bool | isLayoutSuccessor (const MachineBasicBlock *MBB) const |
Return true if the specified MBB will be emitted immediately after this block, such that if this block exits by falling through, control will transfer to the specified MBB. | |
const MachineBasicBlock * | getSingleSuccessor () const |
Return the successor of this block if it has a single successor. | |
MachineBasicBlock * | getSingleSuccessor () |
const MachineBasicBlock * | getSinglePredecessor () const |
Return the predecessor of this block if it has a single predecessor. | |
MachineBasicBlock * | getSinglePredecessor () |
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. | |
bool | canFallThrough () |
Return true if the block can implicitly transfer control to the block after it by falling off the end of it. | |
iterator | getFirstNonPHI () |
Returns a pointer to the first instruction in this block that is not a PHINode instruction. | |
const_iterator | getFirstNonPHI () const |
iterator | SkipPHIsAndLabels (iterator I) |
Return the first instruction in MBB after I that is not a PHI or a label. | |
iterator | SkipPHIsLabelsAndDebug (iterator I, Register Reg=Register(), bool SkipPseudoOp=true) |
Return the first instruction in MBB after I that is not a PHI, label or debug. | |
iterator | getFirstTerminator () |
Returns an iterator to the first terminator instruction of this basic block. | |
const_iterator | getFirstTerminator () const |
instr_iterator | getFirstInstrTerminator () |
Same getFirstTerminator but it ignores bundles and return an instr_iterator instead. | |
iterator | getFirstTerminatorForward () |
Finds the first terminator in a block by scanning forward. | |
iterator | getFirstNonDebugInstr (bool SkipPseudoOp=true) |
Returns an iterator to the first non-debug instruction in the basic block, or end(). | |
const_iterator | getFirstNonDebugInstr (bool SkipPseudoOp=true) const |
iterator | getLastNonDebugInstr (bool SkipPseudoOp=true) |
Returns an iterator to the last non-debug instruction in the basic block, or end(). | |
const_iterator | getLastNonDebugInstr (bool SkipPseudoOp=true) const |
bool | isReturnBlock () const |
Convenience function that returns true if the block ends in a return instruction. | |
bool | isEHScopeReturnBlock () const |
Convenience function that returns true if the bock ends in a EH scope return instruction. | |
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) |
Split the critical edge from this block to the given successor block, and return the newly created block, or null if splitting is not possible. | |
bool | canSplitCriticalEdge (const MachineBasicBlock *Succ) const |
Check if the edge between this block and the given successor Succ , can be split. | |
void | pop_front () |
void | pop_back () |
void | push_back (MachineInstr *MI) |
instr_iterator | insert (instr_iterator I, MachineInstr *M) |
Insert MI into the instruction list before I, possibly inside a bundle. | |
template<typename IT > | |
void | insert (iterator I, IT S, IT E) |
Insert a range of instructions into the instruction list before I. | |
iterator | insert (iterator I, MachineInstr *MI) |
Insert MI into the instruction list before I. | |
iterator | insertAfter (iterator I, MachineInstr *MI) |
Insert MI into the instruction list after I. | |
instr_iterator | insertAfterBundle (instr_iterator I, MachineInstr *MI) |
If I is bundled then insert MI into the instruction list after the end of the bundle, otherwise insert MI immediately after I. | |
instr_iterator | erase (instr_iterator I) |
Remove an instruction from the instruction list and delete it. | |
instr_iterator | erase_instr (MachineInstr *I) |
Remove an instruction from the instruction list and delete it. | |
iterator | erase (iterator I, iterator E) |
Remove a range of instructions from the instruction list and delete them. | |
iterator | erase (iterator I) |
Remove an instruction or bundle from the instruction list and delete it. | |
iterator | erase (MachineInstr *I) |
Remove an instruction from the instruction list and delete it. | |
MachineInstr * | remove (MachineInstr *I) |
Remove the unbundled instruction from the instruction list without deleting it. | |
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'. | |
MachineBasicBlock * | removeFromParent () |
This method unlinks 'this' from the containing function, and returns it, but does not delete it. | |
void | eraseFromParent () |
This method unlinks 'this' from the containing function and deletes it. | |
void | ReplaceUsesOfBlockWith (MachineBasicBlock *Old, MachineBasicBlock *New) |
Given a machine basic block that branched to 'Old', change the code and CFG so that it branches to 'New' instead. | |
void | replacePhiUsesWith (MachineBasicBlock *Old, MachineBasicBlock *New) |
Update all phi nodes in this basic block to refer to basic block New instead of basic block Old . | |
DebugLoc | findDebugLoc (instr_iterator MBBI) |
Find the next valid DebugLoc starting at MBBI, skipping any debug instructions. | |
DebugLoc | findDebugLoc (iterator MBBI) |
DebugLoc | rfindDebugLoc (reverse_instr_iterator MBBI) |
Has exact same behavior as findDebugLoc (it also searches towards the end of this MBB) except that this function takes a reverse iterator to identify the starting MI. | |
DebugLoc | rfindDebugLoc (reverse_iterator MBBI) |
DebugLoc | findPrevDebugLoc (instr_iterator MBBI) |
Find the previous valid DebugLoc preceding MBBI, skipping any debug instructions. | |
DebugLoc | findPrevDebugLoc (iterator MBBI) |
DebugLoc | rfindPrevDebugLoc (reverse_instr_iterator MBBI) |
Has exact same behavior as findPrevDebugLoc (it also searches towards the beginning of this MBB) except that this function takes reverse iterator to identify the starting MI. | |
DebugLoc | rfindPrevDebugLoc (reverse_iterator MBBI) |
DebugLoc | findBranchDebugLoc () |
Find and return the merged DebugLoc of the branch instructions of the block. | |
LivenessQueryResult | computeRegisterLiveness (const TargetRegisterInfo *TRI, MCRegister Reg, const_iterator Before, unsigned Neighborhood=10) const |
Return whether (physical) register Reg has been defined and not killed as of just before Before . | |
void | dump () const |
void | print (raw_ostream &OS, const SlotIndexes *=nullptr, bool IsStandalone=true) const |
void | print (raw_ostream &OS, ModuleSlotTracker &MST, const SlotIndexes *=nullptr, bool IsStandalone=true) const |
void | printName (raw_ostream &os, unsigned printNameFlags=PrintNameIr, ModuleSlotTracker *moduleSlotTracker=nullptr) const |
Print the basic block's name as: | |
void | printAsOperand (raw_ostream &OS, bool PrintType=true) const |
int | getNumber () const |
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFunction yet, in which case this will return -1. | |
void | setNumber (int N) |
unsigned | getCallFrameSize () const |
Return the call frame size on entry to this basic block. | |
void | setCallFrameSize (unsigned N) |
Set the call frame size on entry to this basic block. | |
MCSymbol * | getSymbol () const |
Return the MCSymbol for this basic block. | |
MCSymbol * | getEHCatchretSymbol () const |
Return the EHCatchret Symbol for this basic block. | |
std::optional< uint64_t > | getIrrLoopHeaderWeight () const |
void | setIrrLoopHeaderWeight (uint64_t Weight) |
BranchProbability | getSuccProbability (const_succ_iterator Succ) const |
Return probability of the edge from this block to MBB. | |
![]() | |
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 |
bool | isSentinel () const |
Check whether this is the sentinel node. | |
Static Public Member Functions | |
static Instructions MachineBasicBlock::* | getSublistAccess (MachineInstr *) |
Support for MachineInstr::getNextNode(). | |
Friends | |
class | MachineFunction |
class | MachineBranchProbabilityInfo |
class | MIPrinter |
struct | ilist_callback_traits< MachineBasicBlock > |
Definition at line 101 of file MachineBasicBlock.h.
Definition at line 285 of file MachineBasicBlock.h.
Definition at line 319 of file MachineBasicBlock.h.
Definition at line 290 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_pred_iterator = std::vector<MachineBasicBlock *>::const_iterator |
Definition at line 362 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_pred_reverse_iterator = std::vector<MachineBasicBlock *>::const_reverse_iterator |
Definition at line 367 of file MachineBasicBlock.h.
Definition at line 287 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_reverse_iterator = MachineInstrBundleIterator<const MachineInstr, true> |
Definition at line 292 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_succ_iterator = std::vector<MachineBasicBlock *>::const_iterator |
Definition at line 364 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::const_succ_reverse_iterator = std::vector<MachineBasicBlock *>::const_reverse_iterator |
Definition at line 371 of file MachineBasicBlock.h.
Definition at line 284 of file MachineBasicBlock.h.
Definition at line 318 of file MachineBasicBlock.h.
Definition at line 289 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::livein_iterator = LiveInVector::const_iterator |
Definition at line 455 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::pred_iterator = std::vector<MachineBasicBlock *>::iterator |
Definition at line 361 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::pred_reverse_iterator = std::vector<MachineBasicBlock *>::reverse_iterator |
Definition at line 365 of file MachineBasicBlock.h.
Definition at line 286 of file MachineBasicBlock.h.
Definition at line 291 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::succ_iterator = std::vector<MachineBasicBlock *>::iterator |
Definition at line 363 of file MachineBasicBlock.h.
using llvm::MachineBasicBlock::succ_reverse_iterator = std::vector<MachineBasicBlock *>::reverse_iterator |
Definition at line 369 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 1130 of file MachineBasicBlock.h.
Enumerator | |
---|---|
PrintNameIr | Add IR name where available. |
PrintNameAttributes | Print attributes. |
Definition at line 1156 of file MachineBasicBlock.h.
|
inline |
Definition at line 428 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 637 of file MachineBasicBlock.cpp.
References addLiveIn(), llvm::MachineInstrBuilder::addReg(), assert(), begin(), llvm::BuildMI(), E, end(), front(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), I, isEHPad(), isLiveIn(), llvm::Register::isPhysicalRegister(), llvm::RegState::Kill, llvm_unreachable, MRI, SkipPHIsAndLabels(), and TII.
|
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 424 of file MachineBasicBlock.h.
Referenced by addLiveIn(), addLiveInRegs(), llvm::addLiveIns(), addSavedGPR(), llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::X86FrameLowering::adjustForSegmentedStacks(), buildGitPtr(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), llvm::RISCVInstrInfo::buildOutlinedFrame(), llvm::SIFrameLowering::determineCalleeSaves(), emitAlignedDPRCS2Spills(), llvm::SIFrameLowering::emitCSRSpillStores(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::SparcFrameLowering::emitEpilogue(), llvm::AArch64TargetLowering::EmitF128CSEL(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), llvm::MachineRegisterInfo::EmitLiveInCopies(), llvm::AArch64FrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::SystemZXPLINKFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), emitShadowCallStackPrologue(), emitXBegin(), llvm::getFunctionLiveInPhysReg(), handleMustTailForwardedRegisters(), llvm::MipsFunctionInfo::initGlobalBaseReg(), INITIALIZE_PASS(), llvm::AArch64InstrInfo::insertOutlinedCall(), llvm::ARMBaseInstrInfo::insertOutlinedCall(), llvm::MipsCallLowering::lowerFormalArguments(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::SIFrameLowering::processFunctionBeforeFrameFinalized(), pushRegsToStack(), llvm::IRTranslator::runOnMachineFunction(), llvm::SystemZELFFrameLowering::spillCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::spillCalleeSavedRegisters(), llvm::AArch64FrameLowering::spillCalleeSavedRegisters(), llvm::M68kFrameLowering::spillCalleeSavedRegisters(), llvm::Mips16FrameLowering::spillCalleeSavedRegisters(), llvm::MipsSEFrameLowering::spillCalleeSavedRegisters(), llvm::MSP430FrameLowering::spillCalleeSavedRegisters(), llvm::PPCFrameLowering::spillCalleeSavedRegisters(), llvm::RISCVFrameLowering::spillCalleeSavedRegisters(), llvm::X86FrameLowering::spillCalleeSavedRegisters(), llvm::XCoreFrameLowering::spillCalleeSavedRegisters(), SplitCriticalEdge(), splitEdge(), tryToSplitRestore(), updateLiveIn(), and updateLiveness().
void MachineBasicBlock::addSuccessor | ( | MachineBasicBlock * | Succ, |
BranchProbability | Prob = BranchProbability::getUnknown() |
||
) |
Add Succ as a successor of this MachineBasicBlock.
The Predecessors list of Succ is automatically updated. PROB parameter is stored in Probabilities list. The default probability is set as unknown. Mixing known and unknown probabilities in successor list is not allowed. When all successors have unknown probabilities, 1 / N is returned as the probability for each successor, where N is the number of successors.
Note that duplicate Machine CFG edges are not allowed.
Definition at line 790 of file MachineBasicBlock.cpp.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::adjustForSegmentedStacks(), copySuccessor(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitReadCycleWidePseudo(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), llvm::VETargetLowering::emitSjLjDispatchBlock(), emitVecCondBranchPseudo(), emitXBegin(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::FastISel::fastEmitBranch(), llvm::FastISel::finishCondBranch(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), insertDivByZeroTrap(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), loadM0FromVGPR(), loadMBUFScalarOperandsFromVGPR(), LowerFPToInt(), llvm::PeelSingleBlockLoop(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), split(), splitAt(), splitBlockForLoop(), SplitCriticalEdge(), splitEdge(), splitMBB(), splitSuccessor(), transferSuccessors(), transferSuccessorsAndUpdatePHIs(), tryToSplitRestore(), and llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander().
void MachineBasicBlock::addSuccessorWithoutProb | ( | MachineBasicBlock * | Succ | ) |
Add Succ as a successor of this MachineBasicBlock.
The Predecessors list of Succ is automatically updated. The probability is not provided because BPI is not available (e.g. -O0 is used), in which case edge probabilities won't be used. Using this interface can save some space.
Definition at line 800 of file MachineBasicBlock.cpp.
Referenced by copySuccessor(), llvm::FastISel::fastEmitBranch(), llvm::FastISel::finishCondBranch(), transferSuccessors(), and transferSuccessorsAndUpdatePHIs().
|
inline |
Definition at line 305 of file MachineBasicBlock.h.
References end().
Referenced by llvm::ARMBaseInstrInfo::analyzeBranch(), BBIsJumpedOver(), bbIsJumpedOver(), blockEndsInUnreachable(), llvm::calculateDbgEntityHistory(), llvm::ARMBasicBlockUtils::computeBlockSize(), getBBAddrMapMetadata(), getFallThrough(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), isEHScopeReturnBlock(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), isReturnBlock(), ProfitableToMerge(), llvm::HexagonInstrInfo::removeBranch(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::TailDuplicator::shouldTailDuplicate(), and llvm::FastISel::startNewBlock().
|
inline |
Definition at line 307 of file MachineBasicBlock.h.
References end().
|
inline |
Definition at line 325 of file MachineBasicBlock.h.
References instr_begin().
Referenced by addLiveIn(), llvm::LiveVariables::addNewBlock(), llvm::R600InstrInfo::analyzeBranch(), llvm::ARCInstrInfo::analyzeBranch(), llvm::BPFInstrInfo::analyzeBranch(), llvm::MSP430InstrInfo::analyzeBranch(), llvm::NVPTXInstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::SystemZInstrInfo::analyzeBranch(), llvm::XCoreInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::LanaiInstrInfo::analyzeBranch(), llvm::avoidZeroOffsetLandingPad(), bothUsedInPHI(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), llvm::RISCVInstrInfo::buildOutlinedFrame(), llvm::AArch64PAuth::checkAuthenticatedRegister(), computeRegisterLiveness(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), copyDebugInfoToSuccessor(), CountTerminators(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::CreateEmptyPHI(), llvm::SIInstrInfo::createPHIDestinationCopy(), createPHIsForCMOVsInSinkBB(), createPHIsForSelects(), llvm::MachineDominatorTree::dominates(), dominates(), llvm::M68kFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::M68kFrameLowering::emitEpilogue(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::AsmPrinter::emitFunctionBody(), emitGPDisp(), llvm::SITargetLowering::emitGWSMemViolTestLoop(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), llvm::MachineRegisterInfo::EmitLiveInCopies(), emitLoadM0FromVGPRLoop(), emitLoadScalarOpsFromVGPRLoop(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::AArch64FrameLowering::emitPrologue(), llvm::SIFrameLowering::emitPrologue(), llvm::ARCFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::CSKYFrameLowering::emitPrologue(), llvm::LanaiFrameLowering::emitPrologue(), llvm::LoongArchFrameLowering::emitPrologue(), llvm::M68kFrameLowering::emitPrologue(), llvm::Mips16FrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::MSP430FrameLowering::emitPrologue(), llvm::NVPTXFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::SparcFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::SystemZXPLINKFrameLowering::emitPrologue(), llvm::VEFrameLowering::emitPrologue(), llvm::WebAssemblyFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), emitReadCycleWidePseudo(), llvm::ScheduleDAGSDNodes::EmitSchedule(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), emitVecCondBranchPseudo(), emitXBegin(), llvm::RegScavenger::enterBasicBlock(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::AArch64InstrInfo::expandPostRAPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::WebAssembly::findCatch(), llvm::findCMPToFoldIntoCBZ(), findFirstPredicateSetterFrom(), findHoistingInsertPosAndDeps(), findIncDecBefore(), findInsertLocation(), llvm::findPHICopyInsertPoint(), llvm::findSplitPointForStackProtector(), findSurvivorBackwards(), TransferTracker::flushDbgValues(), generateAssignInstrs(), llvm::rdf::Liveness::getAllReachingDefs(), getEarliestInsertPos(), getFirstNonDebugInstr(), getFirstTerminator(), llvm::getFunctionLiveInPhysReg(), llvm::CSKYInstrInfo::getGlobalBaseReg(), llvm::SparcInstrInfo::getGlobalBaseReg(), llvm::VEInstrInfo::getGlobalBaseReg(), llvm::ARMHazardRecognizerFPMLx::getHazardType(), getLatestInsertPos(), getNextMachineInstr(), llvm::ARMBasicBlockUtils::getOffsetOf(), llvm::SITargetLowering::getPrefLoopAlignment(), getPreviousInstr(), getSchedRegions(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), indirectCopyToAGPR(), llvm::MipsFunctionInfo::initGlobalBaseReg(), INITIALIZE_PASS(), initMBBRange(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), insertCSRRestores(), insertCSRSaves(), insertSEHRange(), llvm::MipsAsmPrinter::isBlockOnlyReachableByFallthrough(), isConvertibleToVMV_V_V(), isEFLAGSLive(), jumpTableFollowsTB(), llvm::SplitEditor::leaveIntvAtTop(), llvm::FastISel::leaveLocalValueArea(), TransferTracker::loadInlocs(), loadM0FromVGPR(), loadMBUFScalarOperandsFromVGPR(), LookForIdenticalPHI(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::X86CallLowering::lowerFormalArguments(), LowerFPToInt(), llvm::CombinerHelper::matchOptBrCondByInvertingCond(), llvm::AArch64RegisterInfo::materializeFrameBaseRegister(), llvm::SIRegisterInfo::materializeFrameBaseRegister(), llvm::ARMBaseRegisterInfo::materializeFrameBaseRegister(), llvm::PPCRegisterInfo::materializeFrameBaseRegister(), llvm::RISCVRegisterInfo::materializeFrameBaseRegister(), llvm::M68kFrameLowering::mergeSPUpdates(), llvm::X86FrameLowering::mergeSPUpdates(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::PeelingModuloScheduleExpander::peelKernel(), llvm::PeelSingleBlockLoop(), phis(), PrevCrossBBInst(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::AArch64FrameLowering::processFunctionBeforeFrameFinalized(), ProfitableToMerge(), llvm::RegPressureTracker::recede(), llvm::RegPressureTracker::recedeSkipDebugValues(), llvm::AArch64InstrInfo::removeBranch(), llvm::R600InstrInfo::removeBranch(), llvm::ARCInstrInfo::removeBranch(), llvm::ARMBaseInstrInfo::removeBranch(), llvm::BPFInstrInfo::removeBranch(), llvm::CSKYInstrInfo::removeBranch(), llvm::HexagonInstrInfo::removeBranch(), llvm::LanaiInstrInfo::removeBranch(), llvm::LoongArchInstrInfo::removeBranch(), llvm::M68kInstrInfo::removeBranch(), llvm::MSP430InstrInfo::removeBranch(), llvm::NVPTXInstrInfo::removeBranch(), llvm::PPCInstrInfo::removeBranch(), llvm::RISCVInstrInfo::removeBranch(), llvm::SparcInstrInfo::removeBranch(), llvm::SystemZInstrInfo::removeBranch(), llvm::VEInstrInfo::removeBranch(), llvm::X86InstrInfo::removeBranch(), llvm::XCoreInstrInfo::removeBranch(), llvm::SlotIndexes::repairIndexesInRange(), llvm::RegBankSelect::RepairingPlacement::RepairingPlacement(), llvm::LiveIntervals::repairIntervalsInRange(), llvm::X86InstrInfo::replaceBranchWithTailCall(), llvm::PPCFrameLowering::replaceFPWithRealFP(), llvm::Thumb2InstrInfo::ReplaceTailWithBranchTo(), rescheduleCanonically(), llvm::AArch64FrameLowering::resetCFIToInitialState(), llvm::CSKYFrameLowering::restoreCalleeSavedRegisters(), llvm::PPCFrameLowering::restoreCalleeSavedRegisters(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), llvm::XCoreFrameLowering::restoreCalleeSavedRegisters(), llvm::X86FrameLowering::restoreWinEHStackPointersInParent(), rollbackRestoreSplit(), llvm::CFIFixup::runOnMachineFunction(), llvm::InstructionSelect::runOnMachineFunction(), llvm::IRTranslator::runOnMachineFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::InsertNOPLoad::runOnMachineFunction(), llvm::FixAllFDIVSQRT::runOnMachineFunction(), scavengeFrameVirtualRegsInBlock(), signOutlinedFunction(), sizeWithoutDebugLargerThan(), skipBackwardPastNonInstructions(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), splitBlockForLoop(), llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander(), verifyCTRBranch(), llvm::MemorySSA::verifyOrderingDominationAndDefUses(), and VerifyPHIs().
|
inline |
Definition at line 326 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 1013 of file MachineBasicBlock.cpp.
References getFallThrough().
Referenced by AlignBlocks(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), ProfitableToMerge(), and llvm::TailDuplicator::shouldTailDuplicate().
bool MachineBasicBlock::canSplitCriticalEdge | ( | const MachineBasicBlock * | Succ | ) | const |
Check if the edge between this block and the given successor Succ
, can be split.
If this returns true a subsequent call to SplitCriticalEdge is guaranteed to return a valid basic block if no changes occurred in the meantime.
Definition at line 1359 of file MachineBasicBlock.cpp.
References llvm::HexagonInstrInfo::analyzeBranch(), Cond, llvm::dbgs(), findJumpTableIndex(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), isEHPad(), isInlineAsmBrIndirectTarget(), jumpTableHasOtherUses(), LLVM_DEBUG, llvm::printMBBReference(), llvm::TargetMachine::requiresStructuredCFG(), TBB, and TII.
Referenced by SplitCriticalEdge().
|
inline |
Definition at line 1053 of file MachineBasicBlock.h.
Referenced by llvm::InstructionSelect::runOnMachineFunction().
|
inline |
Remove the reference to the underlying IR BasicBlock.
This is for reduction tools and should generally not be used.
Definition at line 233 of file MachineBasicBlock.h.
void MachineBasicBlock::clearLiveIns | ( | ) |
Clear live in list.
Definition at line 1719 of file MachineBasicBlock.cpp.
Referenced by llvm::recomputeLiveIns().
MachineBasicBlock::LivenessQueryResult MachineBasicBlock::computeRegisterLiveness | ( | const TargetRegisterInfo * | TRI, |
MCRegister | Reg, | ||
const_iterator | Before, | ||
unsigned | Neighborhood = 10 |
||
) | const |
Return whether (physical) register Reg
has been defined and not killed as of just before Before
.
Return whether (physical) register "Reg" has been <def>ined and not <kill>ed as of just before "MI".
Search is localised to a neighborhood of Neighborhood
instructions before (searching for defs or kills) and Neighborhood
instructions after (searching just for defs) Before
.
Reg
must be a physical register.
Search is localised to a neighborhood of Neighborhood instructions before (searching for defs or kills) and N instructions after (searching just for defs) MI.
Definition at line 1608 of file MachineBasicBlock.cpp.
References llvm::AnalyzePhysRegInBundle(), Before, begin(), end(), I, Info, liveins(), LQR_Dead, LQR_Live, LQR_Unknown, N, successors(), and TRI.
Referenced by llvm::Thumb1InstrInfo::copyPhysReg(), loadMBUFScalarOperandsFromVGPR(), and llvm::X86InstrInfo::reMaterialize().
void MachineBasicBlock::copySuccessor | ( | const MachineBasicBlock * | Orig, |
succ_iterator | I | ||
) |
Copy a successor (and any probability info) from original block to this block's.
Uses an iterator into the original blocks successors.
This is useful when doing a partial clone of successors. Afterward, the probabilities may need to be normalized.
Definition at line 891 of file MachineBasicBlock.cpp.
References addSuccessor(), addSuccessorWithoutProb(), getSuccProbability(), and I.
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 297 of file MachineBasicBlock.h.
Referenced by llvm::SPIRVInstrInfo::analyzeBranch(), blockEndsInUnreachable(), bothUsedInPHI(), llvm::calculateDbgEntityHistory(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::CreateEmptyPHI(), dominatesAllUsesOf(), llvm::MipsAsmPrinter::emitBasicBlockEnd(), llvm::SIFrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::AsmPrinter::emitFunctionBody(), llvm::findPHICopyInsertPoint(), generateAssignInstrs(), getBBAddrMapMetadata(), getFallThrough(), getNextMachineInstr(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::AArch64InstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), llvm::SlotIndexes::insertMBBInMaps(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::MipsAsmPrinter::isBlockOnlyReachableByFallthrough(), isEHScopeReturnBlock(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), isReturnBlock(), jumpTableFollowsTB(), llvm::Legalizer::legalizeMachineFunction(), LookForIdenticalPHI(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::X86CallLowering::lowerFormalArguments(), performSink(), processSwitches(), llvm::InstructionSelect::runOnMachineFunction(), llvm::GCNRegPressurePrinter::runOnMachineFunction(), llvm::scavengeFrameVirtualRegs(), llvm::TailDuplicator::shouldTailDuplicate(), llvm::FastISel::startNewBlock(), and llvm::UpgradeDataLayoutString().
|
inline |
Definition at line 327 of file MachineBasicBlock.h.
References instr_end().
Referenced by addLiveIn(), llvm::LiveVariables::addNewBlock(), llvm::ScheduleDAGInstrs::addSchedBarrierDeps(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::RegPressureTracker::advance(), llvm::R600InstrInfo::analyzeBranch(), llvm::ARCInstrInfo::analyzeBranch(), llvm::BPFInstrInfo::analyzeBranch(), llvm::LoongArchInstrInfo::analyzeBranch(), llvm::MSP430InstrInfo::analyzeBranch(), llvm::NVPTXInstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::RISCVInstrInfo::analyzeBranch(), llvm::SystemZInstrInfo::analyzeBranch(), llvm::XCoreInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::SIInstrInfo::analyzeBranch(), llvm::CSKYInstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::LanaiInstrInfo::analyzeBranch(), llvm::SIInstrInfo::analyzeBranchImpl(), llvm::AArch64InstrInfo::analyzeBranchPredicate(), llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::HexagonInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), appendEndToFunction(), llvm::CombinerHelper::applyExtendThroughPhis(), back(), blockEndIsUnreachable(), llvm::BuildMI(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), llvm::RISCVInstrInfo::buildOutlinedFrame(), llvm::X86InstrInfo::buildOutlinedFrame(), llvm::SIRegisterInfo::buildSpillLoadStore(), checkAndUpdateCCRKill(), checkAndUpdateCPSRKill(), checkCCKill(), checkEFLAGSLive(), clearKillFlags(), ComputeCommonTailLength(), computeRegisterLiveness(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), CountTerminators(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::CreateEmptyPHI(), llvm::SIInstrInfo::createPHIDestinationCopy(), llvm::SIInstrInfo::createPHISourceCopy(), dominates(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::X86RegisterInfo::eliminateFrameIndex(), emitAlignedDPRCS2Restores(), emitAlignedDPRCS2Spills(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::X86AsmPrinter::emitBasicBlockEnd(), llvm::AsmPrinter::emitCFIInstruction(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::LoongArchFrameLowering::emitEpilogue(), llvm::M68kFrameLowering::emitEpilogue(), llvm::Mips16FrameLowering::emitEpilogue(), llvm::MipsSEFrameLowering::emitEpilogue(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::WebAssemblyFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::AsmPrinter::emitFunctionBody(), llvm::SITargetLowering::emitGWSMemViolTestLoop(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), emitLoadScalarOpsFromVGPRLoop(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), llvm::AArch64FrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::M68kFrameLowering::emitPrologue(), llvm::MSP430FrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::SystemZXPLINKFrameLowering::emitPrologue(), llvm::WebAssemblyFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), emitReadCycleWidePseudo(), llvm::ScheduleDAGSDNodes::EmitSchedule(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), llvm::VETargetLowering::emitSjLjDispatchBlock(), emitVecCondBranchPseudo(), emitXBegin(), llvm::RegScavenger::enterBasicBlockEnd(), llvm::ScheduleDAGMILive::enterRegion(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), findBranchDebugLoc(), llvm::WebAssembly::findCatch(), llvm::X86RegisterInfo::findDeadCallerSavedReg(), findDeadCallerSavedReg(), findHoistingInsertPosAndDeps(), findIncDecAfter(), findIncDecBefore(), findJumpTableIndex(), FindLastAluClause(), findNextInsertLocation(), findSurvivorBackwards(), llvm::fixStackStores(), fixupPHIOpBanks(), forEachJumpTableBranch(), generateAssignInstrs(), llvm::rdf::Liveness::getAllReachingDefs(), getArgumentStackToRestore(), getBranchDebugLoc(), llvm::RegPressureTracker::getCurrSlot(), getEarliestInsertPos(), llvm::getEHScopeMembership(), getFallThrough(), getFirstNonDebugInstr(), getFirstNonPrologue(), getFirstTerminator(), llvm::InsertPointAnalysis::getLastInsertPointIter(), getLastNonDebugInstr(), getLatestInsertPos(), llvm::ReachingDefAnalysis::getLiveInUses(), llvm::ReachingDefAnalysis::getLocalLiveOutMIDef(), getNextFPInstruction(), getNextMachineInstr(), llvm::ARMBasicBlockUtils::getOffsetOf(), getOrCreateFrameHelper(), llvm::SITargetLowering::getPrefLoopAlignment(), getPreviousInstr(), llvm::ReachingDefAnalysis::getReachingLocalUses(), getSchedRegions(), llvm::X86InstrInfo::getSPAdjust(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::guessSuccessors(), handleADRP(), HashEndOfMBB(), hasTailCall(), llvm::GCNSchedStage::initGCNRegion(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::X86FrameLowering::inlineStackProbe(), insert(), insertAfter(), llvm::R600InstrInfo::insertBranch(), llvm::HexagonInstrInfo::insertBranch(), insertDivByZeroTrap(), llvm::AArch64InstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertReturn(), IsBetterFallthrough(), llvm::MipsAsmPrinter::isBlockOnlyReachableByFallthrough(), IsBranchOnlyBlock(), isEFLAGSLiveAfter(), IsEmptyBlock(), llvm::Thumb2InstrInfo::isLegalToSplitMBBAt(), llvm::TargetInstrInfo::isMBBSafeToOutlineFrom(), llvm::CombinerHelper::isPredecessor(), llvm::ReachingDefAnalysis::isReachingDefLiveOut(), llvm::ReachingDefAnalysis::isRegDefinedAfter(), llvm::ReachingDefAnalysis::isSafeToDefRegAt(), isSafeToMove(), llvm::AArch64InstrInfo::isSchedulingBoundary(), llvm::ARMBaseInstrInfo::isSchedulingBoundary(), llvm::TailDuplicator::isSimpleBB(), llvm::SIInstrInfo::legalizeOperands(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), llvm::SystemZInstrInfo::loadImmediate(), llvm::XCoreInstrInfo::loadImmediate(), loadMBUFScalarOperandsFromVGPR(), llvm::Mips16InstrInfo::loadRegFromStack(), llvm::MipsSEInstrInfo::loadRegFromStack(), llvm::SystemZInstrInfo::loadRegFromStackSlot(), llvm::ARMBaseInstrInfo::loadRegFromStackSlot(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), llvm::BPFInstrInfo::loadRegFromStackSlot(), llvm::SparcInstrInfo::loadRegFromStackSlot(), llvm::VEInstrInfo::loadRegFromStackSlot(), llvm::MSP430InstrInfo::loadRegFromStackSlot(), llvm::CSKYInstrInfo::loadRegFromStackSlot(), llvm::XCoreInstrInfo::loadRegFromStackSlot(), llvm::LanaiInstrInfo::loadRegFromStackSlot(), llvm::PPCInstrInfo::loadRegFromStackSlotNoUpd(), LookForIdenticalPHI(), LowerFPToInt(), lowerWaveReduce(), llvm::MachineInstrSpan::MachineInstrSpan(), llvm::CombinerHelper::matchOptBrCondByInvertingCond(), llvm::AArch64RegisterInfo::materializeFrameBaseRegister(), llvm::SIRegisterInfo::materializeFrameBaseRegister(), llvm::ARMBaseRegisterInfo::materializeFrameBaseRegister(), llvm::PPCRegisterInfo::materializeFrameBaseRegister(), llvm::RISCVRegisterInfo::materializeFrameBaseRegister(), maybeRewriteToFallthrough(), mergeOperations(), llvm::M68kFrameLowering::mergeSPUpdates(), llvm::X86FrameLowering::mergeSPUpdates(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), MoveVPNOTBeforeFirstUser(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::PeelSingleBlockLoop(), performSink(), llvm::ScheduleDAGMI::placeDebugValues(), popRegsFromStack(), llvm::SystemZInstrInfo::prepareCompareSwapOperands(), PrevCrossBBInst(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::AArch64FrameLowering::processFunctionBeforeFrameFinalized(), ProfitableToMerge(), llvm::SIInstrInfo::reMaterialize(), llvm::AArch64InstrInfo::removeBranch(), llvm::R600InstrInfo::removeBranch(), llvm::ARCInstrInfo::removeBranch(), llvm::ARMBaseInstrInfo::removeBranch(), llvm::BPFInstrInfo::removeBranch(), llvm::CSKYInstrInfo::removeBranch(), llvm::HexagonInstrInfo::removeBranch(), llvm::LanaiInstrInfo::removeBranch(), llvm::LoongArchInstrInfo::removeBranch(), llvm::M68kInstrInfo::removeBranch(), llvm::MSP430InstrInfo::removeBranch(), llvm::NVPTXInstrInfo::removeBranch(), llvm::PPCInstrInfo::removeBranch(), llvm::RISCVInstrInfo::removeBranch(), llvm::SparcInstrInfo::removeBranch(), llvm::SystemZInstrInfo::removeBranch(), llvm::VEInstrInfo::removeBranch(), llvm::X86InstrInfo::removeBranch(), llvm::XCoreInstrInfo::removeBranch(), llvm::SlotIndexes::repairIndexesInRange(), llvm::RegBankSelect::RepairingPlacement::RepairingPlacement(), llvm::LiveIntervals::repairIntervalsInRange(), llvm::X86InstrInfo::replaceBranchWithTailCall(), llvm::PPCFrameLowering::replaceFPWithRealFP(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::SystemZELFFrameLowering::restoreCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::restoreCalleeSavedRegisters(), llvm::AArch64FrameLowering::restoreCalleeSavedRegisters(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::CSKYFrameLowering::restoreCalleeSavedRegisters(), llvm::MSP430FrameLowering::restoreCalleeSavedRegisters(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), llvm::Mips16InstrInfo::restoreFrame(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), rollbackRestoreSplit(), llvm::InstructionSelect::runOnMachineFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::InsertNOPLoad::runOnMachineFunction(), llvm::FixAllFDIVSQRT::runOnMachineFunction(), scavengeFrameVirtualRegsInBlock(), llvm::RegScavenger::scavengeRegisterBackwards(), llvm::PPCInstrInfo::shouldReduceRegisterPressure(), shouldUseFrameHelper(), sizeWithoutDebugLargerThan(), skipBackwardPastNonInstructions(), SkipPHIsAndLabels(), SkipPHIsLabelsAndDebug(), llvm::CSKYFrameLowering::spillCalleeSavedRegisters(), llvm::MSP430FrameLowering::spillCalleeSavedRegisters(), llvm::RISCVFrameLowering::spillCalleeSavedRegisters(), llvm::XCoreFrameLowering::spillCalleeSavedRegisters(), llvm::SIRegisterInfo::spillEmergencySGPR(), split(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), splitBlockForLoop(), SplitCriticalEdge(), splitMBB(), llvm::Mips16InstrInfo::storeRegToStack(), llvm::Thumb1InstrInfo::storeRegToStackSlot(), llvm::Thumb2InstrInfo::storeRegToStackSlot(), llvm::BPFInstrInfo::storeRegToStackSlot(), llvm::SparcInstrInfo::storeRegToStackSlot(), llvm::SystemZInstrInfo::storeRegToStackSlot(), llvm::VEInstrInfo::storeRegToStackSlot(), llvm::CSKYInstrInfo::storeRegToStackSlot(), llvm::MSP430InstrInfo::storeRegToStackSlot(), llvm::XCoreInstrInfo::storeRegToStackSlot(), llvm::LanaiInstrInfo::storeRegToStackSlot(), terminators(), llvm::ScheduleDAGMILive::updatePressureDiffs(), llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander(), verifyCFIntrinsic(), verifyCTRBranch(), llvm::MemorySSA::verifyOrderingDominationAndDefUses(), and VerifyPHIs().
|
inline |
Definition at line 328 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 1418 of file MachineBasicBlock.cpp.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::erase(), I, and unbundleSingleMI().
Referenced by llvm::BPFInstrInfo::analyzeBranch(), llvm::MSP430InstrInfo::analyzeBranch(), llvm::SystemZInstrInfo::analyzeBranch(), llvm::LanaiInstrInfo::analyzeBranch(), convertCalleeSaveRestoreToSPPrePostIncDec(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), llvm::AArch64FrameLowering::eliminateCallFramePseudoInstr(), llvm::ARCFrameLowering::eliminateCallFramePseudoInstr(), llvm::HexagonFrameLowering::eliminateCallFramePseudoInstr(), llvm::LanaiFrameLowering::eliminateCallFramePseudoInstr(), llvm::MipsFrameLowering::eliminateCallFramePseudoInstr(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::NVPTXFrameLowering::eliminateCallFramePseudoInstr(), llvm::PPCFrameLowering::eliminateCallFramePseudoInstr(), llvm::SparcFrameLowering::eliminateCallFramePseudoInstr(), llvm::VEFrameLowering::eliminateCallFramePseudoInstr(), llvm::WebAssemblyFrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::Thumb1FrameLowering::eliminateCallFramePseudoInstr(), llvm::CSKYFrameLowering::eliminateCallFramePseudoInstr(), llvm::LoongArchFrameLowering::eliminateCallFramePseudoInstr(), llvm::M68kFrameLowering::eliminateCallFramePseudoInstr(), llvm::RISCVFrameLowering::eliminateCallFramePseudoInstr(), llvm::SystemZFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreRegisterInfo::eliminateFrameIndex(), llvm::CSKYRegisterInfo::eliminateFrameIndex(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), erase(), erase_instr(), llvm::MachineInstr::eraseFromParent(), llvm::AArch64InstrInfo::expandPostRAPseudo(), llvm::R600InstrInfo::expandPostRAPseudo(), llvm::HexagonInstrInfo::expandPostRAPseudo(), llvm::Mips16InstrInfo::expandPostRAPseudo(), llvm::MipsSEInstrInfo::expandPostRAPseudo(), llvm::HexagonInstrInfo::expandVGatherPseudo(), INITIALIZE_PASS(), insertSEH(), llvm::PPCRegisterInfo::lowerACCRestore(), llvm::PPCRegisterInfo::lowerACCSpilling(), llvm::PPCRegisterInfo::lowerCRBitRestore(), llvm::PPCRegisterInfo::lowerCRBitSpilling(), llvm::PPCRegisterInfo::lowerCRRestore(), llvm::PPCRegisterInfo::lowerCRSpilling(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::PPCRegisterInfo::lowerDynamicAreaOffset(), llvm::PPCRegisterInfo::lowerOctWordSpilling(), llvm::PPCRegisterInfo::lowerPrepareProbedAlloca(), llvm::PPCRegisterInfo::lowerQuadwordRestore(), llvm::PPCRegisterInfo::lowerQuadwordSpilling(), llvm::PPCRegisterInfo::lowerWACCRestore(), llvm::PPCRegisterInfo::lowerWACCSpilling(), llvm::M68kFrameLowering::mergeSPUpdates(), llvm::X86FrameLowering::mergeSPUpdates(), popRegsFromStack(), llvm::HexagonInstrInfo::removeBranch(), removeDebugInstrs(), replaceFrameIndex(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::ThumbRegisterInfo::rewriteFrameIndex(), and rollbackRestoreSplit().
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 1024 of file MachineBasicBlock.h.
Remove a range of instructions from the instruction list and delete them.
Definition at line 1017 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 1032 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 1012 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 1451 of file MachineBasicBlock.cpp.
References assert(), llvm::MachineFunction::erase(), and getParent().
Referenced by llvm::X86TargetLowering::EmitKCFICheck(), eraseDeadBBsAndChildren(), processSwitches(), llvm::Thumb2InstrInfo::ReplaceTailWithBranchTo(), rollbackRestoreSplit(), and GCEmptyBasicBlocks::runOnMachineFunction().
DebugLoc MachineBasicBlock::findBranchDebugLoc | ( | ) |
Find and return the merged DebugLoc of the branch instructions of the block.
Return UnknownLoc if there is none.
Definition at line 1535 of file MachineBasicBlock.cpp.
References DL, end(), getFirstTerminator(), and llvm::DILocation::getMergedLocation().
Referenced by FixTail(), llvm::MIRProfileLoader::setBranchProbs(), updateBranches(), updateTerminator(), and updateTerminator().
DebugLoc MachineBasicBlock::findDebugLoc | ( | instr_iterator | MBBI | ) |
Find the next valid DebugLoc starting at MBBI, skipping any debug instructions.
Return UnknownLoc if there is none.
Definition at line 1492 of file MachineBasicBlock.cpp.
References instr_end(), MBBI, and llvm::skipDebugInstructionsForward().
Referenced by llvm::R600InstrInfo::buildDefaultInstruction(), emitCalleeSavedRestores(), llvm::ARCFrameLowering::emitEpilogue(), emitGPDisp(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::M68kFrameLowering::emitSPUpdate(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::VEInstrInfo::expandGetStackTopPseudo(), llvm::SIInstrInfo::expandMovDPP64(), llvm::SIInstrInfo::expandPostRAPseudo(), findDebugLoc(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::X86FrameLowering::inlineStackProbe(), llvm::SIInstrInfo::insertNoops(), llvm::SIInstrInfo::legalizeOpWithMove(), llvm::ARCInstrInfo::loadImmediate(), llvm::HexagonInstrInfo::loadRegFromStackSlot(), llvm::SIInstrInfo::loadRegFromStackSlot(), llvm::ARCInstrInfo::loadRegFromStackSlot(), llvm::M68kInstrInfo::loadRegFromStackSlot(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::X86InstrInfo::replaceBranchWithTailCall(), llvm::M68kFrameLowering::restoreCalleeSavedRegisters(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), rfindDebugLoc(), llvm::M68kFrameLowering::spillCalleeSavedRegisters(), llvm::X86FrameLowering::spillCalleeSavedRegisters(), llvm::HexagonInstrInfo::storeRegToStackSlot(), llvm::SIInstrInfo::storeRegToStackSlot(), llvm::ARCInstrInfo::storeRegToStackSlot(), and llvm::M68kInstrInfo::storeRegToStackSlot().
Definition at line 1096 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 1512 of file MachineBasicBlock.cpp.
References instr_begin(), MBBI, and llvm::prev_nodbg().
Referenced by appendEndToFunction(), and findPrevDebugLoc().
Definition at line 1112 of file MachineBasicBlock.h.
References findPrevDebugLoc(), and MBBI.
|
inline |
Definition at line 304 of file MachineBasicBlock.h.
Referenced by addLiveIn(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::X86AsmPrinter::emitInstruction(), llvm::SlotIndexes::insertMBBInMaps(), insertNopBeforeInstruction(), processSwitches(), llvm::GCNRegPressurePrinter::runOnMachineFunction(), and scavengeFrameVirtualRegsInBlock().
|
inline |
Definition at line 306 of file MachineBasicBlock.h.
|
inline |
Retrieves the BasicBlock which corresponds to this MachineBasicBlock.
Definition at line 262 of file MachineBasicBlock.h.
Referenced by llvm::AsmPrinter::emitBasicBlockStart(), and printName().
|
inline |
Return alignment of the basic block.
Definition at line 576 of file MachineBasicBlock.h.
Referenced by llvm::ARMBasicBlockUtils::adjustBBOffsetsAfter(), llvm::WinException::beginFunclet(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::SITargetLowering::getPrefLoopAlignment(), 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 229 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::addLandingPad(), llvm::AArch64PAuth::checkAuthenticatedRegister(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::SystemZ::emitBlockAfter(), llvm::SelectionDAGBuilder::EmitBranchForMergedCondition(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitReadCycleWidePseudo(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), emitVecCondBranchPseudo(), emitXBegin(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::FastISel::fastEmitBranch(), llvm::SelectionDAGBuilder::FindMergedConditions(), llvm::FastISel::finishCondBranch(), getBranchHint(), getFullName(), llvm::MachineLoop::getLoopID(), getName(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), insertDivByZeroTrap(), llvm::MipsAsmPrinter::isBlockOnlyReachableByFallthrough(), LowerFPToInt(), llvm::WebAssemblyException::print(), printName(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::SelectionDAG::shouldOptForSize(), llvm::shouldOptForSize(), splitAt(), and splitMBB().
|
inline |
Definition at line 643 of file MachineBasicBlock.h.
Referenced by assignSections(), llvm::AsmPrinter::emitBBAddrMapSection(), llvm::AsmPrinter::emitFunctionBody(), 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 1706 of file MachineBasicBlock.cpp.
References isEHFuncletEntry(), and TRI.
|
inline |
Return the call frame size on entry to this basic block.
Definition at line 1173 of file MachineBasicBlock.h.
Referenced by llvm::TargetInstrInfo::getCallFrameSizeAt(), and SplitCriticalEdge().
MCSymbol * MachineBasicBlock::getEHCatchretSymbol | ( | ) | const |
Return the EHCatchret Symbol for this basic block.
Definition at line 92 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 1712 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 103 of file MachineBasicBlock.cpp.
References llvm::MCContext::getAsmInfo(), llvm::MachineFunction::getContext(), llvm::MachineFunction::getFunctionNumber(), getNumber(), llvm::MCContext::getOrCreateSymbol(), getParent(), and llvm::MCAsmInfo::getPrivateLabelPrefix().
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 969 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::AArch64PAuth::checkAuthenticatedRegister(), 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, E, I, instr_begin(), and instr_end().
Referenced by llvm::PeelingModuloScheduleExpander::filterInstructions(), 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(), llvm::SITargetLowering::getPrefLoopAlignment(), IsBranchOnlyBlock(), IsEmptyBlock(), llvm::TargetInstrInfo::isMBBSafeToOutlineFrom(), and llvm::TailDuplicator::isSimpleBB().
|
inline |
Definition at line 887 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(), E, I, instr_begin(), and instr_end().
Referenced by llvm::CombinerHelper::applyExtendThroughPhis(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SwiftErrorValueTracking::createEntriesInEntryBlock(), llvm::ScheduleDAGSDNodes::EmitSchedule(), llvm::PeelingModuloScheduleExpander::filterInstructions(), fixupPHIOpBanks(), getFirstNonPHI(), getFirstNonPrologue(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::GetUndefVal(), llvm::LegalizerHelper::moreElementsVectorPhi(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::LegalizerHelper::narrowScalar(), llvm::PeelSingleBlockLoop(), phis(), llvm::SwiftErrorValueTracking::propagateVRegs(), llvm::FastISel::recomputeInsertPt(), llvm::MachineFunction::salvageCopySSAImpl(), llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander(), and llvm::LegalizerHelper::widenScalar().
|
inline |
Definition at line 838 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(), E, end(), and I.
Referenced by llvm::SIInstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::HexagonInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), copyDebugInfoToPredecessor(), llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitEpilogue(), llvm::ARCFrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::LoongArchFrameLowering::emitEpilogue(), llvm::M68kFrameLowering::emitEpilogue(), llvm::Mips16FrameLowering::emitEpilogue(), llvm::MipsSEFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::WebAssemblyFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::ScheduleDAGSDNodes::EmitSchedule(), findBranchDebugLoc(), findHoistingInsertPosAndDeps(), findInsertLocation(), findJumpTableIndex(), llvm::findPHICopyInsertPoint(), llvm::findSplitPointForStackProtector(), forEachJumpTableBranch(), llvm::getEHScopeMembership(), getFirstTerminator(), llvm::SITargetLowering::getPrefLoopAlignment(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::HexagonInstrInfo::insertBranch(), insertCSRRestores(), llvm::SIInstrInfo::insertReturn(), insertUndefLaneMask(), llvm::SystemZPostRASchedStrategy::leaveMBB(), llvm::SIInstrInfo::legalizeOperands(), llvm::LegalizerHelper::moreElementsVectorPhi(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::SelectionDAGISel::runOnMachineFunction(), SplitCriticalEdge(), splitMBB(), and terminators().
|
inline |
Definition at line 857 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(), 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 326 of file MachineBasicBlock.cpp.
References getBasicBlock(), llvm::MachineFunction::getName(), llvm::Value::getName(), getNumber(), getParent(), and Name.
Referenced by llvm::ARMBlockPlacement::fixBackwardsWLS(), llvm::ScheduleDAGInstrs::getDAGName(), llvm::ScheduleDAGSDNodes::getDAGName(), and verifyCTRBranch().
|
inline |
Definition at line 1183 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::SPIRVInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranchPredicate(), llvm::X86AsmPrinter::emitBasicBlockEnd(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::LanaiFrameLowering::emitEpilogue(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::SparcFrameLowering::emitEpilogue(), llvm::SystemZELFFrameLowering::emitEpilogue(), llvm::SystemZXPLINKFrameLowering::emitEpilogue(), llvm::VEFrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitEpilogue(), getArgumentStackToRestore(), getBranchDebugLoc(), getLastNonDebugInstr(), llvm::ReachingDefAnalysis::getLiveInUses(), llvm::ReachingDefAnalysis::getLocalLiveOutMIDef(), llvm::guessSuccessors(), HashEndOfMBB(), hasTailCall(), IsBetterFallthrough(), llvm::TargetInstrInfo::isMBBSafeToOutlineFrom(), llvm::SystemZInstrInfo::isProfitableToIfCvt(), llvm::ReachingDefAnalysis::isReachingDefLiveOut(), llvm::ReachingDefAnalysis::isRegDefinedAfter(), llvm::AArch64InstrInfo::removeBranch(), llvm::ARCInstrInfo::removeBranch(), llvm::ARMBaseInstrInfo::removeBranch(), llvm::CSKYInstrInfo::removeBranch(), llvm::LoongArchInstrInfo::removeBranch(), llvm::PPCInstrInfo::removeBranch(), llvm::RISCVInstrInfo::removeBranch(), llvm::XCoreInstrInfo::removeBranch(), llvm::RegBankSelect::RepairingPlacement::RepairingPlacement(), llvm::restoreStatusRegister(), and verifyCTRBranch().
|
inline |
Definition at line 909 of file MachineBasicBlock.h.
References getLastNonDebugInstr().
|
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 823 of file MachineBasicBlock.h.
References getFallThrough().
|
inline |
Return the maximum amount of padding allowed for aligning the basic block.
Definition at line 587 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 318 of file MachineBasicBlock.cpp.
References getBasicBlock().
Referenced by llvm::ARMBasicBlockUtils::adjustBBOffsetsAfter(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::AsmPrinter::emitFunctionBody(), getBlockName(), getBranchHint(), getCallStackHashV0(), llvm::GCNSchedStage::initGCNRegion(), llvm::ARMBlockPlacement::moveBasicBlock(), llvm::WebAssemblyExceptionInfo::recalculate(), runOnBasicBlock(), GCEmptyBasicBlocks::runOnMachineFunction(), llvm::scavengeFrameVirtualRegs(), llvm::VLIWMachineScheduler::schedule(), 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 1169 of file MachineBasicBlock.h.
References Number.
Referenced by llvm::LiveVariables::addNewBlock(), llvm::ARMBasicBlockUtils::adjustBBOffsetsAfter(), assignSections(), llvm::SwitchCG::SwitchLowering::buildBitTests(), llvm::LiveIntervals::checkRegMaskInterference(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::AMDGPUAsmPrinter::emitBasicBlockStart(), llvm::AsmPrinter::emitJumpTableInfo(), llvm::SwitchCG::SwitchLowering::findBitTestClusters(), llvm::WebAssembly::SortRegionInfo::getBottom(), llvm::MachineTraceMetrics::Ensemble::getDepthResources(), getEHCatchretSymbol(), llvm::getEHScopeMembership(), getEndSymbol(), getFullName(), llvm::MachineTraceMetrics::Ensemble::getHeightResources(), getMCSymbolForMBB(), llvm::ARMBasicBlockUtils::getOffsetOf(), llvm::MachineTraceMetrics::Trace::getResourceLength(), llvm::MachineTraceMetrics::getResources(), getSymbol(), llvm::MachineTraceMetrics::Ensemble::getTrace(), llvm::LiveVariables::HandleVirtRegUse(), 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::MIPrinter::print(), llvm::CSKYConstantPoolMBB::print(), llvm::WebAssemblyException::print(), printName(), llvm::SwiftErrorValueTracking::propagateVRegs(), llvm::WebAssemblyExceptionInfo::recalculate(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), llvm::MachineFunction::RenumberBlocks(), llvm::SlotIndexes::runOnMachineFunction(), llvm::CFIFixup::runOnMachineFunction(), llvm::MIRProfileLoader::setBranchProbs(), llvm::sortBasicBlocksAndUpdateBranches(), sortBlocks(), llvm::LoopTraversal::traverse(), updateBranches(), llvm::MachineTraceMetrics::Ensemble::updateDepth(), llvm::MachineTraceMetrics::Ensemble::verify(), VerifyPHIs(), llvm::yaml::WebAssemblyFunctionInfo::WebAssemblyFunctionInfo(), and llvm::WriteGraph().
|
inline |
Definition at line 282 of file MachineBasicBlock.h.
|
inline |
Return the MachineFunction containing this basic block.
Definition at line 281 of file MachineBasicBlock.h.
Referenced by addLiveIn(), addLiveInRegs(), llvm::LivePhysRegs::addLiveIns(), llvm::LiveRegUnits::addLiveIns(), llvm::addLiveIns(), llvm::LivePhysRegs::addLiveOuts(), llvm::LiveRegUnits::addLiveOuts(), llvm::LivePhysRegs::addLiveOutsNoPristines(), llvm::MachineInstr::addOperand(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::AddPHIOperand(), addSavedGPR(), llvm::ARMBasicBlockUtils::adjustBBOffsetsAfter(), llvm::RISCVRegisterInfo::adjustReg(), llvm::ARMBaseInstrInfo::analyzeBranch(), llvm::WebAssemblyInstrInfo::analyzeBranch(), analyzeCompressibleUses(), llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), llvm::CombinerHelper::applyExtendThroughPhis(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), bbHasFallthrough(), BBHasFallthrough(), llvm::DwarfCFIException::beginBasicBlockSection(), buildCFAOffs(), llvm::MSP430FrameLowering::BuildCFI(), llvm::X86FrameLowering::BuildCFI(), llvm::AArch64InstrInfo::buildClearRegister(), llvm::X86InstrInfo::buildClearRegister(), buildDefCFAReg(), buildGitPtr(), llvm::BuildMI(), llvm::SIRegisterInfo::buildSpillLoadStore(), canCombine(), canFallThroughTo(), llvm::AArch64InstrInfo::canInsertSelect(), llvm::PPCInstrInfo::canInsertSelect(), llvm::SystemZInstrInfo::canInsertSelect(), llvm::X86InstrInfo::canInsertSelect(), llvm::SIInstrInfo::canInsertSelect(), canSplitCriticalEdge(), llvm::Thumb1FrameLowering::canUseAsEpilogue(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::X86FrameLowering::canUseAsEpilogue(), llvm::AArch64FrameLowering::canUseAsPrologue(), llvm::RISCVFrameLowering::canUseAsPrologue(), llvm::X86FrameLowering::canUseAsPrologue(), llvm::AArch64PAuth::checkAuthenticatedRegister(), llvm::WebAssemblyDebugValueManager::cloneSink(), CombineCVTAToLocal(), llvm::ARMBasicBlockUtils::computeBlockSize(), llvm::HexagonBlockRanges::computeDeadMap(), llvm::computeLiveIns(), llvm::constrainSelectedInstRegOperands(), convertCalleeSaveRestoreToSPPrePostIncDec(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), llvm::SIInstrInfo::convertToThreeAddress(), llvm::Thumb1InstrInfo::copyPhysReg(), llvm::NVPTXInstrInfo::copyPhysReg(), llvm::SystemZInstrInfo::copyPhysReg(), llvm::M68kInstrInfo::copyPhysReg(), llvm::WebAssemblyInstrInfo::copyPhysReg(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), createPHIsForCMOVsInSinkBB(), createPHIsForSelects(), llvm::MachineFunction::deleteMachineBasicBlock(), llvm::ilist_alloc_traits< MachineBasicBlock >::deleteNode(), llvm::LexicalScopes::dominates(), llvm::TargetInstrInfo::duplicate(), llvm::ARMBaseInstrInfo::duplicate(), llvm::AArch64RegisterInfo::eliminateFrameIndex(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::MSP430RegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::SystemZRegisterInfo::eliminateFrameIndex(), llvm::BPFRegisterInfo::eliminateFrameIndex(), llvm::WebAssemblyRegisterInfo::eliminateFrameIndex(), llvm::X86RegisterInfo::eliminateFrameIndex(), emitAlignedDPRCS2Restores(), emitAlignedDPRCS2Spills(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::SystemZ::emitBlockAfter(), emitBuildPairF64Pseudo(), llvm::MSP430FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMovesFullCFA(), emitCalleeSavedRestores(), llvm::AsmPrinter::emitCFIInstruction(), EmitCfiOffset(), EmitDefCfaOffset(), llvm::PPCTargetLowering::emitEHSjLjLongJmp(), llvm::VETargetLowering::emitEHSjLjLongJmp(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::MachineInstr::emitError(), llvm::AArch64TargetLowering::EmitF128CSEL(), llvm::emitFrameOffset(), emitFrameOffsetAdj(), emitFROUND(), llvm::SITargetLowering::emitGWSMemViolTestLoop(), emitIndirectDst(), emitIndirectSrc(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), llvm::X86TargetLowering::EmitKCFICheck(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), llvm::ThumbRegisterInfo::emitLoadConstPool(), emitLoadM0FromVGPRLoop(), emitLoadScalarOpsFromVGPRLoop(), EmitLoweredCascadedSelect(), llvm::AArch64TargetLowering::EmitLoweredCatchRet(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitPrologueEpilogueSPUpdate(), emitPseudoXVINSGR2VR(), emitQuietFCMP(), emitReadCycleWidePseudo(), llvm::ScheduleDAGSDNodes::EmitSchedule(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), llvm::VETargetLowering::emitSjLjDispatchBlock(), emitSplitF64Pseudo(), llvm::X86FrameLowering::emitSPUpdate(), emitThumb1LoadConstPool(), emitThumb2LoadConstPool(), emitThumbRegPlusImmInReg(), emitVecCondBranchPseudo(), emitVFROUND_NOEXCEPT_MASK(), emitXBegin(), llvm::SIInstrInfo::enforceOperandRCAlignment(), eraseFromParent(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::VEInstrInfo::expandGetStackTopPseudo(), expandLoadStackGuard(), llvm::ARMBaseInstrInfo::expandLoadStackGuardBase(), llvm::SIInstrInfo::expandMovDPP64(), ExpandMOVImmSExti8(), llvm::AArch64InstrInfo::expandPostRAPseudo(), llvm::SIInstrInfo::expandPostRAPseudo(), llvm::HexagonInstrInfo::expandPostRAPseudo(), llvm::SparcTargetLowering::expandSelectCC(), expandXorFP(), extractRsrcPtr(), llvm::finalizeBundle(), llvm::X86RegisterInfo::findDeadCallerSavedReg(), findDeadCallerSavedReg(), findIncDecAfter(), findIncDecBefore(), findJumpTableIndex(), llvm::SelectionDAGBuilder::FindMergedConditions(), llvm::findPHICopyInsertPoint(), findRenameRegForSameLdStRegPair(), findScratchNonCalleeSaveRegister(), FixTail(), fixupPHIOpBanks(), llvm::TargetInstrInfo::foldMemoryOperand(), forceReg(), llvm::AArch64InstrInfo::genAlternativeCodeSequence(), generateEndPgm(), llvm::SIInstrInfo::getAddNoCarry(), getBBAddrMapMetadata(), getBBFallenThrough(), llvm::MachineLoop::getBottomBlock(), llvm::MachineInstr::getDebugInstrNum(), getEHCatchretSymbol(), getEndSymbol(), getFallThrough(), llvm::PPCInstrInfo::getFMAPatterns(), getFMULPatterns(), getFNEGPatterns(), getFoldableImm(), getFrameIndexMMO(), getFullName(), getImmedFromMO(), llvm::AArch64InstrInfo::getInstSizeInBytes(), llvm::ARMBaseInstrInfo::getInstSizeInBytes(), getLayoutSuccessorProbThreshold(), llvm::ReachingDefAnalysis::getLiveOuts(), getLoadStoreOffsetSizeInBits(), llvm::ReachingDefAnalysis::getLocalLiveOutMIDef(), getMCSymbolForMBB(), llvm::MipsInstrInfo::GetMemOperand(), llvm::MachineInstr::getMF(), getMFIfAvailable(), getNextBlock(), llvm::AArch64InstrInfo::getOutlinableRanges(), llvm::RISCVInstrInfo::getOutliningTypeImpl(), llvm::AArch64InstrInfo::getOutliningTypeImpl(), getSchedRegions(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::HexagonInstrInfo::getSize(), getSymbol(), GetSymbolRef(), llvm::MachineLoop::getTopBlock(), llvm::TargetInstrInfo::hasReassociableOperands(), llvm::TargetInstrInfo::hasReassociableSibling(), hoistAndMergeSGPRInits(), indirectCopyToAGPR(), INITIALIZE_PASS(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::ARMBaseInstrInfo::insertBranch(), llvm::VEInstrInfo::insertBranch(), insertCSRRestores(), insertCSRSaves(), insertDivByZeroTrap(), llvm::SIInstrInfo::insertEQ(), llvm::AArch64InstrInfo::insertIndirectBranch(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::LoongArchInstrInfo::insertIndirectBranch(), llvm::RISCVInstrInfo::insertIndirectBranch(), llvm::SlotIndexes::insertMBBInMaps(), llvm::insertMultibyteShift(), llvm::SIInstrInfo::insertNE(), llvm::SIInstrInfo::insertReturn(), InsertSEH(), insertSEH(), llvm::SIInstrInfo::insertSelect(), llvm::AArch64InstrInfo::insertSelect(), llvm::PPCInstrInfo::insertSelect(), llvm::SystemZInstrInfo::insertSelect(), llvm::X86InstrInfo::insertSelect(), insertUndefLaneMask(), llvm::SIInstrInfo::insertVectorSelect(), llvm::InstrEmitter::InstrEmitter(), isAlwaysIndirectTarget(), llvm::AArch64InstrInfo::isAssociativeAndCommutative(), isColdBlock(), isCombineInstrCandidateFP(), isCVTAToLocalCombinationCandidate(), llvm::MachineInstr::isDereferenceableInvariantLoad(), isEntryBlock(), isFunctionEntryBlock(), llvm::LiveRangeCalc::isJointlyDominated(), llvm::SIInstrInfo::isLegalRegOperand(), isLibCallInTailPosition(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), llvm::AArch64InstrInfo::isMBBSafeToSplitToCold(), isNoReturnDef(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), llvm::ReachingDefAnalysis::isReachingDefLiveOut(), llvm::ReachingDefAnalysis::isRegUsedAfter(), jumpTableFollowsTB(), llvm::SIInstrInfo::legalizeOpWithMove(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), livein_begin(), liveout_begin(), llvm::MipsSEInstrInfo::loadImmediate(), llvm::SystemZInstrInfo::loadImmediate(), llvm::XCoreInstrInfo::loadImmediate(), loadM0FromVGPR(), loadMBUFScalarOperandsFromVGPR(), llvm::MipsSEInstrInfo::loadRegFromStack(), llvm::AArch64InstrInfo::loadRegFromStackSlot(), llvm::ARMBaseInstrInfo::loadRegFromStackSlot(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), llvm::HexagonInstrInfo::loadRegFromStackSlot(), llvm::SparcInstrInfo::loadRegFromStackSlot(), llvm::VEInstrInfo::loadRegFromStackSlot(), llvm::LoongArchInstrInfo::loadRegFromStackSlot(), llvm::RISCVInstrInfo::loadRegFromStackSlot(), llvm::MSP430InstrInfo::loadRegFromStackSlot(), llvm::SIInstrInfo::loadRegFromStackSlot(), llvm::ARCInstrInfo::loadRegFromStackSlot(), llvm::CSKYInstrInfo::loadRegFromStackSlot(), llvm::M68kInstrInfo::loadRegFromStackSlot(), llvm::X86InstrInfo::loadRegFromStackSlot(), llvm::XCoreInstrInfo::loadRegFromStackSlot(), llvm::PPCInstrInfo::loadRegFromStackSlotNoUpd(), llvm::X86InstrInfo::loadStoreTileReg(), llvm::PPCRegisterInfo::lowerACCRestore(), llvm::PPCRegisterInfo::lowerACCSpilling(), LowerCallResults(), llvm::PPCRegisterInfo::lowerCRBitRestore(), llvm::PPCRegisterInfo::lowerCRBitSpilling(), llvm::PPCRegisterInfo::lowerCRRestore(), llvm::PPCRegisterInfo::lowerCRSpilling(), llvm::VETargetLowering::LowerCustomJumpTableEntry(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::PPCRegisterInfo::lowerDynamicAreaOffset(), LowerFPToInt(), llvm::PPCRegisterInfo::lowerOctWordSpilling(), llvm::PPCRegisterInfo::lowerPrepareProbedAlloca(), llvm::PPCRegisterInfo::lowerQuadwordRestore(), llvm::PPCRegisterInfo::lowerQuadwordSpilling(), lowerRISCVVMachineInstrToMCInst(), llvm::RISCVRegisterInfo::lowerVRELOAD(), llvm::RISCVRegisterInfo::lowerVSPILL(), llvm::PPCRegisterInfo::lowerWACCRestore(), llvm::PPCRegisterInfo::lowerWACCSpilling(), lowerWaveReduce(), llvm::Mips16InstrInfo::makeFrame(), mapWasmLandingPadIndex(), llvm::AArch64RegisterInfo::materializeFrameBaseRegister(), llvm::SIRegisterInfo::materializeFrameBaseRegister(), llvm::ARMBaseRegisterInfo::materializeFrameBaseRegister(), llvm::PPCRegisterInfo::materializeFrameBaseRegister(), llvm::RISCVRegisterInfo::materializeFrameBaseRegister(), llvm::SIInstrInfo::materializeImmediate(), llvm::PPCInstrInfo::materializeImmPostRA(), maybeUpdateTerminator(), mergeOperations(), llvm::X86FrameLowering::mergeSPUpdates(), moveAfter(), llvm::ARMBlockPlacement::moveBasicBlock(), moveBefore(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::CSKYInstrInfo::movImm(), llvm::PPCRegisterInfo::needsFrameBaseReg(), llvm::PPCInstrInfo::optimizeCmpPostRA(), llvm::AArch64InstrInfo::optimizeCondBranch(), llvm::RISCVInstrInfo::optimizeCondBranch(), popRegsFromStack(), llvm::SystemZInstrInfo::prepareCompareSwapOperands(), llvm::PPCRegisterInfo::prepareDynamicAlloca(), llvm::VETargetLowering::prepareMBB(), llvm::VETargetLowering::prepareSymbol(), PrevCrossBBInst(), llvm::MIPrinter::print(), print(), llvm::AArch64InstrInfo::probedStackAlloc(), llvm::ARMBaseInstrInfo::produceSameValue(), ProfitableToMerge(), propagateLocalCopies(), pushRegsToStack(), llvm::recomputeLivenessFlags(), reduceDbgValsForwardScan(), llvm::TargetInstrInfo::reMaterialize(), llvm::SIInstrInfo::reMaterialize(), llvm::ARMBaseInstrInfo::reMaterialize(), llvm::X86InstrInfo::reMaterialize(), removeFromParent(), replaceDominatedUses(), replaceFrameIndex(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::Thumb2InstrInfo::ReplaceTailWithBranchTo(), reportIllegalCopy(), rescheduleCanonically(), llvm::AArch64FrameLowering::resetCFIToInitialState(), llvm::ARMBaseRegisterInfo::resolveFrameIndex(), llvm::PPCRegisterInfo::resolveFrameIndex(), llvm::SystemZELFFrameLowering::restoreCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::restoreCalleeSavedRegisters(), llvm::AArch64FrameLowering::restoreCalleeSavedRegisters(), llvm::ARCFrameLowering::restoreCalleeSavedRegisters(), llvm::ARMFrameLowering::restoreCalleeSavedRegisters(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::CSKYFrameLowering::restoreCalleeSavedRegisters(), llvm::MSP430FrameLowering::restoreCalleeSavedRegisters(), llvm::PPCFrameLowering::restoreCalleeSavedRegisters(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), llvm::XCoreFrameLowering::restoreCalleeSavedRegisters(), restoreCRs(), llvm::Mips16InstrInfo::restoreFrame(), llvm::X86FrameLowering::restoreWin32EHStackPointers(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::ThumbRegisterInfo::rewriteFrameIndex(), llvm::MachineFunction::salvageCopySSAImpl(), llvm::Mips16RegisterInfo::saveScavengerRegister(), llvm::RegScavenger::scavengeRegisterBackwards(), scavengeVReg(), llvm::VLIWMachineScheduler::schedule(), setCallTargetReg(), llvm::SGPRSpillBuilder::setMI(), llvm::AArch64InstrInfo::shouldClusterMemOps(), llvm::ARMBaseRegisterInfo::shouldCoalesce(), llvm::shouldOptForSize(), llvm::PPCInstrInfo::shouldReduceRegisterPressure(), llvm::TailDuplicator::shouldTailDuplicate(), shouldUseFrameHelper(), llvm::WebAssemblyDebugValueManager::sink(), SkipPHIsAndLabels(), SkipPHIsLabelsAndDebug(), llvm::SystemZELFFrameLowering::spillCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::spillCalleeSavedRegisters(), llvm::AArch64FrameLowering::spillCalleeSavedRegisters(), llvm::ARCFrameLowering::spillCalleeSavedRegisters(), llvm::ARMFrameLowering::spillCalleeSavedRegisters(), llvm::Thumb1FrameLowering::spillCalleeSavedRegisters(), llvm::CSKYFrameLowering::spillCalleeSavedRegisters(), llvm::LoongArchFrameLowering::spillCalleeSavedRegisters(), llvm::M68kFrameLowering::spillCalleeSavedRegisters(), llvm::Mips16FrameLowering::spillCalleeSavedRegisters(), llvm::MipsSEFrameLowering::spillCalleeSavedRegisters(), llvm::MSP430FrameLowering::spillCalleeSavedRegisters(), llvm::PPCFrameLowering::spillCalleeSavedRegisters(), llvm::RISCVFrameLowering::spillCalleeSavedRegisters(), llvm::X86FrameLowering::spillCalleeSavedRegisters(), llvm::XCoreFrameLowering::spillCalleeSavedRegisters(), spillVGPRtoAGPR(), split(), splitAt(), splitBlock(), splitBlockForLoop(), SplitCriticalEdge(), splitEdge(), splitMBB(), llvm::stableHashValue(), llvm::MipsSEInstrInfo::storeRegToStack(), llvm::AArch64InstrInfo::storeRegToStackSlot(), llvm::ARMBaseInstrInfo::storeRegToStackSlot(), llvm::Thumb1InstrInfo::storeRegToStackSlot(), llvm::Thumb2InstrInfo::storeRegToStackSlot(), llvm::HexagonInstrInfo::storeRegToStackSlot(), llvm::LoongArchInstrInfo::storeRegToStackSlot(), llvm::RISCVInstrInfo::storeRegToStackSlot(), llvm::SparcInstrInfo::storeRegToStackSlot(), llvm::VEInstrInfo::storeRegToStackSlot(), llvm::SIInstrInfo::storeRegToStackSlot(), llvm::ARCInstrInfo::storeRegToStackSlot(), llvm::CSKYInstrInfo::storeRegToStackSlot(), llvm::M68kInstrInfo::storeRegToStackSlot(), llvm::MSP430InstrInfo::storeRegToStackSlot(), llvm::X86InstrInfo::storeRegToStackSlot(), llvm::XCoreInstrInfo::storeRegToStackSlot(), llvm::PPCInstrInfo::storeRegToStackSlotNoUpd(), llvm::HexagonInstrInfo::translateInstrsForDup(), tryToSplitRestore(), unstackifyVRegsUsedInSplitBB(), updateLiveIn(), UpdateOperandRegClass(), updateTerminator(), verifyCFIntrinsic(), verifyCTRBranch(), and llvm::SelectionDAGBuilder::visitSPDescriptorParent().
|
inline |
Returns the section ID of this basic block.
Definition at line 646 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::assignBeginEndSections(), assignSections(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::AArch64InstrInfo::insertIndirectBranch(), printName(), and sameSection().
|
inline |
Returns the unique section ID number of this basic block.
Definition at line 649 of file MachineBasicBlock.h.
References llvm::MBBSectionID::Cold, llvm::MBBSectionID::Number, and llvm::MBBSectionID::Type.
Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), llvm::DwarfDebug::beginInstruction(), llvm::EHStreamer::computeCallSiteTable(), llvm::AsmPrinter::emitFunctionBody(), and llvm::AsmPrinter::getMBBExceptionSym().
|
inline |
Definition at line 808 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 965 of file MachineBasicBlock.cpp.
Referenced by getSinglePredecessor().
|
inline |
Definition at line 799 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 961 of file MachineBasicBlock.cpp.
Referenced by getSingleSuccessor().
|
inlinestatic |
Support for MachineInstr::getNextNode().
Definition at line 341 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 1552 of file MachineBasicBlock.cpp.
References llvm::BranchProbability::getZero(), P, and succ_size().
Referenced by copySuccessor(), llvm::MIPrinter::print(), and print().
MCSymbol * MachineBasicBlock::getSymbol | ( | ) | const |
Return the MCSymbol for this basic block.
Definition at line 61 of file MachineBasicBlock.cpp.
References llvm::MBBSectionID::ColdSectionID, llvm::MBBSectionID::ExceptionSectionID, llvm::MCContext::getAsmInfo(), llvm::MachineFunction::getContext(), llvm::MachineFunction::getFunctionNumber(), llvm::MachineFunction::getName(), getNumber(), llvm::MCContext::getOrCreateSymbol(), getParent(), llvm::MCAsmInfo::getPrivateLabelPrefix(), llvm::MachineFunction::hasBBSections(), isBeginSection(), and llvm::MBBSectionID::Number.
Referenced by llvm::DebugHandlerBase::beginBasicBlockSection(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::AsmPrinter::emitBBAddrMapSection(), EmitInlineAsmStr(), llvm::ARMAsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), llvm::AsmPrinter::emitJumpTableInfo(), llvm::ARMAsmPrinter::emitJumpTableInsts(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::SystemZMCInstLower::getExpr(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::M68kMCInstLower::GetSymbolFromOperand(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::M68kTargetLowering::LowerCustomJumpTableEntry(), llvm::RISCVTargetLowering::LowerCustomJumpTableEntry(), llvm::VETargetLowering::LowerCustomJumpTableEntry(), llvm::X86TargetLowering::LowerCustomJumpTableEntry(), llvm::lowerLoongArchMachineOperandToMCOperand(), LowerOperand(), llvm::ARMAsmPrinter::lowerOperand(), llvm::AArch64MCInstLower::lowerOperand(), AMDGPUMCInstLower::lowerOperand(), llvm::CSKYMCInstLower::lowerOperand(), llvm::LowerPPCMachineOperandToMCOperand(), LowerSymbolOperand(), llvm::WebAssemblyAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::printOperand(), llvm::MipsAsmPrinter::printOperand(), llvm::AVRAsmPrinter::printOperand(), and llvm::HexagonAsmPrinter::printOperand().
|
inline |
Test whether this block is used as something other than the target of a terminator, exception-handling target, or jump table.
This is either the result of an IR-level "blockaddress", or some form of target-specific branch lowering.
Definition at line 247 of file MachineBasicBlock.h.
Referenced by llvm::MachineLoopInfo::findLoopPreheader(), isAlwaysIndirectTarget(), 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 isLegalToHoistInto().
|
inline |
Test whether this block must have its label emitted.
Definition at line 274 of file MachineBasicBlock.h.
Referenced by llvm::AsmPrinter::emitBasicBlockStart().
|
inline |
Return true if any of the successors have probabilities attached to them.
Definition at line 780 of file MachineBasicBlock.h.
MachineBasicBlock::instr_iterator MachineBasicBlock::insert | ( | instr_iterator | I, |
MachineInstr * | M | ||
) |
Insert MI into the instruction list before I, possibly inside a bundle.
If the insertion point is inside a bundle, MI will be added to the bundle, otherwise MI will not be added to any bundle. That means this function alone can't be used to prepend or append instructions to bundles. See MIBundleBuilder::insert() for a more reliable way of doing that.
Definition at line 1431 of file MachineBasicBlock.cpp.
References assert(), llvm::MachineInstr::BundledPred, llvm::MachineInstr::BundledSucc, I, llvm::iplist_impl< IntrusiveListT, TraitsT >::insert(), instr_end(), and MI.
Referenced by llvm::M68kInstrInfo::AnalyzeBranchImpl(), llvm::BuildMI(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::RISCVInstrInfo::buildOutlinedFrame(), llvm::X86InstrInfo::buildOutlinedFrame(), llvm::MachineFunction::cloneMachineInstrBundle(), llvm::WebAssemblyDebugValueManager::cloneSink(), CombineCVTAToLocal(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), llvm::ARMBaseInstrInfo::convertToThreeAddress(), llvm::X86InstrInfo::convertToThreeAddress(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86TargetLowering::EmitKCFICheck(), llvm::TargetLoweringBase::emitPatchPoint(), llvm::X86FrameLowering::emitPrologue(), llvm::ScheduleDAGSDNodes::EmitSchedule(), llvm::TargetInstrInfo::foldMemoryOperand(), FuseInst(), FuseTwoAddrInst(), llvm::RegBankSelect::InsertPoint::insert(), insertDeleteInstructions(), llvm::MachineIRBuilder::insertInstr(), llvm::AArch64InstrInfo::insertOutlinedCall(), llvm::ARMBaseInstrInfo::insertOutlinedCall(), llvm::RISCVInstrInfo::insertOutlinedCall(), llvm::X86InstrInfo::insertOutlinedCall(), llvm::PPCInstrInfo::loadRegFromStackSlotNoUpd(), LowerCallResults(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::PeelSingleBlockLoop(), performSink(), popRegsFromStack(), ProcessSDDbgValues(), pushRegsToStack(), llvm::TargetInstrInfo::reMaterialize(), llvm::SIInstrInfo::reMaterialize(), llvm::ARMBaseInstrInfo::reMaterialize(), llvm::X86InstrInfo::reMaterialize(), restoreCRs(), llvm::GCNSchedStage::revertScheduling(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::GCNIterativeScheduler::scheduleRegion(), llvm::WebAssemblyDebugValueManager::sink(), llvm::PPCFrameLowering::spillCalleeSavedRegisters(), and llvm::PPCInstrInfo::storeRegToStackSlotNoUpd().
|
inline |
|
inline |
Insert MI into the instruction list after I.
Definition at line 982 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 992 of file MachineBasicBlock.h.
References assert(), I, instr_end(), and MI.
|
inline |
Definition at line 300 of file MachineBasicBlock.h.
|
inline |
Definition at line 302 of file MachineBasicBlock.h.
|
inline |
Definition at line 309 of file MachineBasicBlock.h.
Referenced by llvm::HexagonInstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeBranch(), begin(), checkRegOnlyPHIInputs(), 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::MIPrinter::print(), llvm::WebAssemblyInstrInfo::removeBranch(), ReplaceUsesOfBlockWith(), rescheduleCanonically(), rfindDebugLoc(), and SplitCriticalEdge().
|
inline |
Definition at line 310 of file MachineBasicBlock.h.
|
inline |
Definition at line 311 of file MachineBasicBlock.h.
Referenced by llvm::GCNSubtarget::adjustSchedDependency(), llvm::HexagonInstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeBranch(), analyzeCompressibleUses(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), checkRegOnlyPHIInputs(), llvm::AsmPrinter::emitCFIInstruction(), 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::MIPrinter::print(), llvm::WebAssemblyInstrInfo::removeBranch(), ReplaceUsesOfBlockWith(), rescheduleCanonically(), splitBlock(), SplitCriticalEdge(), and llvm::HexagonInstrInfo::translateInstrsForDup().
|
inline |
Definition at line 312 of file MachineBasicBlock.h.
|
inline |
Definition at line 299 of file MachineBasicBlock.h.
|
inline |
Definition at line 301 of file MachineBasicBlock.h.
|
inline |
Definition at line 313 of file MachineBasicBlock.h.
Referenced by forEachJumpTableBranch(), llvm::AArch64InstrInfo::getOutlinableRanges(), llvm::ReachingDefAnalysis::isRegUsedAfter(), rbegin(), and rfindDebugLoc().
|
inline |
Definition at line 314 of file MachineBasicBlock.h.
|
inline |
Definition at line 315 of file MachineBasicBlock.h.
Referenced by forAllMIsUntilDef(), forEachJumpTableBranch(), llvm::AArch64InstrInfo::getOutlinableRanges(), getWaitStatesSince(), hasHazard(), llvm::ReachingDefAnalysis::isRegUsedAfter(), rend(), rfindDebugLoc(), and rfindPrevDebugLoc().
|
inline |
Definition at line 316 of file MachineBasicBlock.h.
|
inline |
Definition at line 320 of file MachineBasicBlock.h.
References instr_begin(), and instr_end().
Referenced by llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::RegBankSelect::assignRegisterBanks(), llvm::AArch64InstrInfo::buildOutlinedFrame(), llvm::ARMBaseInstrInfo::buildOutlinedFrame(), copyDebugInfoToPredecessor(), copyDebugInfoToSuccessor(), llvm::PPCInstrInfo::findLoopInstr(), findPrologueEnd(), getFirstTerminatorForward(), llvm::instrs(), print(), propagateLocalCopies(), and rescheduleCanonically().
|
inline |
Definition at line 321 of file MachineBasicBlock.h.
References instr_begin(), and instr_end().
|
inline |
Returns true if this block begins any section.
Definition at line 634 of file MachineBasicBlock.h.
Referenced by llvm::avoidZeroOffsetLandingPad(), llvm::EHStreamer::computeCallSiteTable(), llvm::AsmPrinter::emitBasicBlockStart(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), and getSymbol().
|
inline |
Returns true if this is the entry block of a cleanup funclet.
Definition at line 628 of file MachineBasicBlock.h.
Referenced by llvm::WinException::beginFunclet(), llvm::X86FrameLowering::emitPrologue(), and getMCSymbolForMBB().
|
inline |
Returns true if this is a target block of a catchret.
Definition at line 616 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 622 of file MachineBasicBlock.h.
Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::AsmPrinter::emitBasicBlockStart(), 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 596 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(), isAlwaysIndirectTarget(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::MipsAsmPrinter::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 609 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 922 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 637 of file MachineBasicBlock.h.
Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), llvm::EHStreamer::computeCallSiteTable(), llvm::AsmPrinter::emitBasicBlockEnd(), 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 672 of file MachineBasicBlock.h.
Referenced by canSplitCriticalEdge(), llvm::TailDuplicator::canTailDuplicate(), 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.)
Definition at line 259 of file MachineBasicBlock.h.
Referenced by llvm::AsmPrinter::emitBasicBlockStart(), and printName().
bool MachineBasicBlock::isLayoutSuccessor | ( | const MachineBasicBlock * | MBB | ) | const |
Return true if the specified MBB will be emitted immediately after this block, such that if this block exits by falling through, control will transfer to the specified MBB.
Note that MBB need not be a successor at all, for example if this block ends with an unconditional branch to some other block.
Definition at line 956 of file MachineBasicBlock.cpp.
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::MipsAsmPrinter::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 | ( | MCPhysReg | Reg, |
LaneBitmask | LaneMask = LaneBitmask::getAll() |
||
) | const |
Return true if the specified register is in the live in set.
Definition at line 610 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::X86FrameLowering::canUseAsPrologue(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::SystemZXPLINKFrameLowering::emitPrologue(), llvm::getFunctionLiveInPhysReg(), llvm::ReachingDefAnalysis::getGlobalUses(), INITIALIZE_PASS(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), llvm::AArch64InstrInfo::insertOutlinedCall(), llvm::ARMBaseInstrInfo::insertOutlinedCall(), isEFLAGSLive(), 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.
Definition at line 255 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 948 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 916 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(), 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 952 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 1723 of file MachineBasicBlock.cpp.
References assert(), getParent(), and llvm::MachineFunctionProperties::TracksLiveness.
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 461 of file MachineBasicBlock.h.
Referenced by liveins_dbg().
|
inline |
Definition at line 468 of file MachineBasicBlock.h.
Referenced by llvm::addLiveIns(), llvm::MIPrinter::print(), and print().
|
inline |
Definition at line 467 of file MachineBasicBlock.h.
Referenced by isLiveIn(), liveins(), and liveins_dbg().
|
inline |
Definition at line 469 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(), isEAXLiveIn(), isRegLiveIn(), print(), SplitCriticalEdge(), splitEdge(), and tryToSplitRestore().
|
inline |
Definition at line 462 of file MachineBasicBlock.h.
References livein_begin_dbg(), livein_end(), and llvm::make_range().
Referenced by llvm::MIPrinter::print().
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 1730 of file MachineBasicBlock.cpp.
References assert(), llvm::TargetLoweringBase::getExceptionPointerRegister(), llvm::TargetLoweringBase::getExceptionSelectorRegister(), llvm::MachineFunction::getFunction(), getParent(), llvm::Function::getPersonalityFn(), llvm::MachineFunction::getProperties(), llvm::MachineFunction::getSubtarget(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::Function::hasPersonalityFn(), llvm::MachineFunctionProperties::hasProperty(), and llvm::MachineFunctionProperties::TracksLiveness.
Referenced by liveouts().
|
inline |
Definition at line 560 of file MachineBasicBlock.h.
Referenced by liveouts().
|
inline |
Definition at line 563 of file MachineBasicBlock.h.
References liveout_begin(), liveout_end(), and llvm::make_range().
Referenced by emitThumbRegPlusImmInReg().
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 672 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 668 of file MachineBasicBlock.cpp.
References llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), llvm::ilist_node_impl< OptionsT >::getIterator(), getParent(), and llvm::MachineFunction::splice().
Referenced by llvm::ARMBlockPlacement::moveBasicBlock().
|
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 732 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 353 of file MachineBasicBlock.h.
References begin(), getFirstNonPHI(), and llvm::make_range().
Referenced by llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PeelingModuloScheduleExpander::fixupBranches(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), phis(), and replacePhiUsesWith().
|
inline |
Definition at line 356 of file MachineBasicBlock.h.
References phis().
|
inline |
Definition at line 953 of file MachineBasicBlock.h.
|
inline |
Definition at line 952 of file MachineBasicBlock.h.
|
inline |
Definition at line 373 of file MachineBasicBlock.h.
Referenced by llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::PPCInstrInfo::analyzeLoopForPipelining(), BBIsJumpedOver(), bbIsJumpedOver(), llvm::ModuloScheduleExpander::expand(), findWLS(), getSingleSchedPred(), INITIALIZE_PASS(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::MipsAsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), isSaveReachableThroughClean(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::PeelingModuloScheduleExpander::peelPrologAndEpilogs(), predecessors(), processSwitches(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), removeOldExitPreds(), searchPredecessors(), SinkingPreventsImplicitNullCheck(), and VerifyPHIs().
|
inline |
Definition at line 374 of file MachineBasicBlock.h.
|
inline |
Definition at line 388 of file MachineBasicBlock.h.
Referenced by llvm::rdf::DataFlowGraph::build(), eraseDeadBBsAndChildren(), llvm::getEHScopeMembership(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::MipsAsmPrinter::isBlockOnlyReachableByFallthrough(), llvm::TailDuplicator::isSimpleBB(), print(), processSwitches(), llvm::TailDuplicator::tailDuplicateAndUpdate(), and validThroughout().
|
inline |
Definition at line 375 of file MachineBasicBlock.h.
Referenced by llvm::MipsAsmPrinter::isBlockOnlyReachableByFallthrough(), isSaveReachableThroughClean(), predecessors(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), removeOldExitPreds(), searchPredecessors(), and VerifyPHIs().
|
inline |
Definition at line 376 of file MachineBasicBlock.h.
|
inline |
Definition at line 377 of file MachineBasicBlock.h.
Referenced by llvm::LiveVariables::MarkVirtRegAliveInBlock().
|
inline |
Definition at line 379 of file MachineBasicBlock.h.
|
inline |
Definition at line 381 of file MachineBasicBlock.h.
Referenced by llvm::LiveVariables::MarkVirtRegAliveInBlock().
|
inline |
Definition at line 383 of file MachineBasicBlock.h.
|
inline |
Definition at line 385 of file MachineBasicBlock.h.
Referenced by BBIsJumpedOver(), bbIsJumpedOver(), llvm::MachineLoopInfo::findLoopPreheader(), findWLS(), getSingleSchedPred(), llvm::LiveIntervals::hasPHIKill(), 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(), SinkingPreventsImplicitNullCheck(), and sortBlocks().
|
inline |
Definition at line 406 of file MachineBasicBlock.h.
References llvm::make_range(), pred_begin(), and pred_end().
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), CanLowerPriorityDirectlyInPredecessors(), llvm::ConnectedVNInfoEqClasses::Classify(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), llvm::HexagonInstrInfo::findLoopInstr(), llvm::MachineLoopInfo::findLoopPreheader(), findPotentialBlockers(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::FindPredecessorBlocks(), 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(), removeExternalCFGEdges(), GCEmptyBasicBlocks::runOnMachineFunction(), salvageDebugInfoFromEmptyBlock(), searchPredecessors(), sortBlocks(), and verifyCTRBranch().
|
inline |
Definition at line 409 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 337 of file MachineBasicBlock.cpp.
References F, llvm::MachineFunction::getFunction(), getParent(), llvm::ModuleSlotTracker::incorporateFunction(), OS, and print().
Referenced by 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 352 of file MachineBasicBlock.cpp.
References llvm::MachineInstr::BundledSucc, E, 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 586 of file MachineBasicBlock.cpp.
References OS, and printName().
Referenced by llvm::MIPrinter::print(), llvm::MachineInstr::print(), and llvm::printMBBReference().
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 482 of file MachineBasicBlock.cpp.
References llvm::MBBSectionID::Cold, llvm::MBBSectionID::Exception, getAddressTakenIRBlock(), getAlignment(), getBasicBlock(), getBBID(), llvm::ModuleSlotTracker::getLocalSlot(), getNumber(), getSectionID(), llvm::ModuleSlotTracker::incorporateFunction(), isEHFuncletEntry(), isEHPad(), isInlineAsmBrIndirectTarget(), isIRBlockAddressTaken(), isMachineBlockAddressTaken(), llvm::MBBSectionID::Number, PrintNameAttributes, PrintNameIr, llvm::MBBSectionID::Type, and llvm::Align::value().
Referenced by llvm::MIPrinter::print(), print(), printAsOperand(), and llvm::GCNRegPressurePrinter::runOnMachineFunction().
|
inline |
Definition at line 954 of file MachineBasicBlock.h.
References MI.
Referenced by llvm::M68kInstrInfo::AnalyzeBranchImpl(), and emitSelectPseudo().
|
inline |
Definition at line 329 of file MachineBasicBlock.h.
References llvm::MachineInstrBundleIterator< Ty, IsReverse >::getAtBundleBegin(), and instr_rbegin().
Referenced by llvm::MipsInstrInfo::analyzeBranch(), llvm::M68kInstrInfo::AnalyzeBranchImpl(), dominatesAllUsesOf(), FindLastAluClause(), llvm::findPHICopyInsertPoint(), getBBAddrMapMetadata(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), mergeOperations(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::MipsInstrInfo::removeBranch(), splitAt(), and verifySameBranchInstructions().
|
inline |
Definition at line 332 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 1041 of file MachineBasicBlock.h.
Referenced by llvm::X86InstrInfo::optimizeCompareInstr(), llvm::MachineInstr::removeFromParent(), llvm::GCNSchedStage::revertScheduling(), 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 1423 of file MachineBasicBlock.cpp.
References llvm::MachineInstr::BundledPred, llvm::MachineInstr::BundledSucc, MI, llvm::iplist_impl< IntrusiveListT, TraitsT >::remove(), and unbundleSingleMI().
Referenced by llvm::MachineInstr::removeFromBundle().
MachineBasicBlock * MachineBasicBlock::removeFromParent | ( | ) |
This method unlinks 'this' from the containing function, and returns it, but does not delete it.
Definition at line 1444 of file MachineBasicBlock.cpp.
References assert(), getParent(), and llvm::MachineFunction::remove().
MachineBasicBlock::livein_iterator MachineBasicBlock::removeLiveIn | ( | MachineBasicBlock::livein_iterator | I | ) |
Remove entry from the livein set and return iterator to the next.
Definition at line 604 of file MachineBasicBlock.cpp.
References I.
void MachineBasicBlock::removeLiveIn | ( | MCPhysReg | Reg, |
LaneBitmask | LaneMask = LaneBitmask::getAll() |
||
) |
Remove the specified register from the live in set.
Definition at line 592 of file MachineBasicBlock.cpp.
References llvm::find_if(), I, and llvm::MachineBasicBlock::RegisterMaskPair::PhysReg.
Referenced by emitGPDisp(), 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 828 of file MachineBasicBlock.cpp.
References llvm::find(), I, and removeSuccessor().
Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock(), eraseDeadBBsAndChildren(), loadM0FromVGPR(), processSwitches(), removeSuccessor(), replaceSuccessor(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), rollbackRestoreSplit(), GCEmptyBasicBlocks::runOnMachineFunction(), transferSuccessors(), transferSuccessorsAndUpdatePHIs(), and llvm::PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander().
MachineBasicBlock::succ_iterator MachineBasicBlock::removeSuccessor | ( | succ_iterator | I, |
bool | NormalizeSuccProbs = false |
||
) |
Remove specified successor from the successors list of this MachineBasicBlock.
The Predecessors list of Succ is automatically updated. If NormalizeSuccProbs is true, then normalize successors' probabilities after the successor is removed. Return the iterator to the element after the one removed.
Definition at line 835 of file MachineBasicBlock.cpp.
References assert(), I, and normalizeSuccProbs().
|
inline |
Definition at line 335 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(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), llvm::PPCRegisterInfo::lowerCRBitSpilling(), mergeOperations(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::RISCVInstrInfo::optimizeCondBranch(), performCopyPropagation(), llvm::MipsInstrInfo::removeBranch(), validThroughout(), and verifySameBranchInstructions().
|
inline |
Definition at line 336 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 1479 of file MachineBasicBlock.cpp.
References llvm::MachineOperand::getMBB(), MI, phis(), and llvm::MachineOperand::setMBB().
Referenced by llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PeelSingleBlockLoop(), SplitCriticalEdge(), and transferSuccessorsAndUpdatePHIs().
void MachineBasicBlock::replaceSuccessor | ( | MachineBasicBlock * | Old, |
MachineBasicBlock * | New | ||
) |
Replace successor OLD with NEW and update probability info.
Definition at line 851 of file MachineBasicBlock.cpp.
References assert(), E, I, removeSuccessor(), succ_begin(), and succ_end().
Referenced by llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), ReplaceUsesOfBlockWith(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), and splitEdge().
void MachineBasicBlock::ReplaceUsesOfBlockWith | ( | MachineBasicBlock * | Old, |
MachineBasicBlock * | New | ||
) |
Given a machine basic block that branched to 'Old', change the code and CFG so that it branches to 'New' instead.
Definition at line 1458 of file MachineBasicBlock.cpp.
References assert(), I, instr_begin(), instr_end(), and replaceSuccessor().
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::PeelSingleBlockLoop(), and SplitCriticalEdge().
DebugLoc MachineBasicBlock::rfindDebugLoc | ( | reverse_instr_iterator | MBBI | ) |
Has exact same behavior as findDebugLoc (it also searches towards the end of this MBB) except that this function takes a reverse iterator to identify the starting MI.
Definition at line 1500 of file MachineBasicBlock.cpp.
References findDebugLoc(), instr_begin(), instr_rbegin(), instr_rend(), MBBI, and llvm::skipDebugInstructionsBackward().
Referenced by llvm::M68kInstrInfo::AnalyzeBranchImpl(), and rfindDebugLoc().
|
inline |
Definition at line 1104 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 1522 of file MachineBasicBlock.cpp.
References instr_rend(), MBBI, and llvm::next_nodbg().
Referenced by rfindPrevDebugLoc().
|
inline |
Definition at line 1121 of file MachineBasicBlock.h.
References MBBI, and rfindPrevDebugLoc().
|
inline |
Returns true if this and MBB belong to the same section.
Definition at line 693 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 271 of file MachineBasicBlock.h.
Referenced by llvm::IRTranslator::runOnMachineFunction(), and llvm::FunctionLoweringInfo::set().
|
inline |
Set alignment of the basic block.
Definition at line 579 of file MachineBasicBlock.h.
References A.
Referenced by AlignBlocks(), and setAlignment().
Definition at line 581 of file MachineBasicBlock.h.
References A, setAlignment(), and setMaxBytesForAlignment().
|
inline |
Sets the fixed BBID of this basic block.
Definition at line 655 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 1175 of file MachineBasicBlock.h.
References N.
Referenced by llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), and SplitCriticalEdge().
|
inline |
Definition at line 1187 of file MachineBasicBlock.h.
Definition at line 639 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::assignBeginEndSections().
Indicates if this is the entry block of a cleanup funclet.
Definition at line 631 of file MachineBasicBlock.h.
Indicates if this is a target block of a catchret.
Definition at line 619 of file MachineBasicBlock.h.
Indicates if this is the entry block of an EH funclet.
Definition at line 625 of file MachineBasicBlock.h.
Indicates the block is a landing pad.
That is this basic block is entered via an exception handler.
Definition at line 600 of file MachineBasicBlock.h.
Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock(), and llvm::FunctionLoweringInfo::set().
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 613 of file MachineBasicBlock.h.
Definition at line 641 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::assignBeginEndSections().
Indicates if this is the indirect dest of an INLINEASM_BR.
Definition at line 677 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 278 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 267 of file MachineBasicBlock.h.
Referenced by llvm::VETargetLowering::emitEHSjLjSetJmp().
|
inline |
Set the maximum amount of padding allowed for aligning the basic block.
Definition at line 590 of file MachineBasicBlock.h.
Referenced by setAlignment().
|
inline |
Definition at line 1170 of file MachineBasicBlock.h.
Referenced by llvm::MachineFunction::RenumberBlocks().
|
inline |
Sets the section ID for this basic block.
Definition at line 661 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 1574 of file MachineBasicBlock.cpp.
References assert(), I, and llvm::BranchProbability::isUnknown().
Referenced by llvm::MIRProfileLoader::setBranchProbs(), and splitMBB().
|
inline |
Definition at line 295 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::RISCVFrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitPrologue(), llvm::LoongArchFrameLowering::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 1747 of file MachineBasicBlock.cpp.
References begin(), E, 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(), E, end(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), I, and TII.
Referenced by addLiveIn(), copyDebugInfoToSuccessor(), and llvm::findPHICopyInsertPoint().
MachineBasicBlock::iterator MachineBasicBlock::SkipPHIsLabelsAndDebug | ( | MachineBasicBlock::iterator | I, |
Register | Reg = Register() , |
||
bool | SkipPseudoOp = true |
||
) |
Return the first instruction in MBB after I that is not a PHI, label or debug.
This is the correct point to insert copies at the beginning of a basic block. Reg
is the register being used by a spill or defined for a restore/split during register allocation.
Definition at line 225 of file MachineBasicBlock.cpp.
References assert(), E, end(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), I, and TII.
Referenced by findInsertLocation(), and llvm::SplitEditor::leaveIntvAtTop().
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 616 of file MachineBasicBlock.cpp.
References I, llvm::MachineBasicBlock::RegisterMaskPair::PhysReg, and llvm::sort().
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::SIFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::emitCSRSpillStores(), llvm::SIFrameLowering::processFunctionBeforeFrameFinalized(), llvm::IRTranslator::runOnMachineFunction(), 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 1061 of file MachineBasicBlock.h.
References From, llvm::Other, and splice().
Referenced by llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitReadCycleWidePseudo(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), emitVecCondBranchPseudo(), emitXBegin(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), hoistAndMergeSGPRInits(), llvm::PPCFrameLowering::inlineStackProbe(), loadMBUFScalarOperandsFromVGPR(), LowerFPToInt(), llvm::MachineInstr::moveBefore(), llvm::ScheduleDAGMI::moveInstruction(), MoveVPNOTBeforeFirstUser(), performSink(), llvm::ScheduleDAGMI::placeDebugValues(), llvm::AArch64InstrInfo::probedStackAlloc(), rescheduleCanonically(), rescheduleLexographically(), llvm::AArch64FrameLowering::restoreCalleeSavedRegisters(), llvm::IRTranslator::runOnMachineFunction(), llvm::WebAssemblyDebugValueManager::sink(), splice(), split(), 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 1072 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 1017 of file MachineBasicBlock.cpp.
References llvm::addLiveIns(), llvm::LivePhysRegs::addLiveOuts(), addSuccessor(), begin(), llvm::MachineFunction::CreateMachineBasicBlock(), E, end(), getBasicBlock(), getParent(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse(), llvm::MachineFunction::getSubtarget(), I, llvm::LivePhysRegs::init(), llvm::MachineFunction::insert(), llvm::LiveIntervals::insertMBBInMaps(), MI, rbegin(), splice(), llvm::LivePhysRegs::stepBackward(), and transferSuccessorsAndUpdatePHIs().
Referenced by llvm::AArch64PAuth::checkAuthenticatedRegister(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), splitBlock(), and llvm::SITargetLowering::splitKillBlock().
MachineBasicBlock * MachineBasicBlock::SplitCriticalEdge | ( | MachineBasicBlock * | Succ, |
Pass & | P, | ||
std::vector< SparseBitVector<> > * | LiveInSets = nullptr |
||
) |
Split the critical edge from this block to the given successor block, and return the newly created block, or null if splitting is not possible.
This function updates LiveVariables, MachineDominatorTree, and MachineLoopInfo, as applicable.
Definition at line 1132 of file MachineBasicBlock.cpp.
References addLiveIn(), llvm::LiveVariables::addNewBlock(), llvm::LiveRange::addSegment(), addSuccessor(), assert(), canSplitCriticalEdge(), Cond, llvm::SmallSet< T, N, C >::count(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::dbgs(), DL, E, end(), llvm::MachineFunction::end(), findJumpTableIndex(), getCallFrameSize(), getFirstInstrTerminator(), getFirstTerminator(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::LiveIntervals::getInterval(), llvm::MachineFunction::getJumpTableInfo(), llvm::LiveIntervals::getMBBStartIdx(), llvm::ilist_node_with_parent< MachineBasicBlock, MachineFunction >::getNextNode(), getParent(), llvm::SlotIndex::getPrevSlot(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::LiveVariables::getVarInfo(), llvm::LiveRange::getVNInfoAt(), llvm::LiveIntervals::hasInterval(), I, llvm::Register::index2VirtReg(), llvm::SmallSet< T, N, C >::insert(), llvm::MachineFunction::insert(), llvm::HexagonInstrInfo::insertBranch(), llvm::LiveIntervals::insertMBBInMaps(), instr_begin(), instr_end(), llvm::is_contained(), isLayoutSuccessor(), isLiveOut(), llvm::MachineOperand::isUndef(), llvm::LiveVariables::VarInfo::Kills, llvm::LiveRange::liveAt(), liveins(), LLVM_DEBUG, llvm::make_range(), MI, MRI, P, llvm::printMBBReference(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::LiveVariables::VarInfo::removeKill(), llvm::LiveRange::removeSegment(), llvm::LiveIntervals::repairIntervalsInRange(), llvm::MachineJumpTableInfo::ReplaceMBBInJumpTable(), replacePhiUsesWith(), ReplaceUsesOfBlockWith(), setCallFrameSize(), llvm::LiveInterval::subranges(), TII, TRI, and updateTerminator().
void MachineBasicBlock::splitSuccessor | ( | MachineBasicBlock * | Old, |
MachineBasicBlock * | New, | ||
bool | NormalizeSuccProbs = false |
||
) |
Split the old successor into old plus new and updates the probability info.
Definition at line 809 of file MachineBasicBlock.cpp.
References addSuccessor(), assert(), llvm::find(), llvm::BranchProbability::getUnknown(), llvm::is_contained(), normalizeSuccProbs(), succ_end(), and successors().
Referenced by llvm::AArch64PAuth::checkAuthenticatedRegister(), and splitEdge().
|
inline |
Definition at line 389 of file MachineBasicBlock.h.
Referenced by bbHasFallthrough(), BBIsJumpedOver(), bbIsJumpedOver(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::BlkSucc_begin(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), eraseDeadBBsAndChildren(), fixMBBTerminator(), getLayoutSuccessorProbThreshold(), markAllReachable(), llvm::MIPrinter::print(), print(), processSwitches(), removeExternalCFGEdges(), removeExternalCFGSuccessors(), replaceSuccessor(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::IRTranslator::runOnMachineFunction(), llvm::MIRProfileLoader::setBranchProbs(), splitMBB(), successors(), llvm::TailDuplicator::tailDuplicateAndUpdate(), transferSuccessors(), and transferSuccessorsAndUpdatePHIs().
|
inline |
Definition at line 390 of file MachineBasicBlock.h.
|
inline |
Definition at line 404 of file MachineBasicBlock.h.
Referenced by blockEndsInUnreachable(), llvm::RISCVFrameLowering::canUseAsEpilogue(), llvm::X86FrameLowering::canUseAsEpilogue(), llvm::ScheduleDAGSDNodes::computeOperandLatency(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), getEndClobberMask(), llvm::SIInstrInfo::insertReturn(), isNoReturnDef(), llvm::SystemZInstrInfo::isProfitableToIfCvt(), llvm::AMDGPULegalizerInfo::legalizeTrapEndpgm(), popRegsFromStack(), llvm::MIPrinter::print(), print(), processSwitches(), ProfitableToMerge(), llvm::TargetInstrInfo::ReplaceTailWithBranchTo(), llvm::SelectionDAGISel::runOnMachineFunction(), GCEmptyBasicBlocks::runOnMachineFunction(), transferSuccessors(), transferSuccessorsAndUpdatePHIs(), and updateTerminator().
|
inline |
Definition at line 391 of file MachineBasicBlock.h.
Referenced by bbHasFallthrough(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::BlkSucc_end(), eraseDeadBBsAndChildren(), markAllReachable(), llvm::MIPrinter::print(), print(), removeExternalCFGSuccessors(), replaceSuccessor(), GCEmptyBasicBlocks::runOnMachineFunction(), llvm::MIRProfileLoader::setBranchProbs(), splitSuccessor(), successors(), and llvm::TailDuplicator::tailDuplicateAndUpdate().
|
inline |
Definition at line 392 of file MachineBasicBlock.h.
|
inline |
Definition at line 393 of file MachineBasicBlock.h.
Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock(), and splitMBB().
|
inline |
Definition at line 395 of file MachineBasicBlock.h.
|
inline |
Definition at line 397 of file MachineBasicBlock.h.
Referenced by llvm::VETargetLowering::emitSjLjDispatchBlock().
|
inline |
Definition at line 399 of file MachineBasicBlock.h.
|
inline |
Definition at line 401 of file MachineBasicBlock.h.
Referenced by BBIsJumpedOver(), bbIsJumpedOver(), llvm::TailDuplicator::canTailDuplicate(), llvm::RISCVFrameLowering::canUseAsEpilogue(), fixMBBTerminator(), getLayoutSuccessorProbThreshold(), llvm::RegionTraits< MachineFunction >::getNumSuccessors(), getSuccProbability(), hasSameSuccessors(), INITIALIZE_PASS(), llvm::TailDuplicator::isSimpleBB(), isSplitEdge(), llvm::rdf::operator<<(), ProfitableToMerge(), removeExternalCFGEdges(), salvageDebugInfoFromEmptyBlock(), llvm::MIRProfileLoader::setBranchProbs(), splitMBB(), and llvm::succ_size().
|
inline |
Definition at line 412 of file MachineBasicBlock.h.
References llvm::make_range(), succ_begin(), and succ_end().
Referenced by llvm::LiveRegUnits::addLiveOuts(), llvm::LivePhysRegs::addLiveOutsNoPristines(), llvm::ScheduleDAGInstrs::addSchedBarrierDeps(), llvm::X86InstrInfo::analyzeBranchPredicate(), areCFlagsAliveInSuccessors(), BBHasFallthrough(), blockEndIsUnreachable(), CanLowerPriorityDirectlyInPredecessors(), checkAndUpdateCCRKill(), checkAndUpdateCPSRKill(), checkCCKill(), checkEFLAGSLive(), collectEHScopeMembers(), computeRegisterLiveness(), eraseDeadBBsAndChildren(), findFalseBlock(), llvm::MachineLoopInfo::findLoopPreheader(), fixRegionTerminator(), flagsNeedToBePreservedBeforeTheTerminators(), getFallThroughMBB(), llvm::ReachingDefAnalysis::getGlobalUses(), getSingleLiveInSuccBB(), llvm::afdo_detail::IRTraits< MachineBasicBlock >::getSuccessors(), hasEHPadSuccessor(), hasSameSuccessors(), llvm::MachineTraceMetrics::Ensemble::invalidate(), isEFLAGSLiveAfter(), isLiveOut(), llvm::LiveVariables::isLiveOut(), isReachableAmongDominated(), llvm::HexagonInstrInfo::isSchedulingBoundary(), isSuccessor(), loadMBUFScalarOperandsFromVGPR(), mayHaveInlineAsmBr(), mbbHasBackEdge(), llvm::rdf::operator<<(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), OtherSucc(), llvm::LiveIntervals::pruneValue(), removeExternalCFGEdges(), llvm::CFIFixup::runOnMachineFunction(), salvageDebugInfoFromEmptyBlock(), llvm::MIRProfileLoader::setBranchProbs(), llvm::TailDuplicator::shouldTailDuplicate(), shouldUseFrameHelper(), sortBlocks(), splitBlock(), splitMBB(), splitSuccessor(), llvm::AggressiveAntiDepBreaker::StartBlock(), llvm::CriticalAntiDepBreaker::StartBlock(), llvm::successors(), llvm::LoopTraversal::traverse(), updateLiveness(), ValidateMVEStore(), and llvm::WriteGraph().
|
inline |
Definition at line 415 of file MachineBasicBlock.h.
References llvm::make_range(), succ_begin(), and succ_end().
|
inline |
Definition at line 345 of file MachineBasicBlock.h.
References end(), getFirstTerminator(), and llvm::make_range().
Referenced by AlignBlocks(), llvm::WebAssemblyInstrInfo::analyzeBranch(), explicitlyBranchesTo(), findLoopComponents(), llvm::ARMBlockPlacement::fixBackwardsWLS(), fixMBBTerminator(), fixRegionTerminator(), flagsNeedToBePreservedBeforeTheTerminators(), llvm::SIInstrInfo::hasDivergentBranch(), hasReturn(), INITIALIZE_PASS(), llvm::AsmPrinter::isBlockOnlyReachableByFallthrough(), maybeUpdateTerminator(), llvm::SIInstrInfo::removeBranch(), and RevertWhileLoopSetup().
|
inline |
Definition at line 348 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 909 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 929 of file MachineBasicBlock.cpp.
References addSuccessor(), addSuccessorWithoutProb(), normalizeSuccProbs(), removeSuccessor(), replacePhiUsesWith(), succ_begin(), and succ_empty().
Referenced by llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::VETargetLowering::emitEHSjLjSetJmp(), llvm::AArch64TargetLowering::EmitF128CSEL(), emitFROUND(), llvm::BPFTargetLowering::EmitInstrWithCustomInserter(), llvm::MSP430TargetLowering::EmitInstrWithCustomInserter(), llvm::ARMTargetLowering::EmitInstrWithCustomInserter(), llvm::AVRTargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::XCoreTargetLowering::EmitInstrWithCustomInserter(), EmitLoweredCascadedSelect(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::PPCTargetLowering::emitProbedAlloca(), emitReadCycleWidePseudo(), emitSelectPseudo(), llvm::MSP430TargetLowering::EmitShiftInstr(), emitVecCondBranchPseudo(), emitXBegin(), llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(), llvm::VEInstrInfo::expandExtendStackPseudo(), llvm::SparcTargetLowering::expandSelectCC(), llvm::PPCFrameLowering::inlineStackProbe(), loadMBUFScalarOperandsFromVGPR(), LowerFPToInt(), llvm::AArch64InstrInfo::probedStackAlloc(), split(), splitAt(), llvm::SystemZ::splitBlockAfter(), llvm::SystemZ::splitBlockBefore(), and splitBlockForLoop().
void MachineBasicBlock::updateTerminator | ( | MachineBasicBlock * | PreviousLayoutSuccessor | ) |
Update the terminator instructions in block to account for changes to block layout which may have been made.
PreviousLayoutSuccessor should be set to the block which may have been used as fallthrough before the block layout was modified. If the block previously fell through to that block, it may now need a branch. If it previously branched to another block, it may now be able to fallthrough to the current layout successor.
Definition at line 685 of file MachineBasicBlock.cpp.
References llvm::HexagonInstrInfo::analyzeBranch(), assert(), B, Cond, llvm::dbgs(), DL, findBranchDebugLoc(), llvm::TargetSubtargetInfo::getInstrInfo(), getParent(), llvm::MachineFunction::getSubtarget(), llvm::HexagonInstrInfo::insertBranch(), isEHPad(), isLayoutSuccessor(), isSuccessor(), LLVM_DEBUG, llvm::printMBBReference(), llvm::HexagonInstrInfo::removeBranch(), llvm::HexagonInstrInfo::reverseBranchCondition(), succ_empty(), TBB, and TII.
Referenced by maybeUpdateTerminator(), llvm::PeelSingleBlockLoop(), SplitCriticalEdge(), and updateBranches().
void MachineBasicBlock::validateSuccProbs | ( | ) | const |
Validate successors' probabilities and check if the sum of them is approximate one.
This only works in DEBUG mode.
Definition at line 776 of file MachineBasicBlock.cpp.
References assert(), and llvm::BranchProbability::getDenominator().
|
friend |
Definition at line 1203 of file MachineBasicBlock.h.
|
friend |
Definition at line 1202 of file MachineBasicBlock.h.
|
friend |
Definition at line 223 of file MachineBasicBlock.h.
|
friend |
Definition at line 1203 of file MachineBasicBlock.h.