My Project
|
#include <PatternMatch.h>
Public Member Functions | |
virtual void | rewrite (Operation *op, std::unique_ptr< PatternState > state, PatternRewriter &rewriter) const |
virtual void | rewrite (Operation *op, PatternRewriter &rewriter) const |
PatternMatchResult | match (Operation *op) const override |
virtual PatternMatchResult | matchAndRewrite (Operation *op, PatternRewriter &rewriter) const |
ArrayRef< OperationName > | getGeneratedOps () const |
Public Member Functions inherited from mlir::Pattern | |
PatternBenefit | getBenefit () const |
OperationName | getRootKind () const |
virtual | ~Pattern () |
PatternMatchResult | matchSuccess (std::unique_ptr< PatternState > state={}) const |
This method indicates that a match was found and has the specified cost. More... | |
Protected Member Functions | |
RewritePattern (StringRef rootName, PatternBenefit benefit, MLIRContext *context) | |
RewritePattern (StringRef rootName, ArrayRef< StringRef > generatedNames, PatternBenefit benefit, MLIRContext *context) | |
Protected Member Functions inherited from mlir::Pattern | |
Pattern (StringRef rootName, PatternBenefit benefit, MLIRContext *context) | |
Protected Attributes | |
SmallVector< OperationName, 2 > | generatedOps |
Additional Inherited Members | |
Static Public Member Functions inherited from mlir::Pattern | |
static PatternMatchResult | matchFailure () |
This method indicates that no match was found. More... | |
RewritePattern is the common base class for all DAG to DAG replacements. There are two possible usages of this class:
|
inlineprotected |
Patterns must specify the root operation name they match against, and can also specify the benefit of the pattern matching.
|
protected |
Patterns must specify the root operation name they match against, and can also specify the benefit of the pattern matching. They can also specify the names of operations that may be generated during a successful rewrite.
|
inline |
Return a list of operations that may be generated when rewriting an operation instance with this pattern.
|
overridevirtual |
Attempt to match against code rooted at the specified operation, which is the same operation code as getRootKind(). On failure, this returns a None value. On success, it returns a (possibly null) pattern-specific state wrapped in an Optional. This state is passed back into the rewrite function if this match is selected.
Implements mlir::Pattern.
Reimplemented in mlir::OpRewritePattern< SourceOp >, mlir::OpRewritePattern< FakeQuantOp >, mlir::OpRewritePattern< CopyOp >, mlir::OpRewritePattern< IndexedGenericOp >, mlir::OpRewritePattern< vector::TupleGetOp >, mlir::OpRewritePattern< InsertStridedSliceOp >, mlir::OpRewritePattern< LinalgOp >, mlir::OpRewritePattern< vector::TransferReadOp >, mlir::OpRewritePattern< StridedSliceOp >, and mlir::OpRewritePattern< vector::TransferWriteOp >.
|
inlinevirtual |
Attempt to match against code rooted at the specified operation, which is the same operation code as getRootKind(). If successful, this function will automatically perform the rewrite.
Reimplemented in FoldAffineOp, LinalgRewritePattern< LoopType, IndexedValueType, ConcreteOp >, mlir::OpRewritePattern< SourceOp >, mlir::OpRewritePattern< FakeQuantOp >, mlir::OpRewritePattern< CopyOp >, mlir::OpRewritePattern< IndexedGenericOp >, mlir::OpRewritePattern< vector::TupleGetOp >, mlir::OpRewritePattern< InsertStridedSliceOp >, mlir::OpRewritePattern< LinalgOp >, mlir::OpRewritePattern< vector::TransferReadOp >, mlir::OpRewritePattern< StridedSliceOp >, mlir::OpRewritePattern< vector::TransferWriteOp >, and mlir::ConversionPattern.
|
virtual |
Rewrite the IR rooted at the specified operation with the result of this pattern, generating any new operations with the specified rewriter. If an unexpected error is encountered (an internal compiler error), it is emitted through the normal MLIR diagnostic hooks and the IR is left in a valid state.
Reimplemented in mlir::OpRewritePattern< SourceOp >, mlir::OpRewritePattern< FakeQuantOp >, mlir::OpRewritePattern< CopyOp >, mlir::OpRewritePattern< IndexedGenericOp >, mlir::OpRewritePattern< vector::TupleGetOp >, mlir::OpRewritePattern< InsertStridedSliceOp >, mlir::OpRewritePattern< LinalgOp >, mlir::OpRewritePattern< vector::TransferReadOp >, mlir::OpRewritePattern< StridedSliceOp >, and mlir::OpRewritePattern< vector::TransferWriteOp >.
|
virtual |
Rewrite the IR rooted at the specified operation with the result of this pattern, generating any new operations with the specified builder. If an unexpected error is encountered (an internal compiler error), it is emitted through the normal MLIR diagnostic hooks and the IR is left in a valid state.
Reimplemented in mlir::OpRewritePattern< SourceOp >, mlir::OpRewritePattern< FakeQuantOp >, mlir::OpRewritePattern< CopyOp >, mlir::OpRewritePattern< IndexedGenericOp >, mlir::OpRewritePattern< vector::TupleGetOp >, mlir::OpRewritePattern< InsertStridedSliceOp >, mlir::OpRewritePattern< LinalgOp >, mlir::OpRewritePattern< vector::TransferReadOp >, mlir::OpRewritePattern< StridedSliceOp >, and mlir::OpRewritePattern< vector::TransferWriteOp >.
|
protected |
A list of the potential operations that may be generated when rewriting an op with this pattern.