CIRCT 23.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
circt::ConversionPatternSet Class Reference

Extension of RewritePatternSet that allows adding matchAndRewrite functions with op adaptors and ConversionPatternRewriter as patterns. More...

#include <ConversionPatternSet.h>

Inheritance diagram for circt::ConversionPatternSet:
Inheritance graph
[legend]
Collaboration diagram for circt::ConversionPatternSet:
Collaboration graph
[legend]

Public Member Functions

 ConversionPatternSet (MLIRContext *context, const TypeConverter &typeConverter)
 
template<class Op , typename... ExtraArgs>
ConversionPatternSetadd (LogicalResult(*implFn)(Op, typename Op::Adaptor, ConversionPatternRewriter &, ExtraArgs...), llvm::type_identity_t< ExtraArgs >... args)
 Add a matchAndRewrite function as a conversion pattern to the set.
 
template<class Op , typename... ExtraArgs>
ConversionPatternSetadd (LogicalResult(*implFn)(Op, typename Op::Adaptor, ConversionPatternRewriter &, const TypeConverter &, ExtraArgs...), llvm::type_identity_t< ExtraArgs >... args)
 Add a matchAndRewrite function as a conversion pattern to the set.
 

Public Attributes

const TypeConverter & typeConverter
 

Detailed Description

Extension of RewritePatternSet that allows adding matchAndRewrite functions with op adaptors and ConversionPatternRewriter as patterns.

Definition at line 23 of file ConversionPatternSet.h.

Constructor & Destructor Documentation

◆ ConversionPatternSet()

circt::ConversionPatternSet::ConversionPatternSet ( MLIRContext *  context,
const TypeConverter &  typeConverter 
)
inline

Definition at line 27 of file ConversionPatternSet.h.

Member Function Documentation

◆ add() [1/2]

template<class Op , typename... ExtraArgs>
ConversionPatternSet & circt::ConversionPatternSet::add ( LogicalResult(*)(Op, typename Op::Adaptor, ConversionPatternRewriter &, const TypeConverter &, ExtraArgs...)  implFn,
llvm::type_identity_t< ExtraArgs >...  args 
)
inline

Add a matchAndRewrite function as a conversion pattern to the set.

The pattern's type converter is automatically forwarded to the function, followed by any extra arguments.

Definition at line 73 of file ConversionPatternSet.h.

References add(), and typeConverter.

◆ add() [2/2]

template<class Op , typename... ExtraArgs>
ConversionPatternSet & circt::ConversionPatternSet::add ( LogicalResult(*)(Op, typename Op::Adaptor, ConversionPatternRewriter &, ExtraArgs...)  implFn,
llvm::type_identity_t< ExtraArgs >...  args 
)
inline

Add a matchAndRewrite function as a conversion pattern to the set.

Extra arguments beyond the op, adaptor, and rewriter are deduced from the function pointer signature, stored in the pattern, and forwarded on each invocation.

Definition at line 38 of file ConversionPatternSet.h.

References add(), and typeConverter.

Referenced by add(), and add().

Member Data Documentation

◆ typeConverter

const TypeConverter& circt::ConversionPatternSet::typeConverter

Definition at line 25 of file ConversionPatternSet.h.

Referenced by add(), and add().


The documentation for this class was generated from the following file: