Halide
IRMatch.h File Reference
#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::Const
 
struct  Halide::Internal::IRMatcher::Const::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::Intrin< Args >
 
struct  Halide::Internal::IRMatcher::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, known_lanes >
 
struct  Halide::Internal::IRMatcher::BroadcastOp< A, known_lanes >::pattern_tag
 
struct  Halide::Internal::IRMatcher::RampOp< A, B, known_lanes >
 
struct  Halide::Internal::IRMatcher::RampOp< A, B, known_lanes >::pattern_tag
 
struct  Halide::Internal::IRMatcher::VectorReduceOp< A, known_lanes, reduce_op >
 
struct  Halide::Internal::IRMatcher::VectorReduceOp< A, known_lanes, 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::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::Rewriter< Instance >
 

Namespaces

 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.
 
 Halide::Internal
 
 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. More...
 
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. More...
 
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)
 
bool Halide::Internal::IRMatcher::equal_helper (const BaseExprNode &a, const BaseExprNode &b) noexcept
 
HALIDE_ALWAYS_INLINE bool Halide::Internal::IRMatcher::equal (const BaseExprNode &a, const BaseExprNode &b) noexcept
 
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)
 
template<typename T , typename = typename std::decay<T>::type::pattern_tag>
HALIDE_ALWAYS_INLINEHalide::Internal::IRMatcher::pattern_arg (T t)
 
HALIDE_ALWAYS_INLINE Const Halide::Internal::IRMatcher::pattern_arg (int64_t x)
 
const 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)
 
const HALIDE_ALWAYS_INLINE BaseExprNode & Halide::Internal::IRMatcher::unwrap (const SpecificExpr &e)
 
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const Const &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)
 
template<typename... Args>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const Intrin< Args... > &op)
 
template<typename... Args>
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::intrin (Call::IntrinsicOp intrinsic_op, Args... args) noexcept -> Intrin< decltype(pattern_arg(args))... >
 
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 >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BroadcastOp< A, true > &op)
 
template<typename A >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const BroadcastOp< A, false > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::broadcast (A a, int lanes) noexcept -> BroadcastOp< decltype(pattern_arg(a)), true >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::broadcast (A a) noexcept -> BroadcastOp< decltype(pattern_arg(a)), false >
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const RampOp< A, B, true > &op)
 
template<typename A , typename B >
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const RampOp< A, B, false > &op)
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::ramp (A a, B b, int lanes) noexcept -> RampOp< decltype(pattern_arg(a)), decltype(pattern_arg(b)), true >
 
template<typename A , typename B >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::ramp (A a, B b) noexcept -> RampOp< decltype(pattern_arg(a)), decltype(pattern_arg(b)), false >
 
template<typename A , VectorReduce::Operator reduce_op>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const VectorReduceOp< A, true, reduce_op > &op)
 
template<typename A , VectorReduce::Operator reduce_op>
std::ostream & Halide::Internal::IRMatcher::operator<< (std::ostream &s, const VectorReduceOp< A, false, reduce_op > &op)
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_add (A a, int lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), true, VectorReduce::Add >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_add (A a) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), false, VectorReduce::Add >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_min (A a, int lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), true, VectorReduce::Min >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_min (A a) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), false, VectorReduce::Min >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_max (A a, int lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), true, VectorReduce::Max >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_max (A a) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), false, VectorReduce::Max >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_and (A a, int lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), true, VectorReduce::And >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_and (A a) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), false, VectorReduce::And >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_or (A a, int lanes) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), true, VectorReduce::Or >
 
template<typename A >
HALIDE_ALWAYS_INLINE auto Halide::Internal::IRMatcher::h_or (A a) noexcept -> VectorReduceOp< decltype(pattern_arg(a)), false, 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 >
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 >
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 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. More...
 
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 2265 of file IRMatch.h.

◆ HALIDE_DEBUG_UNMATCHED_RULES

#define HALIDE_DEBUG_UNMATCHED_RULES   0

Definition at line 2266 of file IRMatch.h.

◆ HALIDE_FUZZ_TEST_RULES

#define HALIDE_FUZZ_TEST_RULES   0

Definition at line 2272 of file IRMatch.h.