CIRCT  20.0.0git
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
circt::handshake::HandshakeLowering Class Reference

#include <CFToHandshake.h>

Collaboration diagram for circt::handshake::HandshakeLowering:
Collaboration graph
[legend]

Classes

struct  MergeOpInfo
 

Public Types

using BlockValues = DenseMap< Block *, std::vector< Value > >
 
using BlockOps = DenseMap< Block *, std::vector< MergeOpInfo > >
 
using ValueMap = DenseMap< Value, Value >
 
using MemRefToMemoryAccessOp = llvm::MapVector< Value, std::vector< Operation * > >
 

Public Member Functions

 HandshakeLowering (Region &r)
 
LogicalResult addMergeOps (ConversionPatternRewriter &rewriter)
 
LogicalResult addBranchOps (ConversionPatternRewriter &rewriter)
 
LogicalResult replaceCallOps (ConversionPatternRewriter &rewriter)
 
template<typename TSrcTerm , typename TDstTerm >
LogicalResult setControlOnlyPath (ConversionPatternRewriter &rewriter, Value entryCtrl)
 
LogicalResult connectConstantsToControl (ConversionPatternRewriter &rewriter, bool sourceConstants)
 
LogicalResult feedForwardRewriting (ConversionPatternRewriter &rewriter)
 
LogicalResult loopNetworkRewriting (ConversionPatternRewriter &rewriter)
 
BlockOps insertMergeOps (ValueMap &mergePairs, BackedgeBuilder &edgeBuilder, ConversionPatternRewriter &rewriter)
 
MergeOpInfo insertMerge (Block *block, Value val, BackedgeBuilder &edgeBuilder, ConversionPatternRewriter &rewriter)
 
LogicalResult replaceMemoryOps (ConversionPatternRewriter &rewriter, MemRefToMemoryAccessOp &memRefOps)
 
LogicalResult connectToMemory (ConversionPatternRewriter &rewriter, MemRefToMemoryAccessOp memRefOps, bool lsq)
 
void setMemOpControlInputs (ConversionPatternRewriter &rewriter, ArrayRef< Operation * > memOps, Operation *memOp, int offset, ArrayRef< int > cntrlInd)
 
Value getBlockEntryControl (Block *block) const
 
void setBlockEntryControl (Block *block, Value v)
 
Region & getRegion ()
 
MLIRContext * getContext ()
 

Protected Member Functions

LogicalResult runSSAMaximization (ConversionPatternRewriter &rewriter, Value entryCtrl)
 

Protected Attributes

Region & r
 
BlockArgument startCtrl
 Start point of the control-only network. More...
 

Private Attributes

DenseMap< Block *, Value > blockEntryControlMap
 

Detailed Description

Definition at line 55 of file CFToHandshake.h.

Member Typedef Documentation

◆ BlockOps

using circt::handshake::HandshakeLowering::BlockOps = DenseMap<Block *, std::vector<MergeOpInfo> >

Definition at line 65 of file CFToHandshake.h.

◆ BlockValues

using circt::handshake::HandshakeLowering::BlockValues = DenseMap<Block *, std::vector<Value> >

Definition at line 64 of file CFToHandshake.h.

◆ MemRefToMemoryAccessOp

using circt::handshake::HandshakeLowering::MemRefToMemoryAccessOp = llvm::MapVector<Value, std::vector<Operation *> >

Definition at line 67 of file CFToHandshake.h.

◆ ValueMap

using circt::handshake::HandshakeLowering::ValueMap = DenseMap<Value, Value>

Definition at line 66 of file CFToHandshake.h.

Constructor & Destructor Documentation

◆ HandshakeLowering()

circt::handshake::HandshakeLowering::HandshakeLowering ( Region &  r)
inlineexplicit

Definition at line 70 of file CFToHandshake.h.

Member Function Documentation

◆ addBranchOps()

LogicalResult HandshakeLowering::addBranchOps ( ConversionPatternRewriter &  rewriter)

Definition at line 1127 of file CFToHandshake.cpp.

References getBranchCount(), getSuccResult(), and isLiveOut().

Referenced by circt::handshake::lowerRegion().

◆ addMergeOps()

LogicalResult HandshakeLowering::addMergeOps ( ConversionPatternRewriter &  rewriter)

Definition at line 498 of file CFToHandshake.cpp.

References reconnectMergeOps().

Referenced by circt::handshake::lowerRegion().

◆ connectConstantsToControl()

LogicalResult HandshakeLowering::connectConstantsToControl ( ConversionPatternRewriter &  rewriter,
bool  sourceConstants 
)

Definition at line 1178 of file CFToHandshake.cpp.

Referenced by circt::handshake::lowerRegion().

◆ connectToMemory()

LogicalResult HandshakeLowering::connectToMemory ( ConversionPatternRewriter &  rewriter,
MemRefToMemoryAccessOp  memRefOps,
bool  lsq 
)

◆ feedForwardRewriting()

LogicalResult HandshakeLowering::feedForwardRewriting ( ConversionPatternRewriter &  rewriter)

Definition at line 586 of file CFToHandshake.cpp.

Referenced by circt::handshake::lowerRegion().

◆ getBlockEntryControl()

Value HandshakeLowering::getBlockEntryControl ( Block *  block) const

Definition at line 214 of file CFToHandshake.cpp.

References assert().

◆ getContext()

MLIRContext* circt::handshake::HandshakeLowering::getContext ( )
inline

Definition at line 149 of file CFToHandshake.h.

References r.

◆ getRegion()

Region& circt::handshake::HandshakeLowering::getRegion ( )
inline

Definition at line 148 of file CFToHandshake.h.

References r.

Referenced by circt::handshake::lowerRegion().

◆ insertMerge()

HandshakeLowering::MergeOpInfo HandshakeLowering::insertMerge ( Block *  block,
Value  val,
BackedgeBuilder edgeBuilder,
ConversionPatternRewriter &  rewriter 
)

Definition at line 286 of file CFToHandshake.cpp.

References circt::BackedgeBuilder::get(), and getBlockPredecessorCount().

◆ insertMergeOps()

HandshakeLowering::BlockOps HandshakeLowering::insertMergeOps ( HandshakeLowering::ValueMap mergePairs,
BackedgeBuilder edgeBuilder,
ConversionPatternRewriter &  rewriter 
)

Definition at line 359 of file CFToHandshake.cpp.

◆ loopNetworkRewriting()

LogicalResult HandshakeLowering::loopNetworkRewriting ( ConversionPatternRewriter &  rewriter)

Definition at line 846 of file CFToHandshake.cpp.

Referenced by circt::handshake::lowerRegion().

◆ replaceCallOps()

LogicalResult HandshakeLowering::replaceCallOps ( ConversionPatternRewriter &  rewriter)

An instance is activated whenever control arrives at the basic block of the source callOp.

Definition at line 1628 of file CFToHandshake.cpp.

Referenced by circt::handshake::lowerRegion().

◆ replaceMemoryOps()

LogicalResult HandshakeLowering::replaceMemoryOps ( ConversionPatternRewriter &  rewriter,
MemRefToMemoryAccessOp memRefOps 
)

Definition at line 1269 of file CFToHandshake.cpp.

References assert(), getOpMemRef(), isMemoryOp(), and isValidMemrefType().

Referenced by circt::handshake::lowerRegion().

◆ runSSAMaximization()

LogicalResult HandshakeLowering::runSSAMaximization ( ConversionPatternRewriter &  rewriter,
Value  entryCtrl 
)
protected

Definition at line 258 of file CFToHandshake.cpp.

References circt::maximizeSSA().

Referenced by setControlOnlyPath().

◆ setBlockEntryControl()

void HandshakeLowering::setBlockEntryControl ( Block *  block,
Value  v 
)

Definition at line 221 of file CFToHandshake.cpp.

Referenced by setControlOnlyPath().

◆ setControlOnlyPath()

template<typename TSrcTerm , typename TDstTerm >
LogicalResult circt::handshake::HandshakeLowering::setControlOnlyPath ( ConversionPatternRewriter &  rewriter,
Value  entryCtrl 
)
inline

Definition at line 77 of file CFToHandshake.h.

References assert(), r, runSSAMaximization(), and setBlockEntryControl().

◆ setMemOpControlInputs()

void HandshakeLowering::setMemOpControlInputs ( ConversionPatternRewriter &  rewriter,
ArrayRef< Operation * >  memOps,
Operation *  memOp,
int  offset,
ArrayRef< int >  cntrlInd 
)

Definition at line 1475 of file CFToHandshake.cpp.

References addValueToOperands().

Member Data Documentation

◆ blockEntryControlMap

DenseMap<Block *, Value> circt::handshake::HandshakeLowering::blockEntryControlMap
private

Definition at line 164 of file CFToHandshake.h.

◆ r

Region& circt::handshake::HandshakeLowering::r
protected

Definition at line 158 of file CFToHandshake.h.

Referenced by getContext(), getRegion(), and setControlOnlyPath().

◆ startCtrl

BlockArgument circt::handshake::HandshakeLowering::startCtrl
protected

Start point of the control-only network.

Definition at line 161 of file CFToHandshake.h.


The documentation for this class was generated from the following files: