MLIR  20.0.0git
Public Types | Public Attributes | List of all members
mlir::scf::PipeliningOption Struct Reference

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
 

Detailed Description

Options to dictate how loops should be pipelined.

Definition at line 123 of file Transforms.h.

Member Typedef Documentation

◆ AnnotationlFnType

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.

◆ GetScheduleFnType

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.

◆ PredicateOpFn

Definition at line 163 of file Transforms.h.

Member Enumeration Documentation

◆ PipelinerPart

Enumerator
Prologue 
Kernel 
Epilogue 

Definition at line 129 of file Transforms.h.

Member Data Documentation

◆ annotateFn

AnnotationlFnType mlir::scf::PipeliningOption::annotateFn = nullptr

Definition at line 142 of file Transforms.h.

◆ getScheduleFn

GetScheduleFnType mlir::scf::PipeliningOption::getScheduleFn = nullptr

Definition at line 128 of file Transforms.h.

◆ peelEpilogue

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.

◆ predicateFn

PredicateOpFn mlir::scf::PipeliningOption::predicateFn = nullptr

Definition at line 165 of file Transforms.h.

◆ supportDynamicLoops

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.


The documentation for this struct was generated from the following file: