MLIR  19.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase > Class Template Reference

Base class for transform dialect interpreter passes that can consume and dump transform dialect scripts in separate files. More...

#include "mlir/Dialect/Transform/Transforms/TransformInterpreterPassBase.h"

+ Inheritance diagram for mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >:

Public Member Functions

 TransformInterpreterPassBase (const TransformOptions &options=TransformOptions())
 
 TransformInterpreterPassBase (const TransformInterpreterPassBase &pass)
 
LogicalResult initialize (MLIRContext *context) override
 
LogicalResult runBeforeInterpreter (Operation *)
 Hook for passes to run additional logic in the pass before the interpreter. More...
 
LogicalResult runAfterInterpreter (Operation *)
 Hook for passes to run additional logic in the pass after the interpreter. More...
 
std::optional< LogicalResultconstructTransformModule (OpBuilder &builder, Location loc)
 Hook for passes to run custom logic to construct the transform module. More...
 
void runOnOperation () override
 

Static Public Member Functions

static StringLiteral getBinaryName ()
 

Protected Member Functions

const std::shared_ptr< OwningOpRef< ModuleOp > > & getSharedTransformModule () const
 Returns a read-only reference to shared transform module. More...
 
const std::shared_ptr< OwningOpRef< ModuleOp > > & getTransformLibraryModule () const
 Returns a read-only reference to the transform library module. More...
 

Protected Attributes

TransformOptions options
 Transform interpreter options. More...
 

Detailed Description

template<typename Concrete, template< typename > typename GeneratedBase>
class mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >

Base class for transform dialect interpreter passes that can consume and dump transform dialect scripts in separate files.

The pass is controlled by three string options:

The pass runs the transform dialect interpreter as directed by the options. It also provides the mechanism to dump reproducers into stderr (-debug-only=transform-dialect-dump-repro) or into a temporary file (-debug-only=transform-dialect-save-repro) that can be used with this pass in a standalone mode.

Concrete passes must derive from this class instead of their generated base class (or PassWrapper), and supply themselves and the generated base class as template arguments. They are not expected to to implement initialize or runOnOperation. They are expected to call the copy constructor of this class in their copy constructors, short of which the file-based transform dialect script injection facility will become non-operational.

Concrete passes may implement the runBeforeInterpreter and runAfterInterpreter to customize the behavior of the pass.

Definition at line 96 of file TransformInterpreterPassBase.h.

Constructor & Destructor Documentation

◆ TransformInterpreterPassBase() [1/2]

template<typename Concrete , template< typename > typename GeneratedBase>
mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::TransformInterpreterPassBase ( const TransformOptions options = TransformOptions())
inlineexplicit

Definition at line 98 of file TransformInterpreterPassBase.h.

◆ TransformInterpreterPassBase() [2/2]

template<typename Concrete , template< typename > typename GeneratedBase>
mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::TransformInterpreterPassBase ( const TransformInterpreterPassBase< Concrete, GeneratedBase > &  pass)
inline

Member Function Documentation

◆ constructTransformModule()

template<typename Concrete , template< typename > typename GeneratedBase>
std::optional<LogicalResult> mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::constructTransformModule ( OpBuilder builder,
Location  loc 
)
inline

Hook for passes to run custom logic to construct the transform module.

This will run during initialization. If the external script is provided, it overrides the construction, which will not be called.

Definition at line 162 of file TransformInterpreterPassBase.h.

Referenced by mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::initialize().

◆ getBinaryName()

template<typename Concrete , template< typename > typename GeneratedBase>
static StringLiteral mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::getBinaryName ( )
inlinestatic

Definition at line 108 of file TransformInterpreterPassBase.h.

◆ getSharedTransformModule()

template<typename Concrete , template< typename > typename GeneratedBase>
const std::shared_ptr<OwningOpRef<ModuleOp> >& mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::getSharedTransformModule ( ) const
inlineprotected

Returns a read-only reference to shared transform module.

Definition at line 189 of file TransformInterpreterPassBase.h.

◆ getTransformLibraryModule()

template<typename Concrete , template< typename > typename GeneratedBase>
const std::shared_ptr<OwningOpRef<ModuleOp> >& mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::getTransformLibraryModule ( ) const
inlineprotected

Returns a read-only reference to the transform library module.

Definition at line 195 of file TransformInterpreterPassBase.h.

◆ initialize()

template<typename Concrete , template< typename > typename GeneratedBase>
LogicalResult mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::initialize ( MLIRContext context)
inlineoverride

◆ runAfterInterpreter()

template<typename Concrete , template< typename > typename GeneratedBase>
LogicalResult mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::runAfterInterpreter ( Operation )
inline

Hook for passes to run additional logic in the pass after the interpreter.

Only runs if everything succeeded before. If failure is returned, the pass fails.

Definition at line 157 of file TransformInterpreterPassBase.h.

References mlir::success().

◆ runBeforeInterpreter()

template<typename Concrete , template< typename > typename GeneratedBase>
LogicalResult mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::runBeforeInterpreter ( Operation )
inline

Hook for passes to run additional logic in the pass before the interpreter.

If failure is returned, the pass fails and the interpreter is not run.

Definition at line 152 of file TransformInterpreterPassBase.h.

References mlir::success().

◆ runOnOperation()

template<typename Concrete , template< typename > typename GeneratedBase>
void mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::runOnOperation ( )
inlineoverride

Definition at line 167 of file TransformInterpreterPassBase.h.

Member Data Documentation

◆ options

template<typename Concrete , template< typename > typename GeneratedBase>
TransformOptions mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::options
protected

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