MLIR
20.0.0git
|
#include "mlir/IR/Dominance.h"
Public Member Functions | |
DominanceInfoBase (Operation *op=nullptr) | |
DominanceInfoBase (DominanceInfoBase &&)=default | |
DominanceInfoBase & | operator= (DominanceInfoBase &&)=default |
~DominanceInfoBase () | |
DominanceInfoBase (const DominanceInfoBase &)=delete | |
DominanceInfoBase & | operator= (const DominanceInfoBase &)=delete |
void | invalidate () |
Invalidate dominance info. More... | |
void | invalidate (Region *region) |
Block * | findNearestCommonDominator (Block *a, Block *b) const |
Finds the nearest common dominator block for the two given blocks a and b. More... | |
template<typename BlockRangeT > | |
Block * | findNearestCommonDominator (BlockRangeT &&blocks) const |
Finds the nearest common dominator block for the given range of blocks. More... | |
DominanceInfoNode * | getRootNode (Region *region) |
Get the root dominance node of the given region. More... | |
DominanceInfoNode * | getNode (Block *a) |
Return the dominance node from the Region containing block A. More... | |
bool | isReachableFromEntry (Block *a) const |
Return true if the specified block is reachable from the entry block of its region. More... | |
bool | hasSSADominance (Block *block) const |
Return true if operations in the specified block are known to obey SSA dominance requirements. More... | |
bool | hasSSADominance (Region *region) const |
Return true if operations in the specified block are known to obey SSA dominance requirements. More... | |
DomTree & | getDomTree (Region *region) const |
Protected Types | |
using | super = DominanceInfoBase< IsPostDom > |
Protected Member Functions | |
llvm::PointerIntPair< DomTree *, 1, bool > | getDominanceInfo (Region *region, bool needsDomTree) const |
Return the dom tree and "hasSSADominance" bit for the given region. More... | |
bool | properlyDominatesImpl (Block *a, Block *b) const |
Return "true" if the specified block A properly (post)dominates block B. More... | |
bool | properlyDominatesImpl (Operation *a, Operation *b, bool enclosingOpOk=true) const |
Return "true" if the specified op A properly (post)dominates op B. More... | |
Protected Attributes | |
DenseMap< Region *, llvm::PointerIntPair< DomTree *, 1, bool > > | dominanceInfos |
A mapping of regions to their base dominator tree and a cached "hasSSADominance" bit. More... | |
Definition at line 35 of file Dominance.h.
|
protected |
Definition at line 108 of file Dominance.h.
|
inline |
Definition at line 39 of file Dominance.h.
|
default |
DominanceInfoBase::~DominanceInfoBase |
Definition at line 32 of file Dominance.cpp.
|
delete |
Block * DominanceInfoBase::findNearestCommonDominator | ( | Block * | a, |
Block * | b | ||
) | const |
Finds the nearest common dominator block for the two given blocks a and b.
If no common dominator can be found, this function will return nullptr.
Definition at line 192 of file Dominance.cpp.
References mlir::Block::getParent(), and tryGetBlocksInSameRegion().
|
inline |
Finds the nearest common dominator block for the given range of blocks.
If no common dominator can be found, this function will return nullptr.
Definition at line 60 of file Dominance.h.
References mlir::Block::begin().
|
protected |
Return the dom tree and "hasSSADominance" bit for the given region.
The DomTree will be null for single-block regions. This lazily constructs the DomTree on demand when needsDomTree=true.
Definition at line 57 of file Dominance.cpp.
References mlir::Region::hasOneBlock().
|
inline |
Definition at line 101 of file Dominance.h.
References mlir::Region::hasOneBlock().
|
inline |
Return the dominance node from the Region containing block A.
This only works for multi-block regions.
Definition at line 82 of file Dominance.h.
References mlir::Block::getParent().
Referenced by transformToStructuredCFBranches().
|
inline |
Get the root dominance node of the given region.
Note that this operation is only defined for multi-block regions!
Definition at line 74 of file Dominance.h.
|
inline |
Return true if operations in the specified block are known to obey SSA dominance requirements.
False if the block is a graph region or unknown.
Definition at line 92 of file Dominance.h.
References mlir::Block::getParent().
|
inline |
Return true if operations in the specified block are known to obey SSA dominance requirements.
False if the block is a graph region or unknown.
Definition at line 97 of file Dominance.h.
void DominanceInfoBase::invalidate |
Invalidate dominance info.
This can be used by clients that make major changes to the CFG and don't have a good way to update it.
Definition at line 38 of file Dominance.cpp.
Referenced by mlir::transformCFGToSCF(), and transformToStructuredCFBranches().
void DominanceInfoBase::invalidate | ( | Region * | region | ) |
Definition at line 45 of file Dominance.cpp.
bool DominanceInfoBase::isReachableFromEntry | ( | Block * | a | ) | const |
Return true if the specified block is reachable from the entry block of its region.
Definition at line 295 of file Dominance.cpp.
References mlir::Region::front(), and mlir::Block::getParent().
|
delete |
|
default |
|
protected |
Return "true" if the specified block A properly (post)dominates block B.
Return true if the specified block A properly dominates block B.
Definition at line 218 of file Dominance.cpp.
References mlir::Region::findAncestorBlockInRegion(), and mlir::Block::getParent().
|
protected |
Return "true" if the specified op A properly (post)dominates op B.
Definition at line 248 of file Dominance.cpp.
References mlir::Region::findAncestorOpInRegion(), mlir::Operation::getBlock(), mlir::Block::getParent(), and mlir::Operation::isBeforeInBlock().
|
mutableprotected |
A mapping of regions to their base dominator tree and a cached "hasSSADominance" bit.
This map does not contain dominator trees for single block CFG regions, but we do want to cache the "hasSSADominance" bit for them. We may also not have computed the DomTree yet. In either case, the DomTree is just null.
Definition at line 130 of file Dominance.h.