MLIR  16.0.0git
Public Types | Public Member Functions | List of all members
mlir::linalg::LinalgTransformationFilter Struct Reference

Helper class to control application of linalg transformation patterns. More...

#include "mlir/Dialect/Linalg/Transforms/Transforms.h"

Public Types

using FilterFunction = std::function< LogicalResult(Operation *)>
 

Public Member Functions

 LinalgTransformationFilter (ArrayRef< StringAttr > matchDisjunction={}, Optional< StringAttr > replacement=None)
 
 LinalgTransformationFilter (const FilterFunction &f, ArrayRef< StringAttr > matchDisjunction={}, Optional< StringAttr > replacement=None)
 
 LinalgTransformationFilter (LinalgTransformationFilter &&)=default
 
 LinalgTransformationFilter (const LinalgTransformationFilter &)=default
 
LogicalResult checkAndNotify (PatternRewriter &rewriter, Operation *op) const
 
void replaceLinalgTransformationFilter (PatternRewriter &rewriter, Operation *op) const
 
bool hasReplacementFilter (Operation *op) const
 
LinalgTransformationFilteraddFilter (const FilterFunction &f)
 
template<typename... OpTypes>
LinalgTransformationFilteraddOpFilter ()
 
LinalgTransformationFilteraddOpNameFilter (StringRef opName)
 
LinalgTransformationFiltersetMatchByDefault ()
 

Detailed Description

Helper class to control application of linalg transformation patterns.

Control comes in 2 forms:

  1. attribute matching and setting behavior using the attribute named kLinalgTransformMarker. This can be used to build a state machine using attributes and incrementally applying patterns to advance states.
  2. filter function, which is a simple lambda on the Operation* that returns a LogicalResult.

Definition at line 388 of file Transforms.h.

Member Typedef Documentation

◆ FilterFunction

Definition at line 389 of file Transforms.h.

Constructor & Destructor Documentation

◆ LinalgTransformationFilter() [1/4]

mlir::linalg::LinalgTransformationFilter::LinalgTransformationFilter ( ArrayRef< StringAttr >  matchDisjunction = {},
Optional< StringAttr >  replacement = None 
)
explicit

Definition at line 54 of file Transforms.cpp.

◆ LinalgTransformationFilter() [2/4]

mlir::linalg::LinalgTransformationFilter::LinalgTransformationFilter ( const FilterFunction f,
ArrayRef< StringAttr >  matchDisjunction = {},
Optional< StringAttr >  replacement = None 
)
explicit

Definition at line 59 of file Transforms.cpp.

◆ LinalgTransformationFilter() [3/4]

mlir::linalg::LinalgTransformationFilter::LinalgTransformationFilter ( LinalgTransformationFilter &&  )
default

◆ LinalgTransformationFilter() [4/4]

mlir::linalg::LinalgTransformationFilter::LinalgTransformationFilter ( const LinalgTransformationFilter )
default

Member Function Documentation

◆ addFilter()

LinalgTransformationFilter& mlir::linalg::LinalgTransformationFilter::addFilter ( const FilterFunction f)
inline

Definition at line 406 of file Transforms.h.

◆ addOpFilter()

template<typename... OpTypes>
LinalgTransformationFilter& mlir::linalg::LinalgTransformationFilter::addOpFilter ( )
inline

Definition at line 413 of file Transforms.h.

References mlir::success().

◆ addOpNameFilter()

LinalgTransformationFilter& mlir::linalg::LinalgTransformationFilter::addOpNameFilter ( StringRef  opName)
inline

◆ checkAndNotify()

LogicalResult mlir::linalg::LinalgTransformationFilter::checkAndNotify ( PatternRewriter rewriter,
Operation op 
) const

◆ hasReplacementFilter()

bool mlir::linalg::LinalgTransformationFilter::hasReplacementFilter ( Operation op) const

◆ replaceLinalgTransformationFilter()

void mlir::linalg::LinalgTransformationFilter::replaceLinalgTransformationFilter ( PatternRewriter rewriter,
Operation op 
) const

◆ setMatchByDefault()

LinalgTransformationFilter& mlir::linalg::LinalgTransformationFilter::setMatchByDefault ( )
inline

Definition at line 424 of file Transforms.h.


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