CIRCT
20.0.0git
|
#include "circt/Conversion/CFToHandshake.h"
#include "circt/Dialect/Handshake/HandshakeOps.h"
#include "circt/Dialect/Handshake/HandshakePasses.h"
#include "circt/Dialect/Handshake/HandshakeUtils.h"
#include "circt/Support/BackedgeBuilder.h"
#include "circt/Transforms/Passes.h"
#include "mlir/Analysis/CFGLoopInfo.h"
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/AffineStructures.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
#include "mlir/Dialect/Affine/Utils.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Types.h"
#include "mlir/IR/Value.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/Transforms/Passes.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/raw_ostream.h"
#include <list>
#include <map>
#include "circt/Conversion/Passes.h.inc"
Go to the source code of this file.
Classes | |
class | LowerRegionTarget |
struct | PartialLowerRegion |
Allows to partially lower a region by matching on the parent operation to then call the provided partial lowering function with the region and the rewriter. More... | |
struct | BlockControlTerm |
Holds information about an handshake "basic block terminator" control operation. More... | |
Namespaces | |
circt | |
The InstanceGraph op interface, see InstanceGraphInterface.td for more details. | |
Macros | |
#define | GEN_PASS_DEF_CFTOHANDSHAKE |
#define | GEN_PASS_DEF_HANDSHAKEREMOVEBLOCK |
Functions | |
template<typename TOp > | |
static LogicalResult | partiallyLowerOp (const std::function< LogicalResult(TOp, ConversionPatternRewriter &)> &loweringFunc, MLIRContext *ctx, TOp op) |
void | removeBasicBlocks (handshake::FuncOp funcOp) |
static LogicalResult | isValidMemrefType (Location loc, mlir::MemRefType type) |
static unsigned | getBlockPredecessorCount (Block *block) |
static Value | getMergeOperand (HandshakeLowering::MergeOpInfo mergeInfo, Block *predBlock) |
static void | removeBlockOperands (Region &f) |
template<typename TOp > | |
static Operation * | getFirstOp (Block *block) |
Returns the first occurance of an operation of type TOp, else, returns null op. More... | |
static Operation * | getControlMerge (Block *block) |
static ConditionalBranchOp | getControlCondBranch (Block *block) |
static void | reconnectMergeOps (Region &r, HandshakeLowering::BlockOps blockMerges, HandshakeLowering::ValueMap &mergePairs) |
static bool | isAllocOp (Operation *op) |
static bool | isLiveOut (Value val) |
static int | getBranchCount (Value val, Block *block) |
static bool | loopsHaveSingleExit (CFGLoopInfo &loopInfo) |
static Operation * | findBranchToBlock (Block *block) |
static Value | getOperandFromBlock (MuxOp mux, Block *block) |
static std::vector< Value > | getSortedInputs (ControlMergeOp cmerge, MuxOp mux) |
static Value | getSuccResult (Operation *termOp, Operation *newOp, Block *succBlock) |
static BlockControlTerm | getBlockControlTerminator (Block *block) |
static LogicalResult | getOpMemRef (Operation *op, Value &out) |
static bool | isMemoryOp (Operation *op) |
static SmallVector< Value, 8 > | getResultsToMemory (Operation *op) |
static void | addLazyForks (Region &f, ConversionPatternRewriter &rewriter) |
static void | removeUnusedAllocOps (Region &r, ConversionPatternRewriter &rewriter) |
static void | addJoinOps (ConversionPatternRewriter &rewriter, ArrayRef< BlockControlTerm > controlTerms) |
static std::vector< BlockControlTerm > | getControlTerminators (ArrayRef< Operation * > memOps) |
static void | addValueToOperands (Operation *op, Value val) |
static void | setLoadDataInputs (ArrayRef< Operation * > memOps, Operation *memOp) |
static LogicalResult | setJoinControlInputs (ArrayRef< Operation * > memOps, Operation *memOp, int offset, ArrayRef< int > cntrlInd) |
static LogicalResult | maximizeSSANoMem (Region &r, ConversionPatternRewriter &rewriter) |
Converts every value in the region into maximal SSA form, unless the value is a block argument of type MemRefType or the result of an allocation operation. More... | |
static LogicalResult | lowerFuncOp (func::FuncOp funcOp, MLIRContext *ctx, bool sourceConstants, bool disableTaskPipelining) |
#define GEN_PASS_DEF_CFTOHANDSHAKE |
Definition at line 50 of file CFToHandshake.cpp.
#define GEN_PASS_DEF_HANDSHAKEREMOVEBLOCK |
Definition at line 51 of file CFToHandshake.cpp.
|
static |
Definition at line 1411 of file CFToHandshake.cpp.
Referenced by circt::handshake::HandshakeLowering::connectToMemory().
|
static |
Definition at line 1390 of file CFToHandshake.cpp.
References BlockControlTerm::ctrlOperand, getBlockControlTerminator(), and insertFork().
Referenced by circt::handshake::HandshakeLowering::connectToMemory().
|
static |
Definition at line 1442 of file CFToHandshake.cpp.
Referenced by setJoinControlInputs(), setLoadDataInputs(), and circt::handshake::HandshakeLowering::setMemOpControlInputs().
|
static |
Definition at line 623 of file CFToHandshake.cpp.
|
static |
Definition at line 1232 of file CFToHandshake.cpp.
Referenced by addLazyForks(), getControlTerminators(), and setJoinControlInputs().
|
static |
Definition at line 277 of file CFToHandshake.cpp.
Referenced by circt::handshake::HandshakeLowering::insertMerge(), and reconnectMergeOps().
|
static |
Definition at line 530 of file CFToHandshake.cpp.
Referenced by circt::handshake::HandshakeLowering::addBranchOps().
|
static |
Definition at line 432 of file CFToHandshake.cpp.
|
static |
Definition at line 428 of file CFToHandshake.cpp.
Referenced by reconnectMergeOps().
|
static |
Definition at line 1427 of file CFToHandshake.cpp.
References getBlockControlTerminator().
Referenced by circt::handshake::HandshakeLowering::connectToMemory().
|
static |
Returns the first occurance of an operation of type TOp, else, returns null op.
Definition at line 421 of file CFToHandshake.cpp.
|
static |
Definition at line 382 of file CFToHandshake.cpp.
References assert(), circt::handshake::HandshakeLowering::MergeOpInfo::op, and circt::handshake::HandshakeLowering::MergeOpInfo::val.
Referenced by reconnectMergeOps().
|
static |
Definition at line 880 of file CFToHandshake.cpp.
References assert().
Referenced by getSortedInputs().
|
static |
Definition at line 1248 of file CFToHandshake.cpp.
Referenced by circt::handshake::HandshakeLowering::replaceMemoryOps().
|
static |
Definition at line 1372 of file CFToHandshake.cpp.
References assert().
Referenced by circt::handshake::HandshakeLowering::connectToMemory().
|
static |
Definition at line 893 of file CFToHandshake.cpp.
References assert(), and getOperandFromBlock().
|
static |
Definition at line 1111 of file CFToHandshake.cpp.
References assert().
Referenced by circt::handshake::HandshakeLowering::addBranchOps().
|
static |
Definition at line 493 of file CFToHandshake.cpp.
Referenced by removeUnusedAllocOps().
|
static |
Definition at line 517 of file CFToHandshake.cpp.
Referenced by circt::handshake::HandshakeLowering::addBranchOps().
|
static |
Definition at line 1263 of file CFToHandshake.cpp.
Referenced by circt::handshake::HandshakeLowering::replaceMemoryOps().
|
static |
Definition at line 270 of file CFToHandshake.cpp.
Referenced by circt::handshake::HandshakeLowering::connectToMemory(), and circt::handshake::HandshakeLowering::replaceMemoryOps().
|
static |
Definition at line 593 of file CFToHandshake.cpp.
|
static |
Definition at line 1676 of file CFToHandshake.cpp.
References handshake.FuncOp::create(), maximizeSSANoMem(), and circt::handshake::partiallyLowerRegion().
|
static |
Converts every value in the region into maximal SSA form, unless the value is a block argument of type MemRefType or the result of an allocation operation.
Definition at line 1670 of file CFToHandshake.cpp.
References circt::maximizeSSA(), and strategy.
Referenced by lowerFuncOp().
|
static |
Definition at line 131 of file CFToHandshake.cpp.
|
static |
Definition at line 440 of file CFToHandshake.cpp.
References assert(), getBlockPredecessorCount(), getControlMerge(), getMergeOperand(), and removeBlockOperands().
Referenced by circt::handshake::HandshakeLowering::addMergeOps().
void removeBasicBlocks | ( | handshake::FuncOp | funcOp | ) |
Definition at line 263 of file CFToHandshake.cpp.
|
static |
Definition at line 406 of file CFToHandshake.cpp.
Referenced by reconnectMergeOps().
|
static |
Definition at line 1399 of file CFToHandshake.cpp.
References isAllocOp().
Referenced by circt::handshake::HandshakeLowering::connectToMemory().
|
static |
Definition at line 1458 of file CFToHandshake.cpp.
References addValueToOperands(), BlockControlTerm::ctrlOperand, and getBlockControlTerminator().
Referenced by circt::handshake::HandshakeLowering::connectToMemory().
|
static |
Definition at line 1449 of file CFToHandshake.cpp.
References addValueToOperands().
Referenced by circt::handshake::HandshakeLowering::connectToMemory().