CIRCT  19.0.0git
Namespaces | Macros | Functions
Buffers.cpp File Reference
#include "circt/Dialect/Handshake/HandshakeOps.h"
#include "circt/Dialect/Handshake/HandshakePasses.h"
#include "circt/Dialect/Handshake/HandshakeUtils.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Rewrite/FrozenRewritePatternSet.h"
#include "mlir/Transforms/DialectConversion.h"
#include "circt/Dialect/Handshake/HandshakePasses.h.inc"
Include dependency graph for Buffers.cpp:

Go to the source code of this file.

Namespaces

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

Macros

#define GEN_PASS_DEF_HANDSHAKEREMOVEBUFFERS
 
#define GEN_PASS_DEF_HANDSHAKEINSERTBUFFERS
 

Functions

static bool shouldBufferArgument (BlockArgument arg)
 
static bool isUnbufferedChannel (Operation *definingOp, Operation *usingOp)
 
static void insertBuffer (Location loc, Value operand, OpBuilder &builder, unsigned numSlots, BufferTypeEnum bufferType)
 
static void bufferResults (OpBuilder &builder, Operation *op, unsigned numSlots, BufferTypeEnum bufferType)
 
static void bufferAllStrategy (Region &r, OpBuilder &builder, unsigned numSlots, BufferTypeEnum bufferType=BufferTypeEnum::seq)
 
static bool inCycle (Operation *src, llvm::function_ref< bool(Operation *)> breaksCycle)
 
static void bufferCyclesStrategy (Region &r, OpBuilder &builder, unsigned numSlots, BufferTypeEnum=BufferTypeEnum::seq)
 
static void bufferAllFIFOStrategy (Region &r, OpBuilder &builder, unsigned numSlots)
 
static LogicalResult bufferRegion (Region &r, OpBuilder &builder, StringRef strategy, unsigned bufferSize)
 

Macro Definition Documentation

◆ GEN_PASS_DEF_HANDSHAKEINSERTBUFFERS

#define GEN_PASS_DEF_HANDSHAKEINSERTBUFFERS

Definition at line 24 of file Buffers.cpp.

◆ GEN_PASS_DEF_HANDSHAKEREMOVEBUFFERS

#define GEN_PASS_DEF_HANDSHAKEREMOVEBUFFERS

Definition at line 23 of file Buffers.cpp.

Function Documentation

◆ bufferAllFIFOStrategy()

static void bufferAllFIFOStrategy ( Region &  r,
OpBuilder &  builder,
unsigned  numSlots 
)
static

Definition at line 171 of file Buffers.cpp.

References bufferAllStrategy(), and bufferCyclesStrategy().

Referenced by bufferRegion().

◆ bufferAllStrategy()

static void bufferAllStrategy ( Region &  r,
OpBuilder &  builder,
unsigned  numSlots,
BufferTypeEnum  bufferType = BufferTypeEnum::seq 
)
static

Definition at line 96 of file Buffers.cpp.

References insertBuffer(), isUnbufferedChannel(), and shouldBufferArgument().

Referenced by bufferAllFIFOStrategy(), and bufferRegion().

◆ bufferCyclesStrategy()

static void bufferCyclesStrategy ( Region &  r,
OpBuilder &  builder,
unsigned  numSlots,
BufferTypeEnum  = BufferTypeEnum::seq 
)
static

Definition at line 146 of file Buffers.cpp.

References bufferResults(), and inCycle().

Referenced by bufferAllFIFOStrategy(), and bufferRegion().

◆ bufferRegion()

static LogicalResult bufferRegion ( Region &  r,
OpBuilder &  builder,
StringRef  strategy,
unsigned  bufferSize 
)
static

◆ bufferResults()

static void bufferResults ( OpBuilder &  builder,
Operation *  op,
unsigned  numSlots,
BufferTypeEnum  bufferType 
)
static

Definition at line 85 of file Buffers.cpp.

References insertBuffer().

Referenced by bufferCyclesStrategy().

◆ inCycle()

static bool inCycle ( Operation *  src,
llvm::function_ref< bool(Operation *)>  breaksCycle 
)
static

Definition at line 118 of file Buffers.cpp.

Referenced by bufferCyclesStrategy().

◆ insertBuffer()

static void insertBuffer ( Location  loc,
Value  operand,
OpBuilder &  builder,
unsigned  numSlots,
BufferTypeEnum  bufferType 
)
static

Definition at line 71 of file Buffers.cpp.

Referenced by bufferAllStrategy(), and bufferResults().

◆ isUnbufferedChannel()

static bool isUnbufferedChannel ( Operation *  definingOp,
Operation *  usingOp 
)
static

Definition at line 67 of file Buffers.cpp.

Referenced by bufferAllStrategy().

◆ shouldBufferArgument()

static bool shouldBufferArgument ( BlockArgument  arg)
static

Definition at line 61 of file Buffers.cpp.

Referenced by bufferAllStrategy().