update tabalegen description for all operations and passes
This commit is contained in:
parent
1353100dad
commit
13f6f83120
|
@ -10,9 +10,10 @@ include "mlir/Pass/PassBase.td"
|
||||||
def QoREstimation : Pass<"qor-estimation", "ModuleOp"> {
|
def QoREstimation : Pass<"qor-estimation", "ModuleOp"> {
|
||||||
let summary = "Estimate the performance and resource utilization";
|
let summary = "Estimate the performance and resource utilization";
|
||||||
let description = [{
|
let description = [{
|
||||||
This qor-estimation pass will analyze the input CDFG and pragma operations
|
This qor-estimation pass will analyze the input IR and estimate the latency
|
||||||
(if applied) for estimating performance and resource utilization of the HLS
|
and resource utilization of HLS C++ synthesis. This pass will take all
|
||||||
results.
|
dependency and resource constraints and pragma settings into consideration,
|
||||||
|
and conduct the estimation through an ALAP scheduling.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createQoREstimationPass()";
|
let constructor = "mlir::scalehls::createQoREstimationPass()";
|
||||||
|
|
|
@ -14,8 +14,9 @@ include "mlir/Pass/PassBase.td"
|
||||||
def LegalizeToHLSCpp : Pass<"legalize-to-hlscpp", "FuncOp"> {
|
def LegalizeToHLSCpp : Pass<"legalize-to-hlscpp", "FuncOp"> {
|
||||||
let summary = "Convert to emittable MLIR code";
|
let summary = "Convert to emittable MLIR code";
|
||||||
let description = [{
|
let description = [{
|
||||||
This legalize-to-hlscpp converts MLIR code in Affine/Standard/SCF level to
|
This legalize-to-hlscpp pass will legalize the input IR to make it
|
||||||
emittable and estimatable MLIR code.
|
emittable. Meanwhile, this pass will set some default pragmas for the
|
||||||
|
convenience of the subsequent transforms and analysis.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createLegalizeToHLSCppPass()";
|
let constructor = "mlir::scalehls::createLegalizeToHLSCppPass()";
|
||||||
|
@ -29,8 +30,8 @@ def LegalizeToHLSCpp : Pass<"legalize-to-hlscpp", "FuncOp"> {
|
||||||
def HLSKernelToAffine : Pass<"hlskernel-to-affine", "FuncOp"> {
|
def HLSKernelToAffine : Pass<"hlskernel-to-affine", "FuncOp"> {
|
||||||
let summary = "Convert HLSKernel operation to Affine loops";
|
let summary = "Convert HLSKernel operation to Affine loops";
|
||||||
let description = [{
|
let description = [{
|
||||||
This hlskernel-to-affine converts HLSKernel operations to their Affine level
|
This hlskernel-to-affine pass converts HLSKernel operations to their Affine
|
||||||
representations.
|
level representations.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createHLSKernelToAffinePass()";
|
let constructor = "mlir::scalehls::createHLSKernelToAffinePass()";
|
||||||
|
|
|
@ -11,11 +11,11 @@ def HLSCppDialect : Dialect {
|
||||||
let name = "hlscpp";
|
let name = "hlscpp";
|
||||||
let summary = "An HLSCpp out-of-tree MLIR dialect";
|
let summary = "An HLSCpp out-of-tree MLIR dialect";
|
||||||
let description = [{
|
let description = [{
|
||||||
This dialect contains dedicated operations, interfaces, and passes designed
|
This dialect contains dedicated operations, attributes, and passes designed
|
||||||
for representing HLS C++ specific structures and components in MLIR, while
|
for representing HLS C++ specific structures and components in MLIR, while
|
||||||
enabling comprehensive optimization for both performance and area. Passes
|
enabling comprehensive optimization for both performance and area. Passes
|
||||||
in this dialect can optimize and generate IRs, which can be translated to
|
in this dialect can optimize and generate IRs, which can then be translated
|
||||||
synthesizable HLS C++ code by EmitHLSCpp tool.
|
to synthesizable HLS C++ code by scalehls-translate tool.
|
||||||
}];
|
}];
|
||||||
let cppNamespace = "::mlir::scalehls::hlscpp";
|
let cppNamespace = "::mlir::scalehls::hlscpp";
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
#define SCALEHLS_DIALECT_HLSCPP_STRUCTUREOPS_TD
|
#define SCALEHLS_DIALECT_HLSCPP_STRUCTUREOPS_TD
|
||||||
|
|
||||||
def AssignOp : HLSCppOp<"assign", [SameOperandsAndResultType]> {
|
def AssignOp : HLSCppOp<"assign", [SameOperandsAndResultType]> {
|
||||||
let summary = "Assign input value to the output";
|
let summary = "Assign the input value to the output";
|
||||||
let description = [{
|
let description = [{
|
||||||
This hlscpp.assign operation assigns the input value to the output, and can
|
This hlscpp.assign operation assigns the input value to the output, and can
|
||||||
be inserted anywhere without changing the original semantic. This is useful
|
be inserted anywhere without changing the original semantic. This is useful
|
||||||
for EmitHLSCpp to handle some weird corner cases (e.g. the operand of return
|
for EmitHLSCpp to handle some weird corner cases (e.g., the operand of
|
||||||
operation is function argument, and etc).
|
return operation is function argument, etc.).
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let arguments = (ins AnyType : $input);
|
let arguments = (ins AnyType : $input);
|
||||||
|
|
|
@ -12,11 +12,11 @@ include "mlir/Pass/PassBase.td"
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
def ArrayPartition : Pass<"array-partition", "FuncOp"> {
|
def ArrayPartition : Pass<"array-partition", "FuncOp"> {
|
||||||
let summary = "Apply optimized array partition optimization";
|
let summary = "Apply optimized array partition strategy";
|
||||||
let description = [{
|
let description = [{
|
||||||
This array-partition pass will automatically search for the best array
|
This array-partition pass will automatically search for the best array
|
||||||
partition solution of each on-chip memory instance and insert array
|
partition solution for each on-chip memory instance and apply the solution
|
||||||
partition pragmas.
|
through changing the layout AffineMap of the corresponding MemRefType.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createArrayPartitionPass()";
|
let constructor = "mlir::scalehls::createArrayPartitionPass()";
|
||||||
|
@ -25,8 +25,8 @@ def ArrayPartition : Pass<"array-partition", "FuncOp"> {
|
||||||
def LoopPipelining : Pass<"loop-pipelining", "FuncOp"> {
|
def LoopPipelining : Pass<"loop-pipelining", "FuncOp"> {
|
||||||
let summary = "Apply loop pipelining";
|
let summary = "Apply loop pipelining";
|
||||||
let description = [{
|
let description = [{
|
||||||
This loop-pipelining pass will insert pipeline pragma to the innermost n-th
|
This loop-pipelining pass will insert pipeline pragma to the target loop
|
||||||
loop level, and automatically unroll all inner loops.
|
level, and automatically unroll all inner loops.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createLoopPipeliningPass()";
|
let constructor = "mlir::scalehls::createLoopPipeliningPass()";
|
||||||
|
@ -38,13 +38,13 @@ def LoopPipelining : Pass<"loop-pipelining", "FuncOp"> {
|
||||||
}
|
}
|
||||||
|
|
||||||
def PragmaDSE : Pass<"pragma-dse", "ModuleOp"> {
|
def PragmaDSE : Pass<"pragma-dse", "ModuleOp"> {
|
||||||
let summary = "Optimize pragma configuration of each optimizable region";
|
let summary = "Optimize pragma configurations";
|
||||||
let description = [{
|
let description = [{
|
||||||
This pragma-dse pass will automatically tune HLS pragma insertion and
|
This pragma-dse pass will automatically tune HLS pragma insertion and
|
||||||
configuration for performance and area optimization. By calling methods
|
configuration for performance and area optimization. By calling methods
|
||||||
provided by hlscpp-qor-estimation, this pass is able to rapidly obtain the
|
provided by qor-estimation, this pass is able to rapidly obtain the QoR
|
||||||
QoR estimation of the current design point, and feed it back to the design
|
estimation of the current design point, and feed it back to the design space
|
||||||
space exploration engine for an efficient convergence.
|
exploration engine for an efficient convergence.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createPragmaDSEPass()";
|
let constructor = "mlir::scalehls::createPragmaDSEPass()";
|
||||||
|
@ -59,8 +59,8 @@ def AffineLoopPerfection : Pass<"affine-loop-perfection", "FuncOp"> {
|
||||||
let description = [{
|
let description = [{
|
||||||
This affine-loop-perfection pass will try to perfect all affine loops.
|
This affine-loop-perfection pass will try to perfect all affine loops.
|
||||||
Specifically, this pass will move operations under non-innermost loops into
|
Specifically, this pass will move operations under non-innermost loops into
|
||||||
innermost loop and create affine if regions to ensure the correctness of the
|
innermost loop and create AffineIf regions to ensure the correctness of the
|
||||||
movement.
|
transformation.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createAffineLoopPerfectionPass()";
|
let constructor = "mlir::scalehls::createAffineLoopPerfectionPass()";
|
||||||
|
@ -69,9 +69,9 @@ def AffineLoopPerfection : Pass<"affine-loop-perfection", "FuncOp"> {
|
||||||
def PartialAffineLoopTile : Pass<"partial-affine-loop-tile", "FuncOp"> {
|
def PartialAffineLoopTile : Pass<"partial-affine-loop-tile", "FuncOp"> {
|
||||||
let summary = "Partially tile affine nested loops";
|
let summary = "Partially tile affine nested loops";
|
||||||
let description = [{
|
let description = [{
|
||||||
This partial-affine-loop-tile pass will try to tile the nested loops. The
|
This partial-affine-loop-tile pass will try to tile all affine nested loops.
|
||||||
difference with the official affine-loop-tile pass is this pass will only
|
The difference with the official affine-loop-tile pass is this pass will
|
||||||
tile the first "tileLevel" outermost loop levels rather than all loops
|
only tile the first "tileLevel" outermost loop levels rather than all loops
|
||||||
levels.
|
levels.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
@ -89,9 +89,9 @@ def RemoveVariableBound : Pass<"remove-variable-bound", "FuncOp"> {
|
||||||
let summary = "Try to remove variable loop bounds";
|
let summary = "Try to remove variable loop bounds";
|
||||||
let description = [{
|
let description = [{
|
||||||
This remove-variable-bound pass will try to remove the variable loop bounds.
|
This remove-variable-bound pass will try to remove the variable loop bounds.
|
||||||
Specifically, this is only possible when the variable loop bound is an
|
Specifically, this is only feasible when the loop bound is an affine
|
||||||
affine expression of induction variables of other loops with constant lower
|
expression of induction variables of other loops with constant lower and
|
||||||
or upper bound.
|
upper bound.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createRemoveVariableBoundPass()";
|
let constructor = "mlir::scalehls::createRemoveVariableBoundPass()";
|
||||||
|
@ -101,35 +101,35 @@ def RemoveVariableBound : Pass<"remove-variable-bound", "FuncOp"> {
|
||||||
// Dataflow Optimization Passes
|
// Dataflow Optimization Passes
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
def SplitFunction : Pass<"split-function", "ModuleOp"> {
|
|
||||||
let summary = "Split function for enabling dataflow";
|
|
||||||
let description = [{
|
|
||||||
This split-function pass should be applied in HLSKernel level. This pass
|
|
||||||
will split each HLSKernel operation into a separate function for applying
|
|
||||||
dataflow pragma to the top function.
|
|
||||||
}];
|
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createSplitFunctionPass()";
|
|
||||||
}
|
|
||||||
|
|
||||||
def LegalizeDataflow : Pass<"legalize-dataflow", "FuncOp"> {
|
def LegalizeDataflow : Pass<"legalize-dataflow", "FuncOp"> {
|
||||||
let summary = "Legalize code for the dataflow pragma";
|
let summary = "Legalize the dataflow scheduling";
|
||||||
let description = [{
|
let description = [{
|
||||||
This legalize-dataflow pass will legalize the dataflow by inserting some
|
This legalize-dataflow pass will legalize the dataflow scheduling to meet
|
||||||
dummy nodes and grouping nodes in the same level to meet the requirements of
|
the requirements of the dataflow pragma: 1) single-producer single-consumer;
|
||||||
the dataflow pragma: 1) single-producer single-consumer 2) no bypass.
|
2) no bypass paths.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createLegalizeDataflowPass()";
|
let constructor = "mlir::scalehls::createLegalizeDataflowPass()";
|
||||||
|
|
||||||
let options = [
|
let options = [
|
||||||
Option<"insertCopy", "insert-copy", "bool", /*default=*/"true",
|
Option<"insertCopy", "insert-copy", "bool", /*default=*/"true",
|
||||||
"Whether insert copy to break bypass paths">,
|
"Whether insert copy operations to break bypass paths">,
|
||||||
Option<"minGran", "min-gran", "unsigned", /*default=*/"1",
|
Option<"minGran", "min-gran", "unsigned", /*default=*/"1",
|
||||||
"Positive number: the minimum granularity of dataflow">
|
"Positive number: the minimum granularity of dataflow">
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def SplitFunction : Pass<"split-function", "ModuleOp"> {
|
||||||
|
let summary = "Split function for enabling the dataflow pragma";
|
||||||
|
let description = [{
|
||||||
|
This split-function pass will split operations/loops scheduled at the same
|
||||||
|
dataflow level into a separate sub-function for applying the dataflow pragma
|
||||||
|
to the top function.
|
||||||
|
}];
|
||||||
|
|
||||||
|
let constructor = "mlir::scalehls::createSplitFunctionPass()";
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Bufferization Passes
|
// Bufferization Passes
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -150,8 +150,8 @@ def HLSKernelBufferize : Pass<"hlskernel-bufferize", "FuncOp"> {
|
||||||
def AffineStoreForward : Pass<"affine-store-forward", "FuncOp"> {
|
def AffineStoreForward : Pass<"affine-store-forward", "FuncOp"> {
|
||||||
let summary = "Forward store to load, including conditional stores";
|
let summary = "Forward store to load, including conditional stores";
|
||||||
let description = [{
|
let description = [{
|
||||||
This affine-store-forward pass is similar to memref-dataflow-opt, but support to
|
This affine-store-forward pass is similar to memref-dataflow-opt, but
|
||||||
forward stores in if statements.
|
supports to forward stores located in AffineIf regions.
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let constructor = "mlir::scalehls::createAffineStoreForwardPass()";
|
let constructor = "mlir::scalehls::createAffineStoreForwardPass()";
|
||||||
|
|
Loading…
Reference in New Issue