MLIR
21.0.0git
|
#include "mlir/IR/PatternMatch.h"
Public Member Functions | |
RewritePatternSet (MLIRContext *context) | |
RewritePatternSet (MLIRContext *context, std::unique_ptr< RewritePattern > pattern) | |
Construct a RewritePatternSet populated with the given pattern. More... | |
RewritePatternSet (PDLPatternModule &&pattern) | |
MLIRContext * | getContext () const |
NativePatternListT & | getNativePatterns () |
Return the native patterns held in this list. More... | |
PDLPatternModule & | getPDLPatterns () |
Return the PDL patterns held in this list. More... | |
void | clear () |
Clear out all of the held patterns in this list. More... | |
template<typename... Ts, typename ConstructorArg , typename... ConstructorArgs, typename = std::enable_if_t<sizeof...(Ts) != 0>> | |
RewritePatternSet & | add (ConstructorArg &&arg, ConstructorArgs &&...args) |
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments. More... | |
template<typename... Ts, typename ConstructorArg , typename... ConstructorArgs, typename = std::enable_if_t<sizeof...(Ts) != 0>> | |
RewritePatternSet & | addWithLabel (ArrayRef< StringRef > debugLabels, ConstructorArg &&arg, ConstructorArgs &&...args) |
An overload of the above add method that allows for attaching a set of debug labels to the attached patterns. More... | |
template<typename... Ts> | |
RewritePatternSet & | add () |
Add an instance of each of the pattern types 'Ts'. More... | |
RewritePatternSet & | add (std::unique_ptr< RewritePattern > pattern) |
Add the given native pattern to the pattern list. More... | |
RewritePatternSet & | add (PDLPatternModule &&pattern) |
Add the given PDL pattern to the pattern list. More... | |
template<typename OpType > | |
RewritePatternSet & | add (LogicalResult(*implFn)(OpType, PatternRewriter &rewriter), PatternBenefit benefit=1, ArrayRef< StringRef > generatedNames={}) |
template<typename... Ts, typename ConstructorArg , typename... ConstructorArgs, typename = std::enable_if_t<sizeof...(Ts) != 0>> | |
RewritePatternSet & | insert (ConstructorArg &&arg, ConstructorArgs &&...args) |
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments. More... | |
template<typename... Ts> | |
RewritePatternSet & | insert () |
Add an instance of each of the pattern types 'Ts'. More... | |
RewritePatternSet & | insert (std::unique_ptr< RewritePattern > pattern) |
Add the given native pattern to the pattern list. More... | |
RewritePatternSet & | insert (PDLPatternModule &&pattern) |
Add the given PDL pattern to the pattern list. More... | |
template<typename OpType > | |
RewritePatternSet & | insert (LogicalResult(*implFn)(OpType, PatternRewriter &rewriter)) |
Definition at line 776 of file PatternMatch.h.
|
inline |
Definition at line 780 of file PatternMatch.h.
|
inline |
Construct a RewritePatternSet populated with the given pattern.
Definition at line 783 of file PatternMatch.h.
|
inline |
Definition at line 788 of file PatternMatch.h.
|
inline |
Add an instance of each of the pattern types 'Ts'.
Return a reference to this
for chaining insertions.
Definition at line 843 of file PatternMatch.h.
Referenced by insert().
|
inline |
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments.
Return a reference to this
for chaining insertions. Note: ConstructorArg is necessary here to separate the two variadic lists.
Definition at line 815 of file PatternMatch.h.
Referenced by mlir::spirv::populateSPIRVGLCanonicalizationPatterns().
|
inline |
Definition at line 865 of file PatternMatch.h.
|
inline |
Add the given PDL pattern to the pattern list.
Return a reference to this
for chaining insertions.
Definition at line 857 of file PatternMatch.h.
|
inline |
Add the given native pattern to the pattern list.
Return a reference to this
for chaining insertions.
Definition at line 850 of file PatternMatch.h.
|
inline |
An overload of the above add
method that allows for attaching a set of debug labels to the attached patterns.
This is useful for labeling groups of patterns that may be shared between multiple different passes/users.
Definition at line 831 of file PatternMatch.h.
|
inline |
Clear out all of the held patterns in this list.
Definition at line 800 of file PatternMatch.h.
|
inline |
Definition at line 791 of file PatternMatch.h.
Referenced by insert(), and mlir::spirv::populateSPIRVGLCanonicalizationPatterns().
|
inline |
Return the native patterns held in this list.
Definition at line 794 of file PatternMatch.h.
|
inline |
Return the PDL patterns held in this list.
Definition at line 797 of file PatternMatch.h.
|
inline |
Add an instance of each of the pattern types 'Ts'.
Return a reference to this
for chaining insertions.
Definition at line 909 of file PatternMatch.h.
|
inline |
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments.
Return a reference to this
for chaining insertions. Note: ConstructorArg is necessary here to separate the two variadic lists.
Definition at line 899 of file PatternMatch.h.
|
inline |
Definition at line 931 of file PatternMatch.h.
References add(), and getContext().
|
inline |
Add the given PDL pattern to the pattern list.
Return a reference to this
for chaining insertions.
Definition at line 923 of file PatternMatch.h.
|
inline |
Add the given native pattern to the pattern list.
Return a reference to this
for chaining insertions.
Definition at line 916 of file PatternMatch.h.