MLIR  16.0.0git
Functions
Dominance.cpp File Reference
#include "mlir/IR/Dominance.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/RegionKindInterface.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/GenericDomTreeConstruction.h"
+ Include dependency graph for Dominance.cpp:

Go to the source code of this file.

Functions

static BlockgetAncestorBlock (Block *block)
 Return the ancestor block enclosing the specified block. More...
 
template<typename FuncT >
static BlocktraverseAncestors (Block *block, const FuncT &func)
 Walks up the list of containers of the given block and calls the user-defined traversal function for every pair of a region and block that could be found during traversal. More...
 
static bool tryGetBlocksInSameRegion (Block *&a, Block *&b)
 Tries to update the given block references to live in the same region by exploring the relationship of both blocks with respect to their regions. More...
 

Function Documentation

◆ getAncestorBlock()

static Block* getAncestorBlock ( Block block)
static

Return the ancestor block enclosing the specified block.

This returns null if we reach the top of the hierarchy.

Definition at line 88 of file Dominance.cpp.

References mlir::Block::getParentOp().

Referenced by traverseAncestors(), and tryGetBlocksInSameRegion().

◆ traverseAncestors()

template<typename FuncT >
static Block* traverseAncestors ( Block block,
const FuncT &  func 
)
static

Walks up the list of containers of the given block and calls the user-defined traversal function for every pair of a region and block that could be found during traversal.

If the user-defined function returns true for a given pair, traverseAncestors will return the current block. Nullptr otherwise.

Definition at line 100 of file Dominance.cpp.

References getAncestorBlock().

Referenced by tryGetBlocksInSameRegion().

◆ tryGetBlocksInSameRegion()

static bool tryGetBlocksInSameRegion ( Block *&  a,
Block *&  b 
)
static

Tries to update the given block references to live in the same region by exploring the relationship of both blocks with respect to their regions.

Definition at line 111 of file Dominance.cpp.

References getAncestorBlock(), mlir::Block::getParent(), and traverseAncestors().

Referenced by mlir::detail::DominanceInfoBase< true >::findNearestCommonDominator().