My Project
|
#include <PatternMatch.h>
Public Member Functions | |
OpRewritePattern (MLIRContext *context, PatternBenefit benefit=1) | |
void | rewrite (Operation *op, std::unique_ptr< PatternState > state, PatternRewriter &rewriter) const final |
Wrappers around the RewritePattern methods that pass the derived op type. More... | |
void | rewrite (Operation *op, PatternRewriter &rewriter) const final |
PatternMatchResult | match (Operation *op) const final |
PatternMatchResult | matchAndRewrite (Operation *op, PatternRewriter &rewriter) const final |
virtual void | rewrite (SourceOp op, std::unique_ptr< PatternState > state, PatternRewriter &rewriter) const |
virtual void | rewrite (SourceOp op, PatternRewriter &rewriter) const |
virtual PatternMatchResult | match (SourceOp op) const |
virtual PatternMatchResult | matchAndRewrite (SourceOp op, PatternRewriter &rewriter) const |
Public Member Functions inherited from mlir::RewritePattern | |
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... | |
Additional Inherited Members | |
Static Public Member Functions inherited from mlir::Pattern | |
static PatternMatchResult | matchFailure () |
This method indicates that no match was found. More... | |
Protected Member Functions inherited from mlir::RewritePattern | |
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 inherited from mlir::RewritePattern | |
SmallVector< OperationName, 2 > | generatedOps |
OpRewritePattern is a wrapper around RewritePattern that allows for matching and rewriting against an instance of a derived operation class as opposed to a raw Operation.
|
inline |
Patterns must specify the root operation name they match against, and can also specify the benefit of the pattern matching.
|
inlinefinalvirtual |
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.
Reimplemented from mlir::RewritePattern.
|
inlinevirtual |
|
inlinefinalvirtual |
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 from mlir::RewritePattern.
|
inlinevirtual |
Reimplemented in VectorStridedSliceOpConversion, TupleGetFolderOp, SplitTransferWriteOp, VectorInsertStridedSliceOpSameRankRewritePattern, SplitTransferReadOp, VectorInsertStridedSliceOpDifferentRankRewritePattern, CopyTransposeConversion, LinalgOpConversion< IndexedGenericOp >, LinalgOpConversion< CopyOp >, LinalgOpConversion< LinalgOp >, and FakeQuantRewrite< ConcreteRewriteClass, FakeQuantOp >.
|
inlinefinalvirtual |
Wrappers around the RewritePattern methods that pass the derived op type.
Reimplemented from mlir::RewritePattern.
|
inlinefinalvirtual |
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 from mlir::RewritePattern.
|
inlinevirtual |
Rewrite and Match methods that operate on the SourceOp type. These must be overridden by the derived pattern class.
|
inlinevirtual |