Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Halide::Internal::IRMatcher::MatcherState Struct Reference

To save stack space, the matcher objects are largely stateless and immutable. More...

`#include <IRMatch.h>`

## Public Member Functions
HALIDE_ALWAYS_INLINE void | set_binding (int i, const BaseExprNode &n) noexcept
HALIDE_ALWAYS_INLINE const BaseExprNode * | get_binding (int i) const noexcept
HALIDE_ALWAYS_INLINE void | set_bound_const (int i, int64_t s, halide_type_t t) noexcept
HALIDE_ALWAYS_INLINE void | set_bound_const (int i, uint64_t u, halide_type_t t) noexcept
HALIDE_ALWAYS_INLINE void | set_bound_const (int i, double f, halide_type_t t) noexcept
HALIDE_ALWAYS_INLINE void | set_bound_const (int i, halide_scalar_value_t val, halide_type_t t) noexcept
HALIDE_ALWAYS_INLINE void | get_bound_const (int i, halide_scalar_value_t &val, halide_type_t &type) const noexcept
HALIDE_ALWAYS_INLINE | MatcherState () noexcept

## Public Attributes
const BaseExprNode * | bindings [max_wild]
halide_scalar_value_t | bound_const [max_wild]
halide_type_t | bound_const_type [max_wild]

## Static Public Attributes
static constexpr uint16_t | signed_integer_overflow = 0x8000
static constexpr uint16_t | special_values_mask = 0x8000

## Detailed Description

To save stack space, the matcher objects are largely stateless and immutable.

This state object is built up during matching and then consumed when constructing a replacement Expr.

Definition at line 82 of file IRMatch.h.

## Constructor & Destructor Documentation

## ◆ MatcherState()

HALIDE_ALWAYS_INLINE Halide::Internal::IRMatcher::MatcherState::MatcherState | ( |  | ) |
| inline noexcept

Definition at line 134 of file IRMatch.h.

## Member Function Documentation

## ◆ set_binding()

HALIDE_ALWAYS_INLINE void Halide::Internal::IRMatcher::MatcherState::set_binding | ( | int | i,
|  | const BaseExprNode & | n
| ) |  |
| inline noexcept

Definition at line 93 of file IRMatch.h.

References Halide::Internal::IRMatcher::cast().

Referenced by Halide::Internal::IRMatcher::fuzz_test_rule().

## ◆ get_binding()

HALIDE_ALWAYS_INLINE const BaseExprNode * Halide::Internal::IRMatcher::MatcherState::get_binding | ( | int | i | ) | const
| inline noexcept

Definition at line 98 of file IRMatch.h.

References Halide::Internal::IRMatcher::cast().

Referenced by Halide::Internal::IRMatcher::fuzz_test_rule(), and Halide::Internal::IRMatcher::Wild< i >::make().

## ◆ set_bound_const() [1/4]

HALIDE_ALWAYS_INLINE void Halide::Internal::IRMatcher::MatcherState::set_bound_const | ( | int | i,
|  | int64_t | s,
|  | halide_type_t | t
| ) |  |
| inline noexcept

Definition at line 103 of file IRMatch.h.

References bound_const, bound_const_type, Halide::Internal::IRMatcher::cast(), halide_scalar_value_t::i64, and halide_scalar_value_t::u.

Referenced by Halide::Internal::IRMatcher::fuzz_test_rule().

## ◆ set_bound_const() [2/4]

HALIDE_ALWAYS_INLINE void Halide::Internal::IRMatcher::MatcherState::set_bound_const | ( | int | i,
|  | uint64_t | u,
|  | halide_type_t | t
| ) |  |
| inline noexcept

Definition at line 109 of file IRMatch.h.

References bound_const, bound_const_type, Halide::Internal::IRMatcher::cast(), halide_scalar_value_t::u, and halide_scalar_value_t::u64.

## ◆ set_bound_const() [3/4]

HALIDE_ALWAYS_INLINE void Halide::Internal::IRMatcher::MatcherState::set_bound_const | ( | int | i,
|  | double | f,
|  | halide_type_t | t
| ) |  |
| inline noexcept

Definition at line 115 of file IRMatch.h.

References bound_const, bound_const_type, Halide::Internal::IRMatcher::cast(), halide_scalar_value_t::f64, and halide_scalar_value_t::u.

## ◆ set_bound_const() [4/4]

HALIDE_ALWAYS_INLINE void Halide::Internal::IRMatcher::MatcherState::set_bound_const | ( | int | i,
|  | halide_scalar_value_t | val,
|  | halide_type_t | t
| ) |  |
| inline noexcept

Definition at line 121 of file IRMatch.h.

References bound_const, bound_const_type, and Halide::Internal::IRMatcher::cast().

## ◆ get_bound_const()

HALIDE_ALWAYS_INLINE void Halide::Internal::IRMatcher::MatcherState::get_bound_const | ( | int | i,
|  | halide_scalar_value_t & | val,
|  | halide_type_t & | type
| ) |  | const
| inline noexcept

Definition at line 127 of file IRMatch.h.

References bound_const, bound_const_type, and Halide::Internal::IRMatcher::cast().

Referenced by Halide::Internal::IRMatcher::fuzz_test_rule(), Halide::Internal::IRMatcher::WildConstInt< i >::make(), Halide::Internal::IRMatcher::WildConstUInt< i >::make(), Halide::Internal::IRMatcher::WildConstFloat< i >::make(), Halide::Internal::IRMatcher::WildConst< i >::make(), and Halide::Internal::IRMatcher::WildConstInt< i >::make_folded_const().

## Member Data Documentation

## ◆ bindings

const BaseExprNode* Halide::Internal::IRMatcher::MatcherState::bindings[max_wild]

Definition at line 83 of file IRMatch.h.

## ◆ bound_const

halide_scalar_value_t Halide::Internal::IRMatcher::MatcherState::bound_const[max_wild]

Definition at line 84 of file IRMatch.h.

Referenced by get_bound_const(), set_bound_const(), set_bound_const(), set_bound_const(), and set_bound_const().

## ◆ signed_integer_overflow

constexpr uint16_t Halide::Internal::IRMatcher::MatcherState::signed_integer_overflow = 0x8000
| static constexpr

Definition at line 87 of file IRMatch.h.

Referenced by Halide::Internal::IRMatcher::constant_fold_bin_op< Add >(), Halide::Internal::IRMatcher::constant_fold_bin_op< Mul >(), Halide::Internal::IRMatcher::constant_fold_bin_op< Sub >(), Halide::Internal::IRMatcher::Overflow::make(), Halide::Internal::IRMatcher::make_const_special_expr(), Halide::Internal::IRMatcher::NegateOp< A >::make_folded_const(), and Halide::Internal::IRMatcher::Overflow::make_folded_const().

## ◆ special_values_mask

constexpr uint16_t Halide::Internal::IRMatcher::MatcherState::special_values_mask = 0x8000
| static constexpr

Definition at line 88 of file IRMatch.h.

Referenced by Halide::Internal::IRMatcher::evaluate_predicate(), Halide::Internal::IRMatcher::fuzz_test_rule(), Halide::Internal::IRMatcher::make_const_expr(), Halide::Internal::IRMatcher::make_const_special_expr(), Halide::Internal::IRMatcher::SelectOp< C, T, F >::make_folded_const(), Halide::Internal::IRMatcher::BroadcastOp< A, B >::make_folded_const(), and Halide::Internal::IRMatcher::Overflows< A >::make_folded_const().

## ◆ bound_const_type

halide_type_t Halide::Internal::IRMatcher::MatcherState::bound_const_type[max_wild]

Definition at line 90 of file IRMatch.h.

Referenced by get_bound_const(), set_bound_const(), set_bound_const(), set_bound_const(), and set_bound_const().

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

- src/IRMatch.h