MLIR  18.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mlir::PDLPatternConfigSet Class Reference

This class contains a set of configurations for a specific pattern. More...

#include "mlir/IR/PatternMatch.h"

Public Member Functions

 PDLPatternConfigSet ()=default
 
template<typename... ConfigsT>
 PDLPatternConfigSet (ConfigsT &&...configs)
 Construct a set with the given configurations. More...
 
template<typename T >
const T & get () const
 Get the configuration defined by the given type. More...
 
template<typename T >
const T * tryGet () const
 Get the configuration defined by the given type, returns nullptr if the configuration does not exist. More...
 
void notifyRewriteBegin (PatternRewriter &rewriter)
 Notify the configurations within this set at the beginning or end of a rewrite of a matched pattern. More...
 
void notifyRewriteEnd (PatternRewriter &rewriter)
 

Protected Member Functions

template<typename T >
void addConfig (T &&config)
 Add a configuration to the set. More...
 

Protected Attributes

SmallVector< std::unique_ptr< PDLPatternConfig > > configs
 The set of configurations for this pattern. More...
 

Detailed Description

This class contains a set of configurations for a specific pattern.

Configurations are uniqued by TypeID, meaning that only one configuration of each type is allowed.

Definition at line 979 of file PatternMatch.h.

Constructor & Destructor Documentation

◆ PDLPatternConfigSet() [1/2]

mlir::PDLPatternConfigSet::PDLPatternConfigSet ( )
default

◆ PDLPatternConfigSet() [2/2]

template<typename... ConfigsT>
mlir::PDLPatternConfigSet::PDLPatternConfigSet ( ConfigsT &&...  configs)
inline

Construct a set with the given configurations.

Definition at line 985 of file PatternMatch.h.

References addConfig(), and configs.

Member Function Documentation

◆ addConfig()

template<typename T >
void mlir::PDLPatternConfigSet::addConfig ( T &&  config)
inlineprotected

Add a configuration to the set.

Definition at line 1022 of file PatternMatch.h.

References configs, and tryGet().

Referenced by PDLPatternConfigSet().

◆ get()

template<typename T >
const T& mlir::PDLPatternConfigSet::get ( ) const
inline

Get the configuration defined by the given type.

Asserts that the configuration of the provided type exists.

Definition at line 992 of file PatternMatch.h.

◆ notifyRewriteBegin()

void mlir::PDLPatternConfigSet::notifyRewriteBegin ( PatternRewriter rewriter)
inline

Notify the configurations within this set at the beginning or end of a rewrite of a matched pattern.

Definition at line 1010 of file PatternMatch.h.

References configs.

◆ notifyRewriteEnd()

void mlir::PDLPatternConfigSet::notifyRewriteEnd ( PatternRewriter rewriter)
inline

Definition at line 1014 of file PatternMatch.h.

References configs.

◆ tryGet()

template<typename T >
const T* mlir::PDLPatternConfigSet::tryGet ( ) const
inline

Get the configuration defined by the given type, returns nullptr if the configuration does not exist.

Definition at line 1001 of file PatternMatch.h.

References configs.

Referenced by addConfig().

Member Data Documentation

◆ configs

SmallVector<std::unique_ptr<PDLPatternConfig> > mlir::PDLPatternConfigSet::configs
protected

The set of configurations for this pattern.

This uses a vector instead of a map with the expectation that the number of configurations per set is small (<= 1).

Definition at line 1031 of file PatternMatch.h.

Referenced by addConfig(), notifyRewriteBegin(), notifyRewriteEnd(), PDLPatternConfigSet(), and tryGet().


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