MLIR  16.0.0git
Classes | Namespaces | Typedefs | Functions
Matchers.h File Reference
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/OpDefinition.h"
+ Include dependency graph for Matchers.h:

Go to the source code of this file.

Classes

struct  mlir::detail::attr_value_binder< AttrClass, ValueType, typename >
 The matcher that matches a certain kind of Attribute and binds the value inside the Attribute. More...
 
struct  mlir::detail::constant_op_matcher
 The matcher that matches operations that have the ConstantLike trait. More...
 
struct  mlir::detail::constant_op_binder< AttrT >
 The matcher that matches operations that have the ConstantLike trait, and binds the folded attribute value. More...
 
struct  mlir::detail::constant_float_op_binder
 The matcher that matches a constant scalar / vector splat / tensor splat float operation and binds the constant float value. More...
 
struct  mlir::detail::constant_float_predicate_matcher
 The matcher that matches a given target constant scalar / vector splat / tensor splat float value that fulfills a predicate. More...
 
struct  mlir::detail::constant_int_op_binder
 The matcher that matches a constant scalar / vector splat / tensor splat integer operation and binds the constant integer value. More...
 
struct  mlir::detail::constant_int_predicate_matcher
 The matcher that matches a given target constant scalar / vector splat / tensor splat integer value that fulfills a predicate. More...
 
struct  mlir::detail::op_matcher< OpClass >
 The matcher that matches a certain kind of op. More...
 
struct  mlir::detail::AnyValueMatcher
 Terminal matcher, always returns true. More...
 
struct  mlir::detail::AnyCapturedValueMatcher
 Terminal matcher, always returns true. More...
 
struct  mlir::detail::PatternMatcherValue
 Binds to a specific value and matches it. More...
 
struct  mlir::detail::RecursivePatternMatcher< OpType, OperandMatchers >
 RecursivePatternMatcher that composes. More...
 

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::detail
 
 mlir::matchers
 

Typedefs

template<typename T , typename OperationOrValue >
using mlir::detail::has_operation_or_value_matcher_t = decltype(std::declval< T >().match(std::declval< OperationOrValue >()))
 Trait to check whether T provides a 'match' method with type OperationOrValue. More...
 

Functions

static bool mlir::detail::isConstantLike (Operation *op)
 Check to see if the specified operation is ConstantLike. More...
 
template<typename MatcherClass >
std::enable_if_t< llvm::is_detected< detail::has_operation_or_value_matcher_t, MatcherClass, Value >::value, bool > mlir::detail::matchOperandOrValueAtIndex (Operation *op, unsigned idx, MatcherClass &matcher)
 Statically switch to a Value matcher. More...
 
template<typename MatcherClass >
std::enable_if_t< llvm::is_detected< detail::has_operation_or_value_matcher_t, MatcherClass, Operation * >::value, bool > mlir::detail::matchOperandOrValueAtIndex (Operation *op, unsigned idx, MatcherClass &matcher)
 Statically switch to an Operation matcher. More...
 
template<typename TupleT , class CallbackT , std::size_t... Is>
constexpr void mlir::detail::enumerateImpl (TupleT &&tuple, CallbackT &&callback, std::index_sequence< Is... >)
 
template<typename... Tys, typename CallbackT >
constexpr void mlir::detail::enumerate (std::tuple< Tys... > &tuple, CallbackT &&callback)
 
detail::constant_op_matcher mlir::m_Constant ()
 Matches a constant foldable operation. More...
 
template<typename AttrT >
detail::constant_op_binder< AttrT > mlir::m_Constant (AttrT *bind_value)
 Matches a value from a constant foldable operation and writes the value to bind_value. More...
 
detail::constant_float_predicate_matcher mlir::m_AnyZeroFloat ()
 Matches a constant scalar / vector splat / tensor splat float (both positive and negative) zero. More...
 
detail::constant_float_predicate_matcher mlir::m_PosZeroFloat ()
 Matches a constant scalar / vector splat / tensor splat float positive zero. More...
 
detail::constant_float_predicate_matcher mlir::m_NegZeroFloat ()
 Matches a constant scalar / vector splat / tensor splat float negative zero. More...
 
detail::constant_float_predicate_matcher mlir::m_OneFloat ()
 Matches a constant scalar / vector splat / tensor splat float ones. More...
 
detail::constant_float_predicate_matcher mlir::m_PosInfFloat ()
 Matches a constant scalar / vector splat / tensor splat float positive infinity. More...
 
detail::constant_float_predicate_matcher mlir::m_NegInfFloat ()
 Matches a constant scalar / vector splat / tensor splat float negative infinity. More...
 
detail::constant_int_predicate_matcher mlir::m_Zero ()
 Matches a constant scalar / vector splat / tensor splat integer zero. More...
 
detail::constant_int_predicate_matcher mlir::m_NonZero ()
 Matches a constant scalar / vector splat / tensor splat integer that is any non-zero value. More...
 
detail::constant_int_predicate_matcher mlir::m_One ()
 Matches a constant scalar / vector splat / tensor splat integer one. More...
 
template<typename OpClass >
detail::op_matcher< OpClass > mlir::m_Op ()
 Matches the given OpClass. More...
 
template<typename Pattern >
bool mlir::matchPattern (Value value, const Pattern &pattern)
 Entry point for matching a pattern over a Value. More...
 
template<typename Pattern >
bool mlir::matchPattern (Operation *op, const Pattern &pattern)
 Entry point for matching a pattern over an Operation. More...
 
detail::constant_float_op_binder mlir::m_ConstantFloat (FloatAttr::ValueType *bind_value)
 Matches a constant holding a scalar/vector/tensor float (splat) and writes the float value to bind_value. More...
 
detail::constant_int_op_binder mlir::m_ConstantInt (IntegerAttr::ValueType *bind_value)
 Matches a constant holding a scalar/vector/tensor integer (splat) and writes the integer value to bind_value. More...
 
template<typename OpType , typename... Matchers>
auto mlir::m_Op (Matchers... matchers)
 
auto mlir::matchers::m_Any ()
 
auto mlir::matchers::m_Any (Value *val)
 
auto mlir::matchers::m_Val (Value v)