class MachineBasicBlock

Declaration

class MachineBasicBlock : public ilist_node_with_parent { /* full declaration omitted */ };

Description

An ilist node that can access its parent list. Requires \c NodeTy to have \a getParent() to find the parent node, and the\c ParentTy to have \a getSublistAccess() to get a reference to the list.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:94

Inherits from: ilist_node_with_parent

Member Variables

private const llvm::BasicBlock* BB
private int Number
private llvm::MachineFunction* xParent
private llvm::MachineBasicBlock::Instructions Insts
private std::vector<MachineBasicBlock*> Predecessors
Keep track of the predecessor / successor basic blocks.
private std::vector<MachineBasicBlock*> Successors
private std::vector<BranchProbability> Probs
Keep track of the probabilities to the successors. This vector has the same order as Successors, or it is empty if we don't use it (disable optimization).
private Optional<uint64_t> IrrLoopHeaderWeight
private llvm::MachineBasicBlock::LiveInVector LiveIns
private llvm::Align Alignment
Alignment of the basic block. One if the basic block does not need to be aligned.
private unsigned int MaxBytesForAlignment = 0
Maximum amount of bytes that can be added to align the basic block. If the alignment cannot be reached in this many bytes, no bytes are emitted. Zero to represent no maximum.
private bool IsEHPad = false
Indicate that this basic block is entered via an exception handler.
private bool AddressTaken = false
Indicate that this basic block is potentially the target of an indirect branch.
private bool LabelMustBeEmitted = false
Indicate that this basic block needs its symbol be emitted regardless of whether the flow just falls-through to it.
private bool IsEHScopeEntry = false
Indicate that this basic block 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.
private bool IsEHCatchretTarget = false
Indicates if this is a target block of a catchret.
private bool IsEHFuncletEntry = false
Indicate that this basic block is the entry block of an EH funclet.
private bool IsCleanupFuncletEntry = false
Indicate that this basic block is the entry block of a cleanup funclet.
private llvm::MBBSectionID SectionID = {0}
With basic block sections, this stores the Section ID of the basic block.
private bool IsBeginSection = false
private bool IsEndSection = false
private bool IsInlineAsmBrIndirectTarget = false
Indicate that this basic block is the indirect dest of an INLINEASM_BR.
private llvm::MCSymbol* CachedMCSymbol = nullptr
since getSymbol is a relatively heavy-weight operation, the symbol is only computed once and is cached.
private llvm::MCSymbol* CachedEHCatchretMCSymbol = nullptr
Cached MCSymbol for this block (used if IsEHCatchRetTarget).
private llvm::MCSymbol* CachedEndMCSymbol = nullptr
Marks the end of the basic block. Used during basic block sections to calculate the size of the basic block, or the BB section ending with it.

Method Overview

  • private MachineBasicBlock(llvm::MachineFunction & MF, const llvm::BasicBlock * BB)
  • private MachineBasicBlock()
  • public void ReplaceUsesOfBlockWith(llvm::MachineBasicBlock * Old, llvm::MachineBasicBlock * New)
  • public llvm::MachineBasicBlock::iterator SkipPHIsAndLabels(llvm::MachineBasicBlock::iterator I)
  • public llvm::MachineBasicBlock::iterator SkipPHIsLabelsAndDebug(llvm::MachineBasicBlock::iterator I, bool SkipPseudoOp = true)
  • public llvm::MachineBasicBlock * SplitCriticalEdge(llvm::MachineBasicBlock * Succ, llvm::Pass & P, std::vector<SparseBitVector<>> * LiveInSets = nullptr)
  • public llvm::Register addLiveIn(llvm::MCRegister PhysReg, const llvm::TargetRegisterClass * RC)
  • public void addLiveIn(const llvm::MachineBasicBlock::RegisterMaskPair & RegMaskPair)
  • public void addLiveIn(llvm::MCRegister PhysReg, llvm::LaneBitmask LaneMask = LaneBitmask::getAll())
  • private void addPredecessor(llvm::MachineBasicBlock * Pred)
  • public void addSuccessor(llvm::MachineBasicBlock * Succ, llvm::BranchProbability Prob = BranchProbability::getUnknown())
  • public void addSuccessorWithoutProb(llvm::MachineBasicBlock * Succ)
  • public llvm::MachineInstr & back()
  • public const llvm::MachineInstr & back() const
  • public llvm::MachineBasicBlock::const_iterator begin() const
  • public llvm::MachineBasicBlock::iterator begin()
  • public bool canFallThrough()
  • public bool canSplitCriticalEdge(const llvm::MachineBasicBlock * Succ) const
  • public void clear()
  • public void clearBasicBlock()
  • public void clearLiveIns()
  • public llvm::MachineBasicBlock::LivenessQueryResult computeRegisterLiveness(const llvm::TargetRegisterInfo * TRI, llvm::MCRegister Reg, llvm::MachineBasicBlock::const_iterator Before, unsigned int Neighborhood = 10) const
  • public void copySuccessor(llvm::MachineBasicBlock * Orig, llvm::MachineBasicBlock::succ_iterator I)
  • public void dump() const
  • public bool empty() const
  • public llvm::MachineBasicBlock::const_iterator end() const
  • public llvm::MachineBasicBlock::iterator end()
  • public llvm::MachineBasicBlock::iterator erase(llvm::MachineInstr * I)
  • public llvm::MachineBasicBlock::iterator erase(llvm::MachineBasicBlock::iterator I, llvm::MachineBasicBlock::iterator E)
  • public llvm::MachineBasicBlock::instr_iterator erase(llvm::MachineBasicBlock::instr_iterator I)
  • public llvm::MachineBasicBlock::iterator erase(llvm::MachineBasicBlock::iterator I)
  • public void eraseFromParent()
  • public llvm::MachineBasicBlock::instr_iterator erase_instr(llvm::MachineInstr * I)
  • public llvm::DebugLoc findBranchDebugLoc()
  • public llvm::DebugLoc findDebugLoc(llvm::MachineBasicBlock::iterator MBBI)
  • public llvm::DebugLoc findDebugLoc(llvm::MachineBasicBlock::instr_iterator MBBI)
  • public llvm::DebugLoc findPrevDebugLoc(llvm::MachineBasicBlock::instr_iterator MBBI)
  • public llvm::DebugLoc findPrevDebugLoc(llvm::MachineBasicBlock::iterator MBBI)
  • public const llvm::MachineInstr & front() const
  • public llvm::MachineInstr & front()
  • public llvm::Align getAlignment() const
  • public const llvm::BasicBlock * getBasicBlock() const
  • public const uint32_t * getBeginClobberMask(const llvm::TargetRegisterInfo * TRI) const
  • public llvm::MCSymbol * getEHCatchretSymbol() const
  • public const uint32_t * getEndClobberMask(const llvm::TargetRegisterInfo * TRI) const
  • public llvm::MCSymbol * getEndSymbol() const
  • public llvm::MachineBasicBlock * getFallThrough()
  • public llvm::MachineBasicBlock::instr_iterator getFirstInstrTerminator()
  • public llvm::MachineBasicBlock::iterator getFirstNonDebugInstr(bool SkipPseudoOp = true)
  • public llvm::MachineBasicBlock::const_iterator getFirstNonDebugInstr(bool SkipPseudoOp = true) const
  • public llvm::MachineBasicBlock::iterator getFirstNonPHI()
  • public llvm::MachineBasicBlock::const_iterator getFirstTerminator() const
  • public llvm::MachineBasicBlock::iterator getFirstTerminator()
  • public std::string getFullName() const
  • public Optional<uint64_t> getIrrLoopHeaderWeight() const
  • public llvm::MachineBasicBlock::iterator getLastNonDebugInstr(bool SkipPseudoOp = true)
  • public llvm::MachineBasicBlock::const_iterator getLastNonDebugInstr(bool SkipPseudoOp = true) const
  • public unsigned int getMaxBytesForAlignment() const
  • public llvm::StringRef getName() const
  • public int getNumber() const
  • public const llvm::MachineFunction * getParent() const
  • public llvm::MachineFunction * getParent()
  • private llvm::MachineBasicBlock::const_probability_iterator getProbabilityIterator(llvm::MachineBasicBlock::const_succ_iterator I) const
  • private llvm::MachineBasicBlock::probability_iterator getProbabilityIterator(llvm::MachineBasicBlock::succ_iterator I)
  • public llvm::MBBSectionID getSectionID() const
  • public unsigned int getSectionIDNum() const
  • public llvm::MachineBasicBlock * getSingleSuccessor()
  • public const llvm::MachineBasicBlock * getSingleSuccessor() const
  • public static llvm::MachineBasicBlock::Instructions llvm::MachineBasicBlock::* getSublistAccess(llvm::MachineInstr *)
  • public llvm::BranchProbability getSuccProbability(llvm::MachineBasicBlock::const_succ_iterator Succ) const
  • public llvm::MCSymbol * getSymbol() const
  • public bool hasAddressTaken() const
  • public bool hasEHPadSuccessor() const
  • public bool hasLabelMustBeEmitted() const
  • public bool hasSuccessorProbabilities() const
  • public template <typename IT>void insert(llvm::MachineBasicBlock::iterator I, IT S, IT E)
  • public llvm::MachineBasicBlock::instr_iterator insert(llvm::MachineBasicBlock::instr_iterator I, llvm::MachineInstr * M)
  • public llvm::MachineBasicBlock::iterator insert(llvm::MachineBasicBlock::iterator I, llvm::MachineInstr * MI)
  • public llvm::MachineBasicBlock::iterator insertAfter(llvm::MachineBasicBlock::iterator I, llvm::MachineInstr * MI)
  • public llvm::MachineBasicBlock::instr_iterator insertAfterBundle(llvm::MachineBasicBlock::instr_iterator I, llvm::MachineInstr * MI)
  • public const llvm::MachineInstr & instr_back() const
  • public llvm::MachineInstr & instr_back()
  • public llvm::MachineBasicBlock::const_instr_iterator instr_begin() const
  • public llvm::MachineBasicBlock::instr_iterator instr_begin()
  • public llvm::MachineBasicBlock::instr_iterator instr_end()
  • public llvm::MachineBasicBlock::const_instr_iterator instr_end() const
  • public const llvm::MachineInstr & instr_front() const
  • public llvm::MachineInstr & instr_front()
  • public llvm::MachineBasicBlock::reverse_instr_iterator instr_rbegin()
  • public llvm::MachineBasicBlock::const_reverse_instr_iterator instr_rbegin() const
  • public llvm::MachineBasicBlock::reverse_instr_iterator instr_rend()
  • public llvm::MachineBasicBlock::const_reverse_instr_iterator instr_rend() const
  • public llvm::MachineBasicBlock::instr_range instrs()
  • public llvm::MachineBasicBlock::const_instr_range instrs() const
  • public bool isBeginSection() const
  • public bool isCleanupFuncletEntry() const
  • public bool isEHCatchretTarget() const
  • public bool isEHFuncletEntry() const
  • public bool isEHPad() const
  • public bool isEHScopeEntry() const
  • public bool isEHScopeReturnBlock() const
  • public bool isEndSection() const
  • public bool isEntryBlock() const
  • public bool isInlineAsmBrIndirectTarget() const
  • public bool isLayoutSuccessor(const llvm::MachineBasicBlock * MBB) const
  • public bool isLegalToHoistInto() const
  • public bool isLiveIn(llvm::MCPhysReg Reg, llvm::LaneBitmask LaneMask = LaneBitmask::getAll()) const
  • public bool isPredecessor(const llvm::MachineBasicBlock * MBB) const
  • public bool isReturnBlock() const
  • public bool isSuccessor(const llvm::MachineBasicBlock * MBB) const
  • public llvm::MachineBasicBlock::livein_iterator livein_begin() const
  • public llvm::MachineBasicBlock::livein_iterator livein_begin_dbg() const
  • public bool livein_empty() const
  • public llvm::MachineBasicBlock::livein_iterator livein_end() const
  • public iterator_range<llvm::MachineBasicBlock::livein_iterator> liveins() const
  • public iterator_range<llvm::MachineBasicBlock::livein_iterator> liveins_dbg() const
  • public llvm::MachineBasicBlock::liveout_iterator liveout_begin() const
  • public llvm::MachineBasicBlock::liveout_iterator liveout_end() const
  • public iterator_range<llvm::MachineBasicBlock::liveout_iterator> liveouts() const
  • public bool mayHaveInlineAsmBr() const
  • public void moveAfter(llvm::MachineBasicBlock * NewBefore)
  • public void moveBefore(llvm::MachineBasicBlock * NewAfter)
  • public void normalizeSuccProbs()
  • public inline iterator_range<llvm::MachineBasicBlock::const_iterator> phis() const
  • public inline iterator_range<llvm::MachineBasicBlock::iterator> phis()
  • public void pop_back()
  • public void pop_front()
  • public llvm::MachineBasicBlock::pred_iterator pred_begin()
  • public llvm::MachineBasicBlock::const_pred_iterator pred_begin() const
  • public bool pred_empty() const
  • public llvm::MachineBasicBlock::pred_iterator pred_end()
  • public llvm::MachineBasicBlock::const_pred_iterator pred_end() const
  • public llvm::MachineBasicBlock::pred_reverse_iterator pred_rbegin()
  • public llvm::MachineBasicBlock::const_pred_reverse_iterator pred_rbegin() const
  • public llvm::MachineBasicBlock::pred_reverse_iterator pred_rend()
  • public llvm::MachineBasicBlock::const_pred_reverse_iterator pred_rend() const
  • public unsigned int pred_size() const
  • public inline iterator_range<llvm::MachineBasicBlock::pred_iterator> predecessors()
  • public inline iterator_range<llvm::MachineBasicBlock::const_pred_iterator> predecessors() const
  • public void print(llvm::raw_ostream & OS, const llvm::SlotIndexes * = nullptr, bool IsStandalone = true) const
  • public void print(llvm::raw_ostream & OS, llvm::ModuleSlotTracker & MST, const llvm::SlotIndexes * = nullptr, bool IsStandalone = true) const
  • public void printAsOperand(llvm::raw_ostream & OS, bool PrintType = true) const
  • public void printName(llvm::raw_ostream & os, unsigned int printNameFlags = PrintNameIr, llvm::ModuleSlotTracker * moduleSlotTracker = nullptr) const
  • public void push_back(llvm::MachineInstr * MI)
  • public llvm::MachineBasicBlock::reverse_iterator rbegin()
  • public llvm::MachineBasicBlock::const_reverse_iterator rbegin() const
  • public llvm::MachineInstr * remove(llvm::MachineInstr * I)
  • public llvm::MachineBasicBlock * removeFromParent()
  • public void removeLiveIn(llvm::MCPhysReg Reg, llvm::LaneBitmask LaneMask = LaneBitmask::getAll())
  • public llvm::MachineBasicBlock::livein_iterator removeLiveIn(llvm::MachineBasicBlock::livein_iterator I)
  • private void removePredecessor(llvm::MachineBasicBlock * Pred)
  • public void removeSuccessor(llvm::MachineBasicBlock * Succ, bool NormalizeSuccProbs = false)
  • public llvm::MachineBasicBlock::succ_iterator removeSuccessor(llvm::MachineBasicBlock::succ_iterator I, bool NormalizeSuccProbs = false)
  • public llvm::MachineInstr * remove_instr(llvm::MachineInstr * I)
  • public llvm::MachineBasicBlock::reverse_iterator rend()
  • public llvm::MachineBasicBlock::const_reverse_iterator rend() const
  • public void replacePhiUsesWith(llvm::MachineBasicBlock * Old, llvm::MachineBasicBlock * New)
  • public void replaceSuccessor(llvm::MachineBasicBlock * Old, llvm::MachineBasicBlock * New)
  • public llvm::DebugLoc rfindDebugLoc(llvm::MachineBasicBlock::reverse_iterator MBBI)
  • public llvm::DebugLoc rfindDebugLoc(llvm::MachineBasicBlock::reverse_instr_iterator MBBI)
  • public llvm::DebugLoc rfindPrevDebugLoc(llvm::MachineBasicBlock::reverse_instr_iterator MBBI)
  • public llvm::DebugLoc rfindPrevDebugLoc(llvm::MachineBasicBlock::reverse_iterator MBBI)
  • public bool sameSection(const llvm::MachineBasicBlock * MBB) const
  • public void setAlignment(llvm::Align A, unsigned int MaxBytes)
  • public void setAlignment(llvm::Align A)
  • public void setHasAddressTaken()
  • public void setIrrLoopHeaderWeight(uint64_t Weight)
  • public void setIsBeginSection(bool V = true)
  • public void setIsCleanupFuncletEntry(bool V = true)
  • public void setIsEHCatchretTarget(bool V = true)
  • public void setIsEHFuncletEntry(bool V = true)
  • public void setIsEHPad(bool V = true)
  • public void setIsEHScopeEntry(bool V = true)
  • public void setIsEndSection(bool V = true)
  • public void setIsInlineAsmBrIndirectTarget(bool V = true)
  • public void setLabelMustBeEmitted()
  • public void setMaxBytesForAlignment(unsigned int MaxBytes)
  • public void setNumber(int N)
  • public void setSectionID(llvm::MBBSectionID V)
  • public void setSuccProbability(llvm::MachineBasicBlock::succ_iterator I, llvm::BranchProbability Prob)
  • public unsigned int size() const
  • public bool sizeWithoutDebugLargerThan(unsigned int Limit) const
  • public void sortUniqueLiveIns()
  • public void splice(llvm::MachineBasicBlock::iterator Where, llvm::MachineBasicBlock * Other, llvm::MachineBasicBlock::iterator From, llvm::MachineBasicBlock::iterator To)
  • public void splice(llvm::MachineBasicBlock::iterator Where, llvm::MachineBasicBlock * Other, llvm::MachineBasicBlock::iterator From)
  • public llvm::MachineBasicBlock * splitAt(llvm::MachineInstr & SplitInst, bool UpdateLiveIns = true, llvm::LiveIntervals * LIS = nullptr)
  • public void splitSuccessor(llvm::MachineBasicBlock * Old, llvm::MachineBasicBlock * New, bool NormalizeSuccProbs = false)
  • public llvm::MachineBasicBlock::const_succ_iterator succ_begin() const
  • public llvm::MachineBasicBlock::succ_iterator succ_begin()
  • public bool succ_empty() const
  • public llvm::MachineBasicBlock::succ_iterator succ_end()
  • public llvm::MachineBasicBlock::const_succ_iterator succ_end() const
  • public llvm::MachineBasicBlock::succ_reverse_iterator succ_rbegin()
  • public llvm::MachineBasicBlock::const_succ_reverse_iterator succ_rbegin() const
  • public llvm::MachineBasicBlock::succ_reverse_iterator succ_rend()
  • public llvm::MachineBasicBlock::const_succ_reverse_iterator succ_rend() const
  • public unsigned int succ_size() const
  • public inline iterator_range<llvm::MachineBasicBlock::const_succ_iterator> successors() const
  • public inline iterator_range<llvm::MachineBasicBlock::succ_iterator> successors()
  • public inline iterator_range<llvm::MachineBasicBlock::const_iterator> terminators() const
  • public inline iterator_range<llvm::MachineBasicBlock::iterator> terminators()
  • public void transferSuccessors(llvm::MachineBasicBlock * FromMBB)
  • public void transferSuccessorsAndUpdatePHIs(llvm::MachineBasicBlock * FromMBB)
  • public void updateTerminator(llvm::MachineBasicBlock * PreviousLayoutSuccessor)
  • public void validateSuccProbs() const
  • private ~MachineBasicBlock()

Methods

MachineBasicBlock(llvm::MachineFunction& MF,
                  const llvm::BasicBlock* BB)

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:194

Parameters

llvm::MachineFunction& MF
const llvm::BasicBlock* BB

MachineBasicBlock()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:192

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1008

Parameters

llvm::MachineBasicBlock* Old
llvm::MachineBasicBlock* New

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:773

Parameters

llvm::MachineBasicBlock::iterator I

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:778

Parameters

llvm::MachineBasicBlock::iterator I
bool SkipPseudoOp = true

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:864

Parameters

llvm::MachineBasicBlock* Succ
llvm::Pass& P
std::vector<SparseBitVector<>>* LiveInSets = nullptr

llvm::Register addLiveIn(
    llvm::MCRegister PhysReg,
    const llvm::TargetRegisterClass* RC)

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:396

Parameters

llvm::MCRegister PhysReg
const llvm::TargetRegisterClass* RC

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:381

Parameters

const llvm::MachineBasicBlock::RegisterMaskPair& RegMaskPair

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:377

Parameters

llvm::MCRegister PhysReg
llvm::LaneBitmask LaneMask = LaneBitmask::getAll()

void addPredecessor(llvm::MachineBasicBlock* Pred)

Description

Add Pred as a predecessor of this MachineBasicBlock. Don't do this unless you know what you're doing, because it doesn't update Pred's successors list. Use Pred->addSuccessor instead.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1127

Parameters

llvm::MachineBasicBlock* Pred

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:660

Parameters

llvm::MachineBasicBlock* Succ
llvm::BranchProbability Prob = BranchProbability::getUnknown()

void addSuccessorWithoutProb(
    llvm::MachineBasicBlock* Succ)

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:667

Parameters

llvm::MachineBasicBlock* Succ

llvm::MachineInstr& back()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:258

const llvm::MachineInstr& back() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:260

llvm::MachineBasicBlock::const_iterator begin()
    const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:279

llvm::MachineBasicBlock::iterator begin()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:278

bool canFallThrough()

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:761

bool canSplitCriticalEdge(
    const llvm::MachineBasicBlock* Succ) const

Description

Check if the edge between this block and the given successor \p 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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:871

Parameters

const llvm::MachineBasicBlock* Succ

void clear()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:974

void clearBasicBlock()

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:209

void clearLiveIns()

Description

Clear live in list.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:391

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

Description

Return whether (physical) register \p Reg has been defined and not killed as of just before \p Before. Search is localised to a neighborhood of \p Neighborhood instructions before (searching for defs or kills) and \p Neighborhood instructions after (searching just for defs) \p Before. \p Reg must be a physical register.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1063

Parameters

const llvm::TargetRegisterInfo* TRI
llvm::MCRegister Reg
llvm::MachineBasicBlock::const_iterator Before
unsigned int Neighborhood = 10

void copySuccessor(
    llvm::MachineBasicBlock* Orig,
    llvm::MachineBasicBlock::succ_iterator I)

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:708

Parameters

llvm::MachineBasicBlock* Orig
llvm::MachineBasicBlock::succ_iterator I

void dump() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1069

bool empty() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:250

llvm::MachineBasicBlock::const_iterator end()
    const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:281

llvm::MachineBasicBlock::iterator end()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:280

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:953

Parameters

llvm::MachineInstr* I

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:938

Parameters

llvm::MachineBasicBlock::iterator I
llvm::MachineBasicBlock::iterator E

llvm::MachineBasicBlock::instr_iterator erase(
    llvm::MachineBasicBlock::instr_iterator I)

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:927

Parameters

llvm::MachineBasicBlock::instr_iterator I

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

Description

Remove an instruction or bundle from the instruction list and delete it. If I points to a bundle of instructions, they are all erased.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:945

Parameters

llvm::MachineBasicBlock::iterator I

void eraseFromParent()

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1004

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:933

Parameters

llvm::MachineInstr* I

llvm::DebugLoc findBranchDebugLoc()

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1046

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1017

Parameters

llvm::MachineBasicBlock::iterator MBBI

llvm::DebugLoc findDebugLoc(
    llvm::MachineBasicBlock::instr_iterator MBBI)

Description

Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE and DBG_LABEL instructions. Return UnknownLoc if there is none.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1016

Parameters

llvm::MachineBasicBlock::instr_iterator MBBI

llvm::DebugLoc findPrevDebugLoc(
    llvm::MachineBasicBlock::instr_iterator MBBI)

Description

Find the previous valid DebugLoc preceding MBBI, skipping and DBG_VALUE instructions. Return UnknownLoc if there is none.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1031

Parameters

llvm::MachineBasicBlock::instr_iterator MBBI

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1032

Parameters

llvm::MachineBasicBlock::iterator MBBI

const llvm::MachineInstr& front() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:259

llvm::MachineInstr& front()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:257

llvm::Align getAlignment() const

Description

Return alignment of the basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:529

const llvm::BasicBlock* getBasicBlock() const

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:205

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:522

Parameters

const llvm::TargetRegisterInfo* TRI

llvm::MCSymbol* getEHCatchretSymbol() const

Description

Return the EHCatchret Symbol for this basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1095

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:526

Parameters

const llvm::TargetRegisterInfo* TRI

llvm::MCSymbol* getEndSymbol() const

Description

Returns the MCSymbol marking the end of this basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:609

llvm::MachineBasicBlock* getFallThrough()

Description

Return the fallthrough block if the block can implicitly transfer control to the block after it by falling off the end of it. This should return null if it can reach the block after it, but it uses an explicit branch to do so (e.g., a table jump). Non-null return is a conservative answer.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:754

llvm::MachineBasicBlock::instr_iterator
getFirstInstrTerminator()

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:789

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

Description

Returns an iterator to the first non-debug instruction in the basic block, or end(). Skip any pseudo probe operation if \c 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,\c SkipPseudoOp should be true when it's used in optimizations that unlikely hurt profile quality, e.g., without block merging. The default value of \c 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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:807

Parameters

bool SkipPseudoOp = true

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:808

Parameters

bool SkipPseudoOp = true

llvm::MachineBasicBlock::iterator getFirstNonPHI()

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:768

llvm::MachineBasicBlock::const_iterator
getFirstTerminator() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:783

llvm::MachineBasicBlock::iterator
getFirstTerminator()

Description

Returns an iterator to the first terminator instruction of this basic block. If a terminator does not exist, it returns end().

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:782

std::string getFullName() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:217

Optional<uint64_t> getIrrLoopHeaderWeight() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1097

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

Description

Returns an iterator to the last non-debug instruction in the basic block, or end(). Skip any pseudo operation if \c 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,\c SkipPseudoOp should be true when it's used in optimizations that unlikely hurt profile quality, e.g., without block merging. The default value of \c 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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:829

Parameters

bool SkipPseudoOp = true

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:830

Parameters

bool SkipPseudoOp = true

unsigned int getMaxBytesForAlignment() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:540

llvm::StringRef getName() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:214

int getNumber() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1088

const llvm::MachineFunction* getParent() const

Description

Return the MachineFunction containing this basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:234

llvm::MachineFunction* getParent()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:235

llvm::MachineBasicBlock::
    const_probability_iterator
    getProbabilityIterator(
        llvm::MachineBasicBlock::
            const_succ_iterator I) const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1114

Parameters

llvm::MachineBasicBlock::const_succ_iterator I

llvm::MachineBasicBlock::probability_iterator
getProbabilityIterator(
    llvm::MachineBasicBlock::succ_iterator I)

Description

Return probability iterator corresponding to the I successor iterator.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1112

Parameters

llvm::MachineBasicBlock::succ_iterator I

llvm::MBBSectionID getSectionID() const

Description

Returns the section ID of this basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:597

unsigned int getSectionIDNum() const

Description

Returns the unique section ID number of this basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:600

llvm::MachineBasicBlock* getSingleSuccessor()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:744

const llvm::MachineBasicBlock*
getSingleSuccessor() const

Description

Return the successor of this block if it has a single successor. Otherwise return a null pointer.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:743

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

Description

Support for MachineInstr::getNextNode().

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:294

Parameters

llvm::MachineInstr*

llvm::BranchProbability getSuccProbability(
    llvm::MachineBasicBlock::const_succ_iterator
        Succ) const

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1108

Parameters

llvm::MachineBasicBlock::const_succ_iterator Succ

llvm::MCSymbol* getSymbol() const

Description

Return the MCSymbol for this basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1092

bool hasAddressTaken() const

Description

Test whether this block is potentially the target of an indirect branch.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:220

bool hasEHPadSuccessor() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:555

bool hasLabelMustBeEmitted() const

Description

Test whether this block must have its label emitted.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:227

bool hasSuccessorProbabilities() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:725

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:887

Templates

IT

Parameters

llvm::MachineBasicBlock::iterator I
IT S
IT E

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:883

Parameters

llvm::MachineBasicBlock::instr_iterator I
llvm::MachineInstr* M

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

Description

Insert MI into the instruction list before I.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:894

Parameters

llvm::MachineBasicBlock::iterator I
llvm::MachineInstr* MI

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

Description

Insert MI into the instruction list after I.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:903

Parameters

llvm::MachineBasicBlock::iterator I
llvm::MachineInstr* MI

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:913

Parameters

llvm::MachineBasicBlock::instr_iterator I
llvm::MachineInstr* MI

const llvm::MachineInstr& instr_back() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:255

llvm::MachineInstr& instr_back()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:253

llvm::MachineBasicBlock::const_instr_iterator
instr_begin() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:263

llvm::MachineBasicBlock::instr_iterator
instr_begin()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:262

llvm::MachineBasicBlock::instr_iterator
instr_end()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:264

llvm::MachineBasicBlock::const_instr_iterator
instr_end() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:265

const llvm::MachineInstr& instr_front() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:254

llvm::MachineInstr& instr_front()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:252

llvm::MachineBasicBlock::reverse_instr_iterator
instr_rbegin()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:266

llvm::MachineBasicBlock::
    const_reverse_instr_iterator
    instr_rbegin() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:267

llvm::MachineBasicBlock::reverse_instr_iterator
instr_rend()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:268

llvm::MachineBasicBlock::
    const_reverse_instr_iterator
    instr_rend() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:269

llvm::MachineBasicBlock::instr_range instrs()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:273

llvm::MachineBasicBlock::const_instr_range
instrs() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:274

bool isBeginSection() const

Description

Returns true if this block begins any section.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:587

bool isCleanupFuncletEntry() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:581

bool isEHCatchretTarget() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:569

bool isEHFuncletEntry() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:575

bool isEHPad() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:549

bool isEHScopeEntry() const

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:562

bool isEHScopeReturnBlock() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:843

bool isEndSection() const

Description

Returns true if this block ends any section.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:590

bool isEntryBlock() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:558

bool isInlineAsmBrIndirectTarget() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:617

bool isLayoutSuccessor(
    const llvm::MachineBasicBlock* MBB) const

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:738

Parameters

const llvm::MachineBasicBlock* MBB

bool isLegalToHoistInto() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:627

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:403

Parameters

llvm::MCPhysReg Reg
llvm::LaneBitmask LaneMask = LaneBitmask::getAll()

bool isPredecessor(
    const llvm::MachineBasicBlock* MBB) const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:728

Parameters

const llvm::MachineBasicBlock* MBB

bool isReturnBlock() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:837

bool isSuccessor(
    const llvm::MachineBasicBlock* MBB) const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:731

Parameters

const llvm::MachineBasicBlock* MBB

llvm::MachineBasicBlock::livein_iterator
livein_begin() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:419

llvm::MachineBasicBlock::livein_iterator
livein_begin_dbg() const

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:414

bool livein_empty() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:421

llvm::MachineBasicBlock::livein_iterator
livein_end() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:420

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:422

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:415

llvm::MachineBasicBlock::liveout_iterator
liveout_begin() const

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:512

llvm::MachineBasicBlock::liveout_iterator
liveout_end() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:513

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:516

bool mayHaveInlineAsmBr() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:614

void moveAfter(llvm::MachineBasicBlock* NewBefore)

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:635

Parameters

llvm::MachineBasicBlock* NewBefore

void moveBefore(llvm::MachineBasicBlock* NewAfter)

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:634

Parameters

llvm::MachineBasicBlock* NewAfter

void normalizeSuccProbs()

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:677

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:309

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

Description

Returns a range that iterates over the phis in the basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:306

void pop_back()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:874

void pop_front()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:873

llvm::MachineBasicBlock::pred_iterator
pred_begin()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:326

llvm::MachineBasicBlock::const_pred_iterator
pred_begin() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:327

bool pred_empty() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:341

llvm::MachineBasicBlock::pred_iterator pred_end()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:328

llvm::MachineBasicBlock::const_pred_iterator
pred_end() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:329

llvm::MachineBasicBlock::pred_reverse_iterator
pred_rbegin()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:330

llvm::MachineBasicBlock::
    const_pred_reverse_iterator
    pred_rbegin() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:332

llvm::MachineBasicBlock::pred_reverse_iterator
pred_rend()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:334

llvm::MachineBasicBlock::
    const_pred_reverse_iterator
    pred_rend() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:336

unsigned int pred_size() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:338

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:359

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:362

void print(llvm::raw_ostream& OS,
           const llvm::SlotIndexes* = nullptr,
           bool IsStandalone = true) const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1070

Parameters

llvm::raw_ostream& OS
const llvm::SlotIndexes* = nullptr
bool IsStandalone = true

void print(llvm::raw_ostream& OS,
           llvm::ModuleSlotTracker& MST,
           const llvm::SlotIndexes* = nullptr,
           bool IsStandalone = true) const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1072

Parameters

llvm::raw_ostream& OS
llvm::ModuleSlotTracker& MST
const llvm::SlotIndexes* = nullptr
bool IsStandalone = true

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1084

Parameters

llvm::raw_ostream& OS
bool PrintType = true

void printName(
    llvm::raw_ostream& os,
    unsigned int printNameFlags = PrintNameIr,
    llvm::ModuleSlotTracker* moduleSlotTracker =
        nullptr) const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1080

Parameters

llvm::raw_ostream& os
unsigned int printNameFlags = PrintNameIr
llvm::ModuleSlotTracker* moduleSlotTracker = nullptr

void push_back(llvm::MachineInstr* MI)

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:875

Parameters

llvm::MachineInstr* MI

llvm::MachineBasicBlock::reverse_iterator rbegin()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:282

llvm::MachineBasicBlock::const_reverse_iterator
rbegin() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:285

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:962

Parameters

llvm::MachineInstr* I

llvm::MachineBasicBlock* removeFromParent()

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1001

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

Description

Remove the specified register from the live in set.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:399

Parameters

llvm::MCPhysReg Reg
llvm::LaneBitmask LaneMask = LaneBitmask::getAll()

llvm::MachineBasicBlock::livein_iterator
removeLiveIn(
    llvm::MachineBasicBlock::livein_iterator I)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:427

Parameters

llvm::MachineBasicBlock::livein_iterator I

void removePredecessor(
    llvm::MachineBasicBlock* Pred)

Description

Remove Pred as a predecessor of this MachineBasicBlock. Don't do this unless you know what you're doing, because it doesn't update Pred's successors list. Use Pred->removeSuccessor instead.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1132

Parameters

llvm::MachineBasicBlock* Pred

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:689

Parameters

llvm::MachineBasicBlock* Succ
bool NormalizeSuccProbs = false

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:697

Parameters

llvm::MachineBasicBlock::succ_iterator I
bool NormalizeSuccProbs = false

llvm::MachineInstr* remove_instr(
    llvm::MachineInstr* I)

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:972

Parameters

llvm::MachineInstr* I

llvm::MachineBasicBlock::reverse_iterator rend()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:288

llvm::MachineBasicBlock::const_reverse_iterator
rend() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:289

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1012

Parameters

llvm::MachineBasicBlock* Old
llvm::MachineBasicBlock* New

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

Description

Replace successor OLD with NEW and update probability info.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:701

Parameters

llvm::MachineBasicBlock* Old
llvm::MachineBasicBlock* New

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1025

Parameters

llvm::MachineBasicBlock::reverse_iterator MBBI

llvm::DebugLoc rfindDebugLoc(
    llvm::MachineBasicBlock::
        reverse_instr_iterator MBBI)

Description

Has exact same behavior as @ref findDebugLoc (it also searches from the first to the last MI of this MBB) except that this takes reverse iterator.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1024

Parameters

llvm::MachineBasicBlock::reverse_instr_iterator MBBI

llvm::DebugLoc rfindPrevDebugLoc(
    llvm::MachineBasicBlock::
        reverse_instr_iterator MBBI)

Description

Has exact same behavior as @ref findPrevDebugLoc (it also searches from the last to the first MI of this MBB) except that this takes reverse iterator.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1039

Parameters

llvm::MachineBasicBlock::reverse_instr_iterator MBBI

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1040

Parameters

llvm::MachineBasicBlock::reverse_iterator MBBI

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:638

Parameters

const llvm::MachineBasicBlock* MBB

void setAlignment(llvm::Align A,
                  unsigned int MaxBytes)

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:534

Parameters

llvm::Align A
unsigned int MaxBytes

void setAlignment(llvm::Align A)

Description

Set alignment of the basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:532

Parameters

llvm::Align A

void setHasAddressTaken()

Description

Set this block to reflect that it potentially is the target of an indirect branch.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:224

void setIrrLoopHeaderWeight(uint64_t Weight)

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1101

Parameters

uint64_t Weight

void setIsBeginSection(bool V = true)

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:592

Parameters

bool V = true

void setIsCleanupFuncletEntry(bool V = true)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:584

Parameters

bool V = true

void setIsEHCatchretTarget(bool V = true)

Description

Indicates if this is a target block of a catchret.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:572

Parameters

bool V = true

void setIsEHFuncletEntry(bool V = true)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:578

Parameters

bool V = true

void setIsEHPad(bool V = true)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:553

Parameters

bool V = true

void setIsEHScopeEntry(bool V = true)

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:566

Parameters

bool V = true

void setIsEndSection(bool V = true)

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:594

Parameters

bool V = true

void setIsInlineAsmBrIndirectTarget(bool V = true)

Description

Indicates if this is the indirect dest of an INLINEASM_BR.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:622

Parameters

bool V = true

void setLabelMustBeEmitted()

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:231

void setMaxBytesForAlignment(
    unsigned int MaxBytes)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:543

Parameters

unsigned int MaxBytes

void setNumber(int N)

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:1089

Parameters

int N

void setSectionID(llvm::MBBSectionID V)

Description

Sets the section ID for this basic block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:606

Parameters

llvm::MBBSectionID V

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

Description

Set successor probability of a given iterator.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:670

Parameters

llvm::MachineBasicBlock::succ_iterator I
llvm::BranchProbability Prob

unsigned int size() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:248

bool sizeWithoutDebugLargerThan(
    unsigned int Limit) const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:249

Parameters

unsigned int Limit

void sortUniqueLiveIns()

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:388

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:993

Parameters

llvm::MachineBasicBlock::iterator Where
llvm::MachineBasicBlock* Other
llvm::MachineBasicBlock::iterator From
llvm::MachineBasicBlock::iterator To

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

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:982

Parameters

llvm::MachineBasicBlock::iterator Where
llvm::MachineBasicBlock* Other
llvm::MachineBasicBlock::iterator From

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

Description

Split a basic block into 2 pieces at \p SplitPoint. A new block will be inserted after this block, and all instructions after \p SplitInst moved to it (\p SplitInst will be in the original block). If \p LIS is provided, LiveIntervals will be appropriately updated. If \p UpdateLiveIns is true, this will ensure the live ins list is accurate, including for physreg uses/defs in the original block.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:855

Parameters

llvm::MachineInstr& SplitInst
bool UpdateLiveIns = true
llvm::LiveIntervals* LIS = nullptr

Returns

the newly inserted block.

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

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:712

Parameters

llvm::MachineBasicBlock* Old
llvm::MachineBasicBlock* New
bool NormalizeSuccProbs = false

llvm::MachineBasicBlock::const_succ_iterator
succ_begin() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:343

llvm::MachineBasicBlock::succ_iterator
succ_begin()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:342

bool succ_empty() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:357

llvm::MachineBasicBlock::succ_iterator succ_end()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:344

llvm::MachineBasicBlock::const_succ_iterator
succ_end() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:345

llvm::MachineBasicBlock::succ_reverse_iterator
succ_rbegin()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:346

llvm::MachineBasicBlock::
    const_succ_reverse_iterator
    succ_rbegin() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:348

llvm::MachineBasicBlock::succ_reverse_iterator
succ_rend()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:350

llvm::MachineBasicBlock::
    const_succ_reverse_iterator
    succ_rend() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:352

unsigned int succ_size() const

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:354

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:368

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:365

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:301

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:298

void transferSuccessors(
    llvm::MachineBasicBlock* FromMBB)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:718

Parameters

llvm::MachineBasicBlock* FromMBB

void transferSuccessorsAndUpdatePHIs(
    llvm::MachineBasicBlock* FromMBB)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:722

Parameters

llvm::MachineBasicBlock* FromMBB

void updateTerminator(llvm::MachineBasicBlock*
                          PreviousLayoutSuccessor)

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:648

Parameters

llvm::MachineBasicBlock* PreviousLayoutSuccessor

void validateSuccProbs() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:683

~MachineBasicBlock()

Declared at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:196