class MachineDominatorTree

Declaration

class MachineDominatorTree : public MachineFunctionPass { /* full declaration omitted */ };

Description

DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:46

Inherits from: MachineFunctionPass

Member Variables

public static char ID

Method Overview

  • public MachineDominatorTree(llvm::MachineFunction & MF)
  • public MachineDominatorTree()
  • public llvm::MachineDomTreeNode * addNewBlock(llvm::MachineBasicBlock * BB, llvm::MachineBasicBlock * DomBB)
  • public void calculate(llvm::MachineFunction & F)
  • public void changeImmediateDominator(llvm::MachineDomTreeNode * N, llvm::MachineDomTreeNode * NewIDom)
  • public void changeImmediateDominator(llvm::MachineBasicBlock * N, llvm::MachineBasicBlock * NewIDom)
  • public bool dominates(const llvm::MachineBasicBlock * A, const llvm::MachineBasicBlock * B) const
  • public bool dominates(const llvm::MachineInstr * A, const llvm::MachineInstr * B) const
  • public bool dominates(const llvm::MachineDomTreeNode * A, const llvm::MachineDomTreeNode * B) const
  • public void eraseNode(llvm::MachineBasicBlock * BB)
  • public llvm::MachineBasicBlock * findNearestCommonDominator(llvm::MachineBasicBlock * A, llvm::MachineBasicBlock * B)
  • public void getAnalysisUsage(llvm::AnalysisUsage & AU) const
  • public llvm::MachineDominatorTree::DomTreeT & getBase()
  • public llvm::MachineDomTreeNode * getNode(llvm::MachineBasicBlock * BB) const
  • public llvm::MachineBasicBlock * getRoot() const
  • public llvm::MachineDomTreeNode * getRootNode() const
  • public const SmallVectorImpl<llvm::MachineBasicBlock *> & getRoots() const
  • public bool isReachableFromEntry(const llvm::MachineBasicBlock * A)
  • public void print(llvm::raw_ostream & OS, const llvm::Module *) const
  • public bool properlyDominates(const llvm::MachineBasicBlock * A, const llvm::MachineBasicBlock * B) const
  • public bool properlyDominates(const llvm::MachineDomTreeNode * A, const llvm::MachineDomTreeNode * B) const
  • public void recordSplitCriticalEdge(llvm::MachineBasicBlock * FromBB, llvm::MachineBasicBlock * ToBB, llvm::MachineBasicBlock * NewBB)
  • public void releaseMemory()
  • public bool runOnMachineFunction(llvm::MachineFunction & F)
  • public void splitBlock(llvm::MachineBasicBlock * NewBB)
  • public void verifyAnalysis() const

Inherited from MachineFunctionPass:

Inherited from FunctionPass:

Inherited from Pass:

Methods

MachineDominatorTree(llvm::MachineFunction& MF)

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:84

Parameters

llvm::MachineFunction& MF

MachineDominatorTree()

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:83

llvm::MachineDomTreeNode* addNewBlock(
    llvm::MachineBasicBlock* BB,
    llvm::MachineBasicBlock* DomBB)

Description

addNewBlock - Add a new node to the dominator tree information. This creates a new node as a child of DomBB dominator node,linking it into the children list of the immediate dominator.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:181

Parameters

llvm::MachineBasicBlock* BB
llvm::MachineBasicBlock* DomBB

void calculate(llvm::MachineFunction& F)

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:117

Parameters

llvm::MachineFunction& F

void changeImmediateDominator(
    llvm::MachineDomTreeNode* N,
    llvm::MachineDomTreeNode* NewIDom)

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

Parameters

llvm::MachineDomTreeNode* N
llvm::MachineDomTreeNode* NewIDom

void changeImmediateDominator(
    llvm::MachineBasicBlock* N,
    llvm::MachineBasicBlock* NewIDom)

Description

changeImmediateDominator - This method is used to update the dominator tree information when a node's immediate dominator changes.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:190

Parameters

llvm::MachineBasicBlock* N
llvm::MachineBasicBlock* NewIDom

bool dominates(
    const llvm::MachineBasicBlock* A,
    const llvm::MachineBasicBlock* B) const

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:125

Parameters

const llvm::MachineBasicBlock* A
const llvm::MachineBasicBlock* B

bool dominates(const llvm::MachineInstr* A,
               const llvm::MachineInstr* B) const

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:132

Parameters

const llvm::MachineInstr* A
const llvm::MachineInstr* B

bool dominates(
    const llvm::MachineDomTreeNode* A,
    const llvm::MachineDomTreeNode* B) const

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:119

Parameters

const llvm::MachineDomTreeNode* A
const llvm::MachineDomTreeNode* B

void eraseNode(llvm::MachineBasicBlock* BB)

Description

eraseNode - Removes a node from the dominator tree. Block must not dominate any other blocks. Removes node from its immediate dominator's children list. Deletes dominator node associated with basic block BB.

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

Parameters

llvm::MachineBasicBlock* BB

llvm::MachineBasicBlock*
findNearestCommonDominator(
    llvm::MachineBasicBlock* A,
    llvm::MachineBasicBlock* B)

Description

findNearestCommonDominator - Find nearest common dominator basic block for basic block A and B. If there is no such block then return NULL.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:159

Parameters

llvm::MachineBasicBlock* A
llvm::MachineBasicBlock* B

void getAnalysisUsage(
    llvm::AnalysisUsage& AU) const

Description

getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.

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

Parameters

llvm::AnalysisUsage& AU

llvm::MachineDominatorTree::DomTreeT& getBase()

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:88

llvm::MachineDomTreeNode* getNode(
    llvm::MachineBasicBlock* BB) const

Description

getNode - return the (Post)DominatorTree node for the specified basic block. This is the same as using operator[] on this class.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:173

Parameters

llvm::MachineBasicBlock* BB

llvm::MachineBasicBlock* getRoot() const

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:105

llvm::MachineDomTreeNode* getRootNode() const

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:110

const SmallVectorImpl<llvm::MachineBasicBlock*>&
getRoots() const

Description

getRoots - Return the root blocks of the current CFG. This may include multiple blocks if we are computing post dominators. For forward dominators, this will always be a single block (the entry node).

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:100

bool isReachableFromEntry(
    const llvm::MachineBasicBlock* A)

Description

isReachableFromEntry - Return true if A is dominated by the entry block of the function containing it.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:219

Parameters

const llvm::MachineBasicBlock* A

void print(llvm::raw_ostream& OS,
           const llvm::Module*) const

Description

print - Print out the internal state of the pass. This is called by Analyze to print out the contents of an analysis. Otherwise it is not necessary to implement this method. Beware that the module pointer MAY be null. This automatically forwards to a virtual function that does not provide the Module* in case the analysis doesn't need it it can just be ignored.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:228

Parameters

llvm::raw_ostream& OS
const llvm::Module*

bool properlyDominates(
    const llvm::MachineBasicBlock* A,
    const llvm::MachineBasicBlock* B) const

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:151

Parameters

const llvm::MachineBasicBlock* A
const llvm::MachineBasicBlock* B

bool properlyDominates(
    const llvm::MachineDomTreeNode* A,
    const llvm::MachineDomTreeNode* B) const

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:145

Parameters

const llvm::MachineDomTreeNode* A
const llvm::MachineDomTreeNode* B

void recordSplitCriticalEdge(
    llvm::MachineBasicBlock* FromBB,
    llvm::MachineBasicBlock* ToBB,
    llvm::MachineBasicBlock* NewBB)

Description

Record that the critical edge (FromBB, ToBB) has been split with NewBB. This is best to use this method instead of directly update the underlying information, because this helps mitigating the number of time the DT information is invalidated.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:242

Parameters

llvm::MachineBasicBlock* FromBB
llvm::MachineBasicBlock* ToBB
llvm::MachineBasicBlock* NewBB

void releaseMemory()

Description

releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused. Optionally implement this function to release pass memory when it is no longer used.

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

bool runOnMachineFunction(
    llvm::MachineFunction& F)

Description

runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:115

Parameters

llvm::MachineFunction& F

void splitBlock(llvm::MachineBasicBlock* NewBB)

Description

splitBlock - BB is split and now it has one successor. Update dominator tree to reflect this change.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:212

Parameters

llvm::MachineBasicBlock* NewBB

void verifyAnalysis() const

Description

verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.

Declared at: llvm/include/llvm/CodeGen/MachineDominators.h:226