CIRCT  20.0.0git
Namespaces | Macros | Functions
InsertMergeBlocks.cpp File Reference
#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/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/TypeSwitch.h"
#include "circt/Transforms/Passes.h.inc"
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.
 

Macros

#define GEN_PASS_DEF_INSERTMERGEBLOCKS
 

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 ()
 

Macro Definition Documentation

◆ GEN_PASS_DEF_INSERTMERGEBLOCKS

#define GEN_PASS_DEF_INSERTMERGEBLOCKS

Definition at line 22 of file InsertMergeBlocks.cpp.

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 67 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 179 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 31 of file InsertMergeBlocks.cpp.

Referenced by buildMergeBlock().

◆ preconditionCheck()

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

Checks preconditions of this transformation.

Definition at line 228 of file InsertMergeBlocks.cpp.