MLIR
20.0.0git
|
Options to dictate how loops should be pipelined. More...
#include "mlir/Dialect/SCF/Transforms/Transforms.h"
Public Types | |
enum class | PipelinerPart { Prologue , Kernel , Epilogue } |
using | GetScheduleFnType = std::function< void(scf::ForOp, std::vector< std::pair< Operation *, unsigned > > &)> |
Lambda returning all the operation in the forOp, with their stage, in the order picked for the pipelined loop. More... | |
using | AnnotationlFnType = std::function< void(Operation *, PipelinerPart, unsigned)> |
Lambda called by the pipeliner to allow the user to annotate the IR while it is generated. More... | |
using | PredicateOpFn = std::function< Operation *(RewriterBase &, Operation *, Value)> |
Public Attributes | |
GetScheduleFnType | getScheduleFn = nullptr |
AnnotationlFnType | annotateFn = nullptr |
bool | peelEpilogue = true |
Control whether the epilogue should be peeled out of the loop or operations should be predicated to skip the early stages in the last loop iterations. More... | |
bool | supportDynamicLoops = false |
Control whether the transformation checks that the number of iterations is greater or equal to the number of stages and skip the transformation if this is not the case. More... | |
PredicateOpFn | predicateFn = nullptr |
Options to dictate how loops should be pipelined.
Definition at line 123 of file Transforms.h.
using mlir::scf::PipeliningOption::AnnotationlFnType = std::function<void(Operation *, PipelinerPart, unsigned)> |
Lambda called by the pipeliner to allow the user to annotate the IR while it is generated.
The callback passes the operation created along with the part of the pipeline and the iteration index. The iteration index is always 0 for the kernel. For the prologue and epilogue, it corresponds to the iteration peeled out of the loop in the range [0, maxStage[.
Definition at line 140 of file Transforms.h.
using mlir::scf::PipeliningOption::GetScheduleFnType = std::function<void( scf::ForOp, std::vector<std::pair<Operation *, unsigned> > &)> |
Lambda returning all the operation in the forOp, with their stage, in the order picked for the pipelined loop.
Definition at line 126 of file Transforms.h.
using mlir::scf::PipeliningOption::PredicateOpFn = std::function<Operation *(RewriterBase &, Operation *, Value)> |
Definition at line 163 of file Transforms.h.
|
strong |
Enumerator | |
---|---|
Prologue | |
Kernel | |
Epilogue |
Definition at line 129 of file Transforms.h.
AnnotationlFnType mlir::scf::PipeliningOption::annotateFn = nullptr |
Definition at line 142 of file Transforms.h.
GetScheduleFnType mlir::scf::PipeliningOption::getScheduleFn = nullptr |
Definition at line 128 of file Transforms.h.
bool mlir::scf::PipeliningOption::peelEpilogue = true |
Control whether the epilogue should be peeled out of the loop or operations should be predicated to skip the early stages in the last loop iterations.
If the epilogue is predicated; the user needs to provide a lambda to generate the predicated version of operations.
Definition at line 148 of file Transforms.h.
PredicateOpFn mlir::scf::PipeliningOption::predicateFn = nullptr |
Definition at line 165 of file Transforms.h.
bool mlir::scf::PipeliningOption::supportDynamicLoops = false |
Control whether the transformation checks that the number of iterations is greater or equal to the number of stages and skip the transformation if this is not the case.
If the loop is dynamic and this is set to true and the loop bounds are not static the pipeliner will have to predicate operations in the the prologue/epilogue.
Definition at line 155 of file Transforms.h.