Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
IRMatch.h File Reference

Defines a method to match a fragment of IR against a pattern containing wildcards. More...

#include <map>
#include <random>
#include <set>
#include <vector>
#include "IR.h"
#include "IREquality.h"
#include "IROperator.h"

Go to the source code of this file.

Classes

struct  Halide::Internal::IRMatcher::MatcherState
 To save stack space, the matcher objects are largely stateless and immutable. More...
 
struct  Halide::Internal::IRMatcher::enable_if_pattern< T, typename >
 
struct  Halide::Internal::IRMatcher::enable_if_pattern< T, typename >::type
 
struct  Halide::Internal::IRMatcher::bindings< T >
 
struct  Halide::Internal::IRMatcher::SpecificExpr
 
struct  Halide::Internal::IRMatcher::SpecificExpr::pattern_tag
 
struct  Halide::Internal::IRMatcher::WildConstInt< i >
 
struct  Halide::Internal::IRMatcher::WildConstInt< i >::pattern_tag
 
struct  Halide::Internal::IRMatcher::WildConstUInt< i >
 
struct  Halide::Internal::IRMatcher::WildConstUInt< i >::pattern_tag
 
struct  Halide::Internal::IRMatcher::WildConstFloat< i >
 
struct  Halide::Internal::IRMatcher::WildConstFloat< i >::pattern_tag
 
struct  Halide::Internal::IRMatcher::WildConst< i >
 
struct  Halide::Internal::IRMatcher::WildConst< i >::pattern_tag
 
struct  Halide::Internal::IRMatcher::Wild< i >
 
struct  Halide::Internal::IRMatcher::Wild< i >::pattern_tag
 
struct  Halide::Internal::IRMatcher::IntLiteral
 
struct  Halide::Internal::IRMatcher::IntLiteral::pattern_tag
 
struct  Halide::Internal::IRMatcher::BinOp< Op, A, B >
 
struct  Halide::Internal::IRMatcher::BinOp< Op, A, B >::pattern_tag
 
struct  Halide::Internal::IRMatcher::CmpOp< Op, A, B >
 
struct  Halide::Internal::IRMatcher::CmpOp< Op, A, B >::pattern_tag
 
struct  Halide::Internal::IRMatcher::OptionalIntrinType< intrin >
 
struct  Halide::Internal::IRMatcher::OptionalIntrinType< Call::saturating_cast >
 
struct  Halide::Internal::IRMatcher::Intrin< intrin, Args >
 
struct  Halide::Internal::IRMatcher::Intrin< intrin, Args >::pattern_tag
 
struct  Halide::Internal::IRMatcher::NotOp< A >
 
struct  Halide::Internal::IRMatcher::NotOp< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::SelectOp< C, T, F >
 
struct  Halide::Internal::IRMatcher::SelectOp< C, T, F >::pattern_tag
 
struct  Halide::Internal::IRMatcher::BroadcastOp< A, B >
 
struct  Halide::Internal::IRMatcher::BroadcastOp< A, B >::pattern_tag
 
struct  Halide::Internal::IRMatcher::RampOp< A, B, C >
 
struct  Halide::Internal::IRMatcher::RampOp< A, B, C >::pattern_tag
 
struct  Halide::Internal::IRMatcher::VectorReduceOp< A, B, reduce_op >
 
struct  Halide::Internal::IRMatcher::VectorReduceOp< A, B, reduce_op >::pattern_tag
 
struct  Halide::Internal::IRMatcher::NegateOp< A >
 
struct  Halide::Internal::IRMatcher::NegateOp< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::CastOp< A >
 
struct  Halide::Internal::IRMatcher::CastOp< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::WidenOp< A >
 
struct  Halide::Internal::IRMatcher::WidenOp< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::SliceOp< Vec, Base, Stride, Lanes >
 
struct  Halide::Internal::IRMatcher::SliceOp< Vec, Base, Stride, Lanes >::pattern_tag
 
struct  Halide::Internal::IRMatcher::Fold< A >
 
struct  Halide::Internal::IRMatcher::Fold< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::Overflows< A >
 
struct  Halide::Internal::IRMatcher::Overflows< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::Overflow
 
struct  Halide::Internal::IRMatcher::Overflow::pattern_tag
 
struct  Halide::Internal::IRMatcher::IsConst< A >
 
struct  Halide::Internal::IRMatcher::IsConst< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::CanProve< A, Prover >
 
struct  Halide::Internal::IRMatcher::CanProve< A, Prover >::pattern_tag
 
struct  Halide::Internal::IRMatcher::IsFloat< A >
 
struct  Halide::Internal::IRMatcher::IsFloat< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::IsInt< A >
 
struct  Halide::Internal::IRMatcher::IsInt< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::IsUInt< A >
 
struct  Halide::Internal::IRMatcher::IsUInt< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::IsScalar< A >
 
struct  Halide::Internal::IRMatcher::IsScalar< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::IsMaxValue< A >
 
struct  Halide::Internal::IRMatcher::IsMaxValue< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::IsMinValue< A >
 
struct  Halide::Internal::IRMatcher::IsMinValue< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::LanesOf< A >
 
struct  Halide::Internal::IRMatcher::LanesOf< A >::pattern_tag
 
struct  Halide::Internal::IRMatcher::Rewriter< Instance >
 

Namespaces

namespace  Halide
 This file defines the class FunctionDAG, which is our representation of a Halide pipeline, and contains methods to using Halide's bounds tools to query properties of it.
 
namespace  Halide::Internal
 
namespace  Halide::Internal::IRMatcher
 An alternative template-metaprogramming approach to expression matching.
 

Macros

#define HALIDE_DEBUG_MATCHED_RULES   0
 
#define HALIDE_DEBUG_UNMATCHED_RULES   0
 
#define HALIDE_FUZZ_TEST_RULES   0
 

Functions

bool Halide::Internal::expr_match (const Expr &pattern, const Expr &expr, std::vector< Expr > &result)
 Does the first expression have the same structure as the second? Variables in the first expression with the name * are interpreted as wildcards, and their matching equivalent in the second expression is placed in the vector give as the third argument.
 
bool Halide::Internal::expr_match (const Expr &pattern, const Expr &expr, std::map< std::string, Expr > &result)
 Does the first expression have the same structure as the second? Variables are matched consistently.
 
Expr Halide::Internal::with_lanes (const Expr &x, int lanes)
 Rewrite the expression x to have lanes lanes.
 
void Halide::Internal::expr_match_test ()
 
HALIDE_NEVER_INLINE Expr Halide::Internal::IRMatcher::make_const_special_expr (halide_type_t ty)
 
HALIDE_ALWAYS_INLINE Expr Halide::Internal::IRMatcher::make_const_expr (halide_scalar_value_t val, halide_type_t ty)
 
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const SpecificExpr &e)
 
template<int i>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const WildConstInt< i > &c)
 
template<int i>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const WildConstUInt< i > &c)
 
template<int i>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const WildConstFloat< i > &c)
 
template<int i>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const WildConst< i > &c)
 
template<int i>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const Wild< i > &op)
 
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::unwrap (IntLiteral t)
 
template<typename T , typename = typename std::decay<T>::type::pattern_tag>
HALIDE_ALWAYS_INLINEHalide::Internal::IRMatcher::pattern_arg (T t)
 
HALIDE_ALWAYS_INLINE IntLiteral Halide::Internal::IRMatcher::pattern_arg (int64_t x)
 
template<typename T >
HALIDE_ALWAYS_INLINE void Halide::Internal::IRMatcher::assert_is_lvalue_if_expr ()
 
HALIDE_ALWAYS_INLINE SpecificExpr Halide::Internal::IRMatcher::pattern_arg (const Expr &e)
 
template<typename T , typename = typename std::decay<T>::type::pattern_tag, typename = typename std::enable_if<!std::is_same<typename std::decay<T>::type, SpecificExpr>::value>::type>
HALIDE_ALWAYS_INLINEHalide::Internal::IRMatcher::unwrap (T t)
 
HALIDE_ALWAYS_INLINE const BaseExprNodeHalide::Internal::IRMatcher::unwrap (const SpecificExpr &e)
 
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const IntLiteral &op)
 
template<typename Op >
int64_t Halide::Internal::IRMatcher::constant_fold_bin_op (halide_type_t &, int64_t, int64_t) noexcept
 
template<typename Op >
uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op (halide_type_t &, uint64_t, uint64_t) noexcept
 
template<typename Op >
double Halide::Internal::IRMatcher::constant_fold_bin_op (halide_type_t &, double, double) noexcept
 
constexpr bool Halide::Internal::IRMatcher::commutative (IRNodeType t)
 
template<typename Op >
uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op (int64_t, int64_t) noexcept
 
template<typename Op >
uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op (uint64_t, uint64_t) noexcept
 
template<typename Op >
uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op (double, double) noexcept
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BinOp< Add, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BinOp< Sub, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BinOp< Mul, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BinOp< Div, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BinOp< And, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BinOp< Or, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BinOp< Min, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BinOp< Max, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const CmpOp< LE, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const CmpOp< LT, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const CmpOp< GE, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const CmpOp< GT, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const CmpOp< EQ, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const CmpOp< NE, A, B > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BinOp< Mod, A, B > &op)
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator+ (A &&a, B &&b) noexcept -> BinOp< Add, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::add (A &&a, B &&b) -> decltype(IRMatcher::operator+(a, b))
 
template<>
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Add > (halide_type_t &t, int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Add > (halide_type_t &t, uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE double Halide::Internal::IRMatcher::constant_fold_bin_op< Add > (halide_type_t &t, double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator- (A &&a, B &&b) noexcept -> BinOp< Sub, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::sub (A &&a, B &&b) -> decltype(IRMatcher::operator-(a, b))
 
template<>
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Sub > (halide_type_t &t, int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Sub > (halide_type_t &t, uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE double Halide::Internal::IRMatcher::constant_fold_bin_op< Sub > (halide_type_t &t, double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator* (A &&a, B &&b) noexcept -> BinOp< Mul, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::mul (A &&a, B &&b) -> decltype(IRMatcher::operator*(a, b))
 
template<>
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Mul > (halide_type_t &t, int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Mul > (halide_type_t &t, uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE double Halide::Internal::IRMatcher::constant_fold_bin_op< Mul > (halide_type_t &t, double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator/ (A &&a, B &&b) noexcept -> BinOp< Div, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::div (A &&a, B &&b) -> decltype(IRMatcher::operator/(a, b))
 
template<>
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Div > (halide_type_t &t, int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Div > (halide_type_t &t, uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE double Halide::Internal::IRMatcher::constant_fold_bin_op< Div > (halide_type_t &t, double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator% (A &&a, B &&b) noexcept -> BinOp< Mod, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::mod (A &&a, B &&b) -> decltype(IRMatcher::operator%(a, b))
 
template<>
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Mod > (halide_type_t &t, int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Mod > (halide_type_t &t, uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE double Halide::Internal::IRMatcher::constant_fold_bin_op< Mod > (halide_type_t &t, double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::min (A &&a, B &&b) noexcept -> BinOp< Min, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<>
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Min > (halide_type_t &t, int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Min > (halide_type_t &t, uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE double Halide::Internal::IRMatcher::constant_fold_bin_op< Min > (halide_type_t &t, double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::max (A &&a, B &&b) noexcept -> BinOp< Max, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<>
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Max > (halide_type_t &t, int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Max > (halide_type_t &t, uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE double Halide::Internal::IRMatcher::constant_fold_bin_op< Max > (halide_type_t &t, double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator< (A &&a, B &&b) noexcept -> CmpOp< LT, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::lt (A &&a, B &&b) -> decltype(IRMatcher::operator<(a, b))
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< LT > (int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< LT > (uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< LT > (double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator> (A &&a, B &&b) noexcept -> CmpOp< GT, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::gt (A &&a, B &&b) -> decltype(IRMatcher::operator>(a, b))
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< GT > (int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< GT > (uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< GT > (double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator<= (A &&a, B &&b) noexcept -> CmpOp< LE, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::le (A &&a, B &&b) -> decltype(IRMatcher::operator<=(a, b))
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< LE > (int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< LE > (uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< LE > (double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator>= (A &&a, B &&b) noexcept -> CmpOp< GE, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::ge (A &&a, B &&b) -> decltype(IRMatcher::operator>=(a, b))
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< GE > (int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< GE > (uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< GE > (double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator== (A &&a, B &&b) noexcept -> CmpOp< EQ, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::eq (A &&a, B &&b) -> decltype(IRMatcher::operator==(a, b))
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< EQ > (int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< EQ > (uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< EQ > (double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator!= (A &&a, B &&b) noexcept -> CmpOp< NE, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::ne (A &&a, B &&b) -> decltype(IRMatcher::operator!=(a, b))
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< NE > (int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< NE > (uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_cmp_op< NE > (double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator|| (A &&a, B &&b) noexcept -> BinOp< Or, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::or_op (A &&a, B &&b) -> decltype(IRMatcher::operator||(a, b))
 
template<>
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Or > (halide_type_t &t, int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op< Or > (halide_type_t &t, uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE double Halide::Internal::IRMatcher::constant_fold_bin_op< Or > (halide_type_t &t, double a, double b) noexcept
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator&& (A &&a, B &&b) noexcept -> BinOp< And, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::and_op (A &&a, B &&b) -> decltype(IRMatcher::operator&&(a, b))
 
template<>
HALIDE_ALWAYS_INLINE int64_t Halide::Internal::IRMatcher::constant_fold_bin_op< And > (halide_type_t &t, int64_t a, int64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE uint64_t Halide::Internal::IRMatcher::constant_fold_bin_op< And > (halide_type_t &t, uint64_t a, uint64_t b) noexcept
 
template<>
HALIDE_ALWAYS_INLINE double Halide::Internal::IRMatcher::constant_fold_bin_op< And > (halide_type_t &t, double a, double b) noexcept
 
constexpr uint32_t Halide::Internal::IRMatcher::bitwise_or_reduce ()
 
template<typename... Args>
constexpr uint32_t Halide::Internal::IRMatcher::bitwise_or_reduce (uint32_t first, Args... rest)
 
constexpr bool Halide::Internal::IRMatcher::and_reduce ()
 
template<typename... Args>
constexpr bool Halide::Internal::IRMatcher::and_reduce (bool first, Args... rest)
 
constexpr int Halide::Internal::IRMatcher::const_min (int a, int b)
 
template<Call::IntrinsicOp intrin, typename... Args>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const Intrin< intrin, Args... > &op)
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::widen_right_add (A &&a, B &&b) noexcept -> Intrin< Call::widen_right_add, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::widen_right_mul (A &&a, B &&b) noexcept -> Intrin< Call::widen_right_mul, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::widen_right_sub (A &&a, B &&b) noexcept -> Intrin< Call::widen_right_sub, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::widening_add (A &&a, B &&b) noexcept -> Intrin< Call::widening_add, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::widening_sub (A &&a, B &&b) noexcept -> Intrin< Call::widening_sub, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::widening_mul (A &&a, B &&b) noexcept -> Intrin< Call::widening_mul, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::saturating_add (A &&a, B &&b) noexcept -> Intrin< Call::saturating_add, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::saturating_sub (A &&a, B &&b) noexcept -> Intrin< Call::saturating_sub, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A >
auto Halide::Internal::IRMatcher::saturating_cast (const Type &t, A &&a) noexcept -> Intrin< Call::saturating_cast, decltype(pattern_arg(a))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::halving_add (A &&a, B &&b) noexcept -> Intrin< Call::halving_add, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::halving_sub (A &&a, B &&b) noexcept -> Intrin< Call::halving_sub, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::rounding_halving_add (A &&a, B &&b) noexcept -> Intrin< Call::rounding_halving_add, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::shift_left (A &&a, B &&b) noexcept -> Intrin< Call::shift_left, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::shift_right (A &&a, B &&b) noexcept -> Intrin< Call::shift_right, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::rounding_shift_left (A &&a, B &&b) noexcept -> Intrin< Call::rounding_shift_left, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::rounding_shift_right (A &&a, B &&b) noexcept -> Intrin< Call::rounding_shift_right, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A , typename B , typename C >
auto Halide::Internal::IRMatcher::mul_shift_right (A &&a, B &&b, C &&c) noexcept -> Intrin< Call::mul_shift_right, decltype(pattern_arg(a)), decltype(pattern_arg(b)), decltype(pattern_arg(c))>
 
template<typename A , typename B , typename C >
auto Halide::Internal::IRMatcher::rounding_mul_shift_right (A &&a, B &&b, C &&c) noexcept -> Intrin< Call::rounding_mul_shift_right, decltype(pattern_arg(a)), decltype(pattern_arg(b)), decltype(pattern_arg(c))>
 
template<typename A >
auto Halide::Internal::IRMatcher::abs (A &&a) noexcept -> Intrin< Call::abs, decltype(pattern_arg(a))>
 
template<typename A , typename B >
auto Halide::Internal::IRMatcher::absd (A &&a, B &&b) noexcept -> Intrin< Call::absd, decltype(pattern_arg(a)), decltype(pattern_arg(b))>
 
template<typename A >
auto Halide::Internal::IRMatcher::likely (A &&a) noexcept -> Intrin< Call::likely, decltype(pattern_arg(a))>
 
template<typename A >
auto Halide::Internal::IRMatcher::likely_if_innermost (A &&a) noexcept -> Intrin< Call::likely_if_innermost, decltype(pattern_arg(a))>
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator! (A &&a) noexcept -> NotOp< decltype(pattern_arg(a))>
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::not_op (A &&a) -> decltype(IRMatcher::operator!(a))
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const NotOp< A > &op)
 
template<typename C , typename T , typename F >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const SelectOp< C, T, F > &op)
 
template<typename C , typename T , typename F >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::select (C &&c, T &&t, F &&f) noexcept -> SelectOp< decltype(pattern_arg(c)), decltype(pattern_arg(t)), decltype(pattern_arg(f))>
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BroadcastOp< A, B > &op)
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::broadcast (A &&a, B lanes) noexcept -> BroadcastOp< decltype(pattern_arg(a)), decltype(pattern_arg(lanes))>
 
template<typename A , typename B , typename C >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const RampOp< A, B, C > &op)
 
template<typename A , typename B , typename C >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::ramp (A &&a, B &&b, C &&c) noexcept -> RampOp< decltype(pattern_arg(a)), decltype(pattern_arg(b)), decltype(pattern_arg(c))>
 
template<typename A , typename B , VectorReduce::Operator reduce_op>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const VectorReduceOp< A, B, reduce_op > &op)
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_add (A &&a, B lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), decltype(pattern_arg(lanes)), VectorReduce::Add >
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_min (A &&a, B lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), decltype(pattern_arg(lanes)), VectorReduce::Min >
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_max (A &&a, B lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), decltype(pattern_arg(lanes)), VectorReduce::Max >
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_and (A &&a, B lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), decltype(pattern_arg(lanes)), VectorReduce::And >
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_or (A &&a, B lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), decltype(pattern_arg(lanes)), VectorReduce::Or >
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const NegateOp< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::operator- (A &&a) noexcept -> NegateOp< decltype(pattern_arg(a))>
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::negate (A &&a) -> decltype(IRMatcher::operator-(a))
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const CastOp< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::cast (halide_type_t t, A &&a) noexcept -> CastOp< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const WidenOp< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::widen (A &&a) noexcept -> WidenOp< decltype(pattern_arg(a))>
 
template<typename Vec , typename Base , typename Stride , typename Lanes >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const SliceOp< Vec, Base, Stride, Lanes > &op)
 
template<typename Vec , typename Base , typename Stride , typename Lanes >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::slice (Vec vec, Base base, Stride stride, Lanes lanes) noexcept -> SliceOp< decltype(pattern_arg(vec)), decltype(pattern_arg(base)), decltype(pattern_arg(stride)), decltype(pattern_arg(lanes))>
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::fold (A &&a) noexcept -> Fold< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const Fold< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::overflows (A &&a) noexcept -> Overflows< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const Overflows< A > &op)
 
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const Overflow &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::is_const (A &&a) noexcept -> IsConst< decltype(pattern_arg(a))>
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::is_const (A &&a, int64_t value) noexcept -> IsConst< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const IsConst< A > &op)
 
template<typename A , typename Prover >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::can_prove (A &&a, Prover *p) noexcept -> CanProve< decltype(pattern_arg(a)), Prover >
 
template<typename A , typename Prover >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const CanProve< A, Prover > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::is_float (A &&a) noexcept -> IsFloat< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const IsFloat< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::is_int (A &&a, uint8_t bits=0, uint16_t lanes=0) noexcept -> IsInt< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const IsInt< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::is_uint (A &&a, uint8_t bits=0, uint16_t lanes=0) noexcept -> IsUInt< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const IsUInt< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::is_scalar (A &&a) noexcept -> IsScalar< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const IsScalar< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::is_max_value (A &&a) noexcept -> IsMaxValue< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const IsMaxValue< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::is_min_value (A &&a) noexcept -> IsMinValue< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const IsMinValue< A > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::lanes_of (A &&a) noexcept -> LanesOf< decltype(pattern_arg(a))>
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const LanesOf< A > &op)
 
template<typename Before , typename After , typename Predicate , typename = typename std::enable_if<std::decay<Before>::type::foldable && std::decay<After>::type::foldable>::type>
HALIDE_NEVER_INLINE void Halide::Internal::IRMatcher::fuzz_test_rule (Before &&before, After &&after, Predicate &&pred, halide_type_t wildcard_type, halide_type_t output_type) noexcept
 
template<typename Before , typename After , typename Predicate , typename = typename std::enable_if<!(std::decay<Before>::type::foldable && std::decay<After>::type::foldable)>::type>
HALIDE_ALWAYS_INLINE void Halide::Internal::IRMatcher::fuzz_test_rule (Before &&before, After &&after, Predicate &&pred, halide_type_t, halide_type_t, int dummy=0) noexcept
 
HALIDE_ALWAYS_INLINE bool Halide::Internal::IRMatcher::evaluate_predicate (bool x, MatcherState &) noexcept
 
template<typename Pattern , typename = typename enable_if_pattern<Pattern>::type>
HALIDE_ALWAYS_INLINE bool Halide::Internal::IRMatcher::evaluate_predicate (Pattern p, MatcherState &state)
 
template<typename Instance , typename = typename enable_if_pattern<Instance>::type>
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::rewriter (Instance instance, halide_type_t output_type, halide_type_t wildcard_type) noexcept -> Rewriter< decltype(pattern_arg(instance))>
 Construct a rewriter for the given instance, which may be a pattern with concrete expressions as leaves, or just an expression.
 
template<typename Instance , typename = typename enable_if_pattern<Instance>::type>
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::rewriter (Instance instance, halide_type_t output_type) noexcept -> Rewriter< decltype(pattern_arg(instance))>
 
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::rewriter (const Expr &e, halide_type_t wildcard_type) noexcept -> Rewriter< decltype(pattern_arg(e))>
 
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::rewriter (const Expr &e) noexcept -> Rewriter< decltype(pattern_arg(e))>
 

Variables

constexpr int Halide::Internal::IRMatcher::max_wild = 6
 

Detailed Description

Defines a method to match a fragment of IR against a pattern containing wildcards.

Definition in file IRMatch.h.

Macro Definition Documentation

◆ HALIDE_DEBUG_MATCHED_RULES

#define HALIDE_DEBUG_MATCHED_RULES   0

Definition at line 2858 of file IRMatch.h.

◆ HALIDE_DEBUG_UNMATCHED_RULES

#define HALIDE_DEBUG_UNMATCHED_RULES   0

Definition at line 2859 of file IRMatch.h.

◆ HALIDE_FUZZ_TEST_RULES

#define HALIDE_FUZZ_TEST_RULES   0

Definition at line 2865 of file IRMatch.h.