class DominatorTree

Declaration

class DominatorTree : public DominatorTreeBase { /* full declaration omitted */ };

Description

Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree. Definition: A block is said to be forward statically reachable if there is a path from the entry of the function to the block. A statically reachable block may become statically unreachable during optimization. A forward unreachable block may appear in the dominator tree, or it may not. If it does, dominance queries will return results as if all reachable blocks dominate it. When asking for a Node corresponding to a potentially unreachable block, calling code must handle the case where the block was unreachable and the result of getNode() is nullptr. Generally, a block known to be unreachable when the dominator tree is constructed will not be in the tree. One which becomes unreachable after the dominator tree is initially constructed may still exist in the tree, even if the tree is properly updated. Calling code should not rely on the preceding statements; this is stated only to assist human understanding.

Declared at: llvm/include/llvm/IR/Dominators.h:166

Inherits from: DominatorTreeBase

Method Overview

  • public DominatorTree()
  • public DominatorTree(llvm::Function & F)
  • public DominatorTree(llvm::DominatorTree & DT, DomTreeBuilder::BBUpdates U)
  • public bool dominates(const llvm::BasicBlock * BB, const llvm::Use & U) const
  • public bool dominates(const llvm::Value * Def, const llvm::Use & U) const
  • public bool dominates(const llvm::Value * Def, const llvm::Instruction * User) const
  • public bool dominates(const llvm::Instruction * Def, const llvm::BasicBlock * BB) const
  • public bool dominates(const llvm::BasicBlockEdge & BBE, const llvm::Use & U) const
  • public bool dominates(const llvm::BasicBlockEdge & BBE, const llvm::BasicBlock * BB) const
  • public bool dominates(const llvm::BasicBlockEdge & BBE1, const llvm::BasicBlockEdge & BBE2) const
  • public bool invalidate(llvm::Function & F, const llvm::PreservedAnalyses & PA, FunctionAnalysisManager::Invalidator &)
  • public bool isReachableFromEntry(const llvm::Use & U) const
  • public void viewGraph(const llvm::Twine & Name, const llvm::Twine & Title)
  • public void viewGraph()

Methods

DominatorTree()

Declared at: llvm/include/llvm/IR/Dominators.h:170

DominatorTree(llvm::Function& F)

Declared at: llvm/include/llvm/IR/Dominators.h:171

Parameters

llvm::Function& F

DominatorTree(llvm::DominatorTree& DT,
              DomTreeBuilder::BBUpdates U)

Declared at: llvm/include/llvm/IR/Dominators.h:172

Parameters

llvm::DominatorTree& DT
DomTreeBuilder::BBUpdates U

bool dominates(const llvm::BasicBlock* BB,
               const llvm::Use& U) const

Description

Return true if the (end of the) basic block BB dominates the use U.

Declared at: llvm/include/llvm/IR/Dominators.h:184

Parameters

const llvm::BasicBlock* BB
const llvm::Use& U

bool dominates(const llvm::Value* Def,
               const llvm::Use& U) const

Description

Return true if value Def dominates use U, in the sense that Def is available at U, and could be substituted as the used value without violating the SSA dominance requirement. In particular, it is worth noting that: * Non-instruction Defs dominate everything. * Def does not dominate a use in Def itself (outside of degenerate cases like unreachable code or trivial phi cycles). * Invoke/callbr Defs only dominate uses in their default destination.

Declared at: llvm/include/llvm/IR/Dominators.h:195

Parameters

const llvm::Value* Def
const llvm::Use& U

bool dominates(
    const llvm::Value* Def,
    const llvm::Instruction* User) const

Description

Return true if value Def dominates all possible uses inside instruction User. Same comments as for the Use-based API apply.

Declared at: llvm/include/llvm/IR/Dominators.h:198

Parameters

const llvm::Value* Def
const llvm::Instruction* User

bool dominates(const llvm::Instruction* Def,
               const llvm::BasicBlock* BB) const

Declared at: llvm/include/llvm/IR/Dominators.h:201

Parameters

const llvm::Instruction* Def
const llvm::BasicBlock* BB

bool dominates(const llvm::BasicBlockEdge& BBE,
               const llvm::Use& U) const

Description

Return true if an edge dominates a use. If BBE is not a unique edge between start and end of the edge, it can never dominate the use.

Declared at: llvm/include/llvm/IR/Dominators.h:207

Parameters

const llvm::BasicBlockEdge& BBE
const llvm::Use& U

bool dominates(const llvm::BasicBlockEdge& BBE,
               const llvm::BasicBlock* BB) const

Declared at: llvm/include/llvm/IR/Dominators.h:208

Parameters

const llvm::BasicBlockEdge& BBE
const llvm::BasicBlock* BB

bool dominates(
    const llvm::BasicBlockEdge& BBE1,
    const llvm::BasicBlockEdge& BBE2) const

Description

Returns true if edge \p BBE1 dominates edge \p BBE2.

Declared at: llvm/include/llvm/IR/Dominators.h:210

Parameters

const llvm::BasicBlockEdge& BBE1
const llvm::BasicBlockEdge& BBE2

bool invalidate(
    llvm::Function& F,
    const llvm::PreservedAnalyses& PA,
    FunctionAnalysisManager::Invalidator&)

Description

Handle invalidation explicitly.

Declared at: llvm/include/llvm/IR/Dominators.h:177

Parameters

llvm::Function& F
const llvm::PreservedAnalyses& PA
FunctionAnalysisManager::Invalidator&

bool isReachableFromEntry(
    const llvm::Use& U) const

Description

Provide an overload for a Use.

Declared at: llvm/include/llvm/IR/Dominators.h:216

Parameters

const llvm::Use& U

void viewGraph(const llvm::Twine& Name,
               const llvm::Twine& Title)

Declared at: llvm/include/llvm/IR/Dominators.h:219

Parameters

const llvm::Twine& Name
const llvm::Twine& Title

void viewGraph()

Declared at: llvm/include/llvm/IR/Dominators.h:220