My Project
|
#include <PatternMatch.h>
Public Member Functions | |
PatternBenefit | getBenefit () const |
OperationName | getRootKind () const |
virtual PatternMatchResult | match (Operation *op) const =0 |
virtual | ~Pattern () |
PatternMatchResult | matchSuccess (std::unique_ptr< PatternState > state={}) const |
This method indicates that a match was found and has the specified cost. More... | |
Static Public Member Functions | |
static PatternMatchResult | matchFailure () |
This method indicates that no match was found. More... | |
Protected Member Functions | |
Pattern (StringRef rootName, PatternBenefit benefit, MLIRContext *context) | |
Instances of Pattern can be matched against SSA IR. These matches get used in ways dependent on their subclasses and the driver doing the matching. For example, RewritePatterns implement a rewrite from one matched pattern to a replacement DAG tile.
|
inlinevirtual |
|
protected |
Patterns must specify the root operation name they match against, and can also specify the benefit of the pattern matching.
|
inline |
Return the benefit (the inverse of "cost") of matching this pattern. The benefit of a Pattern is always static - rewrites that may have dynamic benefit can be instantiated multiple times (different Pattern instances) for each benefit that they may return, and be guarded by different match condition predicates.
|
inline |
Return the root node that this pattern matches. Patterns that can match multiple root types are instantiated once per root.
|
pure virtual |
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.
Implemented 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 >, mlir::OpRewritePattern< vector::TransferWriteOp >, and mlir::RewritePattern.
|
inlinestatic |
This method indicates that no match was found.
|
inline |
This method indicates that a match was found and has the specified cost.