CIRCT  19.0.0git
Namespaces | Functions
InsertMergeBlocks.cpp File Reference
#include "PassDetail.h"
#include "circt/Transforms/Passes.h"
#include "mlir/Analysis/CFGLoopInfo.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/Pattern.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlow.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/Dominance.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/TypeSwitch.h"
Include dependency graph for InsertMergeBlocks.cpp:

Go to the source code of this file.

Namespaces

 circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
 

Functions

static LogicalResult changeBranchTarget (Block *block, Block *oldDest, Block *newDest, ConversionPatternRewriter &rewriter)
 Replaces the branching to oldDest of with an equivalent operation that instead branches to newDest. More...
 
static FailureOr< Block * > buildMergeBlock (Block *b1, Block *b2, Block *oldSucc, ConversionPatternRewriter &rewriter)
 Creates a new intermediate block that b1 and b2 branch to. More...
 
static LogicalResult buildMergeBlocks (Block *currBlock, SplitInfo &splitInfo, Block *predDom, ConversionPatternRewriter &rewriter, DualGraph &graph)
 Builds a binary merge block tree for the predecessors of currBlock. More...
 
static LogicalResult preconditionCheck (Region &r, CFGLoopInfo &loopInfo)
 Checks preconditions of this transformation. More...
 
std::unique_ptr< mlir::Pass > circt::createInsertMergeBlocksPass ()
 

Function Documentation

◆ buildMergeBlock()

static FailureOr<Block *> buildMergeBlock ( Block *  b1,
Block *  b2,
Block *  oldSucc,
ConversionPatternRewriter &  rewriter 
)
static

Creates a new intermediate block that b1 and b2 branch to.

The new block branches to their common successor oldSucc.

Definition at line 62 of file InsertMergeBlocks.cpp.

References changeBranchTarget().

Referenced by buildMergeBlocks().

◆ buildMergeBlocks()

static LogicalResult buildMergeBlocks ( Block *  currBlock,
SplitInfo &  splitInfo,
Block *  predDom,
ConversionPatternRewriter &  rewriter,
DualGraph &  graph 
)
static

Builds a binary merge block tree for the predecessors of currBlock.

Definition at line 174 of file InsertMergeBlocks.cpp.

References buildMergeBlock(), and mergeBlock().

◆ changeBranchTarget()

static LogicalResult changeBranchTarget ( Block *  block,
Block *  oldDest,
Block *  newDest,
ConversionPatternRewriter &  rewriter 
)
static

Replaces the branching to oldDest of with an equivalent operation that instead branches to newDest.

Definition at line 26 of file InsertMergeBlocks.cpp.

Referenced by buildMergeBlock().

◆ preconditionCheck()

static LogicalResult preconditionCheck ( Region &  r,
CFGLoopInfo &  loopInfo 
)
static

Checks preconditions of this transformation.

Definition at line 223 of file InsertMergeBlocks.cpp.