CIRCT 22.0.0git
|
#include "circt/Dialect/FIRRTL/FIRRTLInstanceGraph.h"
#include "circt/Dialect/FIRRTL/FIRRTLOps.h"
#include "circt/Support/Debug.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/Threading.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Transforms/ControlFlowSinkUtils.h"
#include "circt/Dialect/FIRRTL/Passes.h.inc"
Go to the source code of this file.
Namespaces | |
namespace | circt |
The InstanceGraph op interface, see InstanceGraphInterface.td for more details. | |
namespace | circt::firrtl |
Macros | |
#define | DEBUG_TYPE "firrtl-layer-sink" |
#define | GEN_PASS_DEF_LAYERSINK |
Functions | |
static bool | isAncestor (Block *block, Block *other) |
static bool | cloneable (Operation *op) |
static bool | isValidDest (Operation *op) |
True if this operation is a good site to sink operations. | |
static bool | isBarrier (Operation *op) |
True if we are prevented from sinking operations into the regions of the op. | |
static Demand | clamp (Operation *op, Demand demand) |
Adjust the demand based on the location of the op being demanded. | |
#define DEBUG_TYPE "firrtl-layer-sink" |
Definition at line 21 of file LayerSink.cpp.
#define GEN_PASS_DEF_LAYERSINK |
Definition at line 25 of file LayerSink.cpp.
|
static |
Adjust the demand based on the location of the op being demanded.
Ideally, we can sink an op directly to its site of use. However, there are two issues.
1) Typically, an op will dominate every demand, but for hardware declarations such as wires, the declaration will demand any connections driving it. In this case, the relationship is reversed: the demander dominates the demandee. This can cause us to pull connect-like ops up and and out of their enclosing block (ref-defines can be buried under layerblocks). To avoid this, we set an upper bound on the demand: the enclosing block of the demandee.
2) not all regions are valid sink targets. If there is a sink-barrier between the operation and its demand, we adjust the demand upwards so that there is no sink barrier between the demandee and the demand site.
Definition at line 223 of file LayerSink.cpp.
References assert(), isAncestor(), and isBarrier().
|
static |
Definition at line 67 of file LayerSink.cpp.
|
static |
Definition at line 57 of file LayerSink.cpp.
Referenced by clamp().
|
static |
True if we are prevented from sinking operations into the regions of the op.
Definition at line 206 of file LayerSink.cpp.
References isValidDest().
Referenced by clamp().
|
static |
True if this operation is a good site to sink operations.
Definition at line 201 of file LayerSink.cpp.
Referenced by isBarrier().