Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
Halide::Internal::Simplify Class Reference

`#include <Simplify_Internal.h>`

Inheritance diagram for Halide::Internal::Simplify:

## Classes
struct | ExprInfo
struct | ScopedFact
struct | VarInfo

## Public Member Functions
| Simplify (bool r, const Scope< Interval > *bi, const Scope< ModulusRemainder > *ai)
HALIDE_ALWAYS_INLINE void | clear_expr_info (ExprInfo *info)
void | set_expr_info_to_constant (ExprInfo *info, int64_t c) const
int64_t | normalize_constant (const Type &t, int64_t c)
Expr | make_const (const Type &t, int64_t c, ExprInfo *info)
Expr | make_const (const Type &t, uint64_t c, ExprInfo *info)
HALIDE_ALWAYS_INLINE Expr | make_const (const Type &t, double c, ExprInfo *info)
HALIDE_ALWAYS_INLINE Expr | const_false (int lanes, ExprInfo *info)
HALIDE_ALWAYS_INLINE Expr | const_true (int lanes, ExprInfo *info)
HALIDE_ALWAYS_INLINE Expr | mutate (const Expr &e, ExprInfo *b)
Stmt | mutate (const Stmt &s)
HALIDE_ALWAYS_INLINE bool | no_overflow_int (Type t)
HALIDE_ALWAYS_INLINE bool | no_overflow_scalar_int (Type t)
HALIDE_ALWAYS_INLINE bool | no_overflow (Type t)
void | found_buffer_reference (const std::string &name, size_t dimensions=0)
HALIDE_ALWAYS_INLINE bool | should_commute (const Expr &a, const Expr &b)
ScopedFact | scoped_truth (const Expr &fact)
ScopedFact | scoped_falsehood (const Expr &fact)
Stmt | mutate_let_body (const Stmt &s, ExprInfo *)
Expr | mutate_let_body (const Expr &e, ExprInfo *info)
template<typename T , typename Body >
Body | simplify_let (const T *op, ExprInfo *info)
Expr | visit (const IntImm *op, ExprInfo *info)
Expr | visit (const UIntImm *op, ExprInfo *info)
Expr | visit (const FloatImm *op, ExprInfo *info)
Expr | visit (const StringImm *op, ExprInfo *info)
Expr | visit (const Broadcast *op, ExprInfo *info)
Expr | visit (const Cast *op, ExprInfo *info)
Expr | visit (const Reinterpret *op, ExprInfo *info)
Expr | visit (const Variable *op, ExprInfo *info)
Expr | visit (const Add *op, ExprInfo *info)
Expr | visit (const Sub *op, ExprInfo *info)
Expr | visit (const Mul *op, ExprInfo *info)
Expr | visit (const Div *op, ExprInfo *info)
Expr | visit (const Mod *op, ExprInfo *info)
Expr | visit (const Min *op, ExprInfo *info)
Expr | visit (const Max *op, ExprInfo *info)
Expr | visit (const EQ *op, ExprInfo *info)
Expr | visit (const NE *op, ExprInfo *info)
Expr | visit (const LT *op, ExprInfo *info)
Expr | visit (const LE *op, ExprInfo *info)
Expr | visit (const GT *op, ExprInfo *info)
Expr | visit (const GE *op, ExprInfo *info)
Expr | visit (const And *op, ExprInfo *info)
Expr | visit (const Or *op, ExprInfo *info)
Expr | visit (const Not *op, ExprInfo *info)
Expr | visit (const Select *op, ExprInfo *info)
Expr | visit (const Ramp *op, ExprInfo *info)
Stmt | visit (const IfThenElse *op)
Expr | visit (const Load *op, ExprInfo *info)
Expr | visit (const Call *op, ExprInfo *info)
Expr | visit (const Shuffle *op, ExprInfo *info)
Expr | visit (const VectorReduce *op, ExprInfo *info)
Expr | visit (const Let *op, ExprInfo *info)
Stmt | visit (const LetStmt *op)
Stmt | visit (const AssertStmt *op)
Stmt | visit (const For *op)
Stmt | visit (const Provide *op)
Stmt | visit (const Store *op)
Stmt | visit (const Allocate *op)
Stmt | visit (const Evaluate *op)
Stmt | visit (const ProducerConsumer *op)
Stmt | visit (const Block *op)
Stmt | visit (const Realize *op)
Stmt | visit (const Prefetch *op)
Stmt | visit (const Free *op)
Stmt | visit (const Acquire *op)
Stmt | visit (const Fork *op)
Stmt | visit (const Atomic *op)
Stmt | visit (const HoistedStorage *op)
std::pair< std::vector< Expr >, bool > | mutate_with_changes (const std::vector< Expr > &old_exprs)
Public Member Functions inherited from Halide::Internal::VariadicVisitor< Simplify, Expr, Stmt >
HALIDE_ALWAYS_INLINE Stmt | dispatch (const Stmt &s, Args &&...args)
HALIDE_ALWAYS_INLINE Stmt | dispatch (Stmt &&s, Args &&...args)
HALIDE_ALWAYS_INLINE Expr | dispatch (const Expr &e, Args &&...args)
HALIDE_ALWAYS_INLINE Expr | dispatch (Expr &&e, Args &&...args)

## Public Attributes
bool | remove_dead_code
Scope< VarInfo > | var_info
Scope< ExprInfo > | bounds_and_alignment_info
IRMatcher::Wild< 0 > | x
IRMatcher::Wild< 1 > | y
IRMatcher::Wild< 2 > | z
IRMatcher::Wild< 3 > | w
IRMatcher::Wild< 4 > | u
IRMatcher::Wild< 5 > | v
IRMatcher::WildConst< 0 > | c0
IRMatcher::WildConst< 1 > | c1
IRMatcher::WildConst< 2 > | c2
IRMatcher::WildConst< 3 > | c3
IRMatcher::WildConst< 4 > | c4
IRMatcher::WildConst< 5 > | c5
bool | in_vector_loop = false
bool | in_unreachable = false
std::set< Expr, IRDeepCompare > | truths
std::set< Expr, IRDeepCompare > | falsehoods

## Detailed Description

Definition at line 33 of file Simplify_Internal.h.

## Constructor & Destructor Documentation

## ◆ Simplify()

Halide::Internal::Simplify::Simplify | ( | bool | r,
|  | const Scope< Interval > * | bi,
|  | const Scope< ModulusRemainder > * | ai
| ) |  |

## Member Function Documentation

## ◆ clear_expr_info()

HALIDE_ALWAYS_INLINE void Halide::Internal::Simplify::clear_expr_info | ( | ExprInfo * | info | ) |
| inline

Definition at line 199 of file Simplify_Internal.h.

References Halide::cast().

## ◆ set_expr_info_to_constant()

void Halide::Internal::Simplify::set_expr_info_to_constant | ( | ExprInfo * | info,
|  | int64_t | c
| ) |  | const
| inline

Definition at line 205 of file Simplify_Internal.h.

References Halide::cast(), and Halide::Internal::ConstantInterval::single_point().

Referenced by make_const(), and make_const().

## ◆ normalize_constant()

int64_t Halide::Internal::Simplify::normalize_constant | ( | const Type & | t,
|  | int64_t | c
| ) |  |
| inline

Definition at line 212 of file Simplify_Internal.h.

References Halide::Type::bits(), Halide::cast(), Halide::Type::is_int(), and Halide::Type::is_uint().

Referenced by make_const(), and make_const().

## ◆ make_const() [1/3]

Expr Halide::Internal::Simplify::make_const | ( | const Type & | t,
|  | int64_t | c,
|  | ExprInfo * | info
| ) |  |
| inline

Definition at line 243 of file Simplify_Internal.h.

References Halide::cast(), Halide::Internal::make_const(), normalize_constant(), and set_expr_info_to_constant().

Referenced by const_false(), and const_true().

## ◆ make_const() [2/3]

Expr Halide::Internal::Simplify::make_const | ( | const Type & | t,
|  | uint64_t | c,
|  | ExprInfo * | info
| ) |  |
| inline

Definition at line 249 of file Simplify_Internal.h.

References Halide::Internal::ConstantInterval::bounded_below(), Halide::cast(), Halide::Internal::make_const(), normalize_constant(), and set_expr_info_to_constant().

## ◆ make_const() [3/3]

HALIDE_ALWAYS_INLINE Expr Halide::Internal::Simplify::make_const | ( | const Type & | t,
|  | double | c,
|  | ExprInfo * | info
| ) |  |
| inline

Definition at line 269 of file Simplify_Internal.h.

References Halide::Internal::make_const().

## ◆ const_false()

HALIDE_ALWAYS_INLINE Expr Halide::Internal::Simplify::const_false | ( | int | lanes,
|  | ExprInfo * | info
| ) |  |
| inline

Definition at line 275 of file Simplify_Internal.h.

References Halide::cast(), make_const(), and Halide::UInt().

## ◆ const_true()

HALIDE_ALWAYS_INLINE Expr Halide::Internal::Simplify::const_true | ( | int | lanes,
|  | ExprInfo * | info
| ) |  |
| inline

Definition at line 280 of file Simplify_Internal.h.

References Halide::cast(), make_const(), and Halide::UInt().

## ◆ mutate() [1/2]

HALIDE_ALWAYS_INLINE Expr Halide::Internal::Simplify::mutate | ( | const Expr & | e,
|  | ExprInfo * | b
| ) |  |
| inline

Definition at line 330 of file Simplify_Internal.h.

References Halide::Internal::VariadicVisitor< Simplify, Expr, Stmt >::dispatch().

Referenced by mutate_let_body(), and mutate_let_body().

## ◆ mutate() [2/2]

Stmt Halide::Internal::Simplify::mutate | ( | const Stmt & | s | ) |
| inline

Definition at line 351 of file Simplify_Internal.h.

References Halide::cast(), and Halide::Internal::VariadicVisitor< Simplify, Expr, Stmt >::dispatch().

## ◆ no_overflow_int()

HALIDE_ALWAYS_INLINE bool Halide::Internal::Simplify::no_overflow_int | ( | Type | t | ) |
| inline

Definition at line 360 of file Simplify_Internal.h.

References Halide::Type::bits(), and Halide::Type::is_int().

Referenced by no_overflow(), and no_overflow_scalar_int().

## ◆ no_overflow_scalar_int()

HALIDE_ALWAYS_INLINE bool Halide::Internal::Simplify::no_overflow_scalar_int | ( | Type | t | ) |
| inline

Definition at line 365 of file Simplify_Internal.h.

References Halide::Type::is_scalar(), and no_overflow_int().

## ◆ no_overflow()

HALIDE_ALWAYS_INLINE bool Halide::Internal::Simplify::no_overflow | ( | Type | t | ) |
| inline

Definition at line 371 of file Simplify_Internal.h.

References Halide::Type::is_float(), and no_overflow_int().

Referenced by Halide::Internal::Simplify::ExprInfo::trim_bounds_using_alignment().

## ◆ found_buffer_reference()

void Halide::Internal::Simplify::found_buffer_reference | ( | const std::string & | name,
|  | size_t | dimensions = `0`
| ) |  |

## ◆ should_commute()

HALIDE_ALWAYS_INLINE bool Halide::Internal::Simplify::should_commute | ( | const Expr & | a,
|  | const Expr & | b
| ) |  |
| inline

Definition at line 415 of file Simplify_Internal.h.

References Halide::Internal::IRHandle::as(), Halide::cast(), Halide::Internal::IRHandle::node_type(), and Halide::Internal::Variable.

## ◆ scoped_truth()

ScopedFact Halide::Internal::Simplify::scoped_truth | ( | const Expr & | fact | ) |
| inline

Definition at line 462 of file Simplify_Internal.h.

References Halide::cast(), and Halide::Internal::Simplify::ScopedFact::learn_true().

## ◆ scoped_falsehood()

ScopedFact Halide::Internal::Simplify::scoped_falsehood | ( | const Expr & | fact | ) |
| inline

Definition at line 470 of file Simplify_Internal.h.

References Halide::cast(), and Halide::Internal::Simplify::ScopedFact::learn_false().

## ◆ mutate_let_body() [1/2]

Stmt Halide::Internal::Simplify::mutate_let_body | ( | const Stmt & | s,
|  | ExprInfo * |
| ) |  |
| inline

Definition at line 476 of file Simplify_Internal.h.

References Halide::cast(), and mutate().

## ◆ mutate_let_body() [2/2]

Expr Halide::Internal::Simplify::mutate_let_body | ( | const Expr & | e,
|  | ExprInfo * | info
| ) |  |
| inline

Definition at line 479 of file Simplify_Internal.h.

References Halide::cast(), and mutate().

## ◆ simplify_let()

template<typename T , typename Body >

Body Halide::Internal::Simplify::simplify_let | ( | const T * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [1/48]

Expr Halide::Internal::Simplify::visit | ( | const IntImm * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [2/48]

Expr Halide::Internal::Simplify::visit | ( | const UIntImm * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [3/48]

Expr Halide::Internal::Simplify::visit | ( | const FloatImm * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [4/48]

Expr Halide::Internal::Simplify::visit | ( | const StringImm * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [5/48]

Expr Halide::Internal::Simplify::visit | ( | const Broadcast * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [6/48]

Expr Halide::Internal::Simplify::visit | ( | const Cast * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [7/48]

Expr Halide::Internal::Simplify::visit | ( | const Reinterpret * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [8/48]

Expr Halide::Internal::Simplify::visit | ( | const Variable * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [9/48]

Expr Halide::Internal::Simplify::visit | ( | const Add * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [10/48]

Expr Halide::Internal::Simplify::visit | ( | const Sub * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [11/48]

Expr Halide::Internal::Simplify::visit | ( | const Mul * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [12/48]

Expr Halide::Internal::Simplify::visit | ( | const Div * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [13/48]

Expr Halide::Internal::Simplify::visit | ( | const Mod * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [14/48]

Expr Halide::Internal::Simplify::visit | ( | const Min * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [15/48]

Expr Halide::Internal::Simplify::visit | ( | const Max * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [16/48]

Expr Halide::Internal::Simplify::visit | ( | const EQ * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [17/48]

Expr Halide::Internal::Simplify::visit | ( | const NE * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [18/48]

Expr Halide::Internal::Simplify::visit | ( | const LT * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [19/48]

Expr Halide::Internal::Simplify::visit | ( | const LE * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [20/48]

Expr Halide::Internal::Simplify::visit | ( | const GT * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [21/48]

Expr Halide::Internal::Simplify::visit | ( | const GE * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [22/48]

Expr Halide::Internal::Simplify::visit | ( | const And * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [23/48]

Expr Halide::Internal::Simplify::visit | ( | const Or * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [24/48]

Expr Halide::Internal::Simplify::visit | ( | const Not * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [25/48]

Expr Halide::Internal::Simplify::visit | ( | const Select * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [26/48]

Expr Halide::Internal::Simplify::visit | ( | const Ramp * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [27/48]

Stmt Halide::Internal::Simplify::visit | ( | const IfThenElse * | op | ) |

## ◆ visit() [28/48]

Expr Halide::Internal::Simplify::visit | ( | const Load * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [29/48]

Expr Halide::Internal::Simplify::visit | ( | const Call * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [30/48]

Expr Halide::Internal::Simplify::visit | ( | const Shuffle * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [31/48]

Expr Halide::Internal::Simplify::visit | ( | const VectorReduce * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [32/48]

Expr Halide::Internal::Simplify::visit | ( | const Let * | op,
|  | ExprInfo * | info
| ) |  |

## ◆ visit() [33/48]

Stmt Halide::Internal::Simplify::visit | ( | const LetStmt * | op | ) |

## ◆ visit() [34/48]

Stmt Halide::Internal::Simplify::visit | ( | const AssertStmt * | op | ) |

## ◆ visit() [35/48]

Stmt Halide::Internal::Simplify::visit | ( | const For * | op | ) |

## ◆ visit() [36/48]

Stmt Halide::Internal::Simplify::visit | ( | const Provide * | op | ) |

## ◆ visit() [37/48]

Stmt Halide::Internal::Simplify::visit | ( | const Store * | op | ) |

## ◆ visit() [38/48]

Stmt Halide::Internal::Simplify::visit | ( | const Allocate * | op | ) |

## ◆ visit() [39/48]

Stmt Halide::Internal::Simplify::visit | ( | const Evaluate * | op | ) |

## ◆ visit() [40/48]

Stmt Halide::Internal::Simplify::visit | ( | const ProducerConsumer * | op | ) |

## ◆ visit() [41/48]

Stmt Halide::Internal::Simplify::visit | ( | const Block * | op | ) |

## ◆ visit() [42/48]

Stmt Halide::Internal::Simplify::visit | ( | const Realize * | op | ) |

## ◆ visit() [43/48]

Stmt Halide::Internal::Simplify::visit | ( | const Prefetch * | op | ) |

## ◆ visit() [44/48]

Stmt Halide::Internal::Simplify::visit | ( | const Free * | op | ) |

## ◆ visit() [45/48]

Stmt Halide::Internal::Simplify::visit | ( | const Acquire * | op | ) |

## ◆ visit() [46/48]

Stmt Halide::Internal::Simplify::visit | ( | const Fork * | op | ) |

## ◆ visit() [47/48]

Stmt Halide::Internal::Simplify::visit | ( | const Atomic * | op | ) |

## ◆ visit() [48/48]

Stmt Halide::Internal::Simplify::visit | ( | const HoistedStorage * | op | ) |

## ◆ mutate_with_changes()

std::pair< std::vector< Expr >, bool > Halide::Internal::Simplify::mutate_with_changes | ( | const std::vector< Expr > & | old_exprs | ) |

## Member Data Documentation

## ◆ remove_dead_code

bool Halide::Internal::Simplify::remove_dead_code

Definition at line 356 of file Simplify_Internal.h.

## ◆ var_info

Scope<VarInfo> Halide::Internal::Simplify::var_info

Definition at line 381 of file Simplify_Internal.h.

## ◆ bounds_and_alignment_info

Scope<ExprInfo> Halide::Internal::Simplify::bounds_and_alignment_info

Definition at line 384 of file Simplify_Internal.h.

## ◆ x

IRMatcher::Wild<0> Halide::Internal::Simplify::x

Definition at line 387 of file Simplify_Internal.h.

Referenced by Halide::Internal::Simplify::ExprInfo::largest_power_of_two_factor().

## ◆ y

IRMatcher::Wild<1> Halide::Internal::Simplify::y

Definition at line 388 of file Simplify_Internal.h.

## ◆ z

IRMatcher::Wild<2> Halide::Internal::Simplify::z

Definition at line 389 of file Simplify_Internal.h.

## ◆ w

IRMatcher::Wild<3> Halide::Internal::Simplify::w

Definition at line 390 of file Simplify_Internal.h.

## ◆ u

IRMatcher::Wild<4> Halide::Internal::Simplify::u

Definition at line 391 of file Simplify_Internal.h.

## ◆ v

IRMatcher::Wild<5> Halide::Internal::Simplify::v

Definition at line 392 of file Simplify_Internal.h.

## ◆ c0

IRMatcher::WildConst<0> Halide::Internal::Simplify::c0

Definition at line 393 of file Simplify_Internal.h.

## ◆ c1

IRMatcher::WildConst<1> Halide::Internal::Simplify::c1

Definition at line 394 of file Simplify_Internal.h.

## ◆ c2

IRMatcher::WildConst<2> Halide::Internal::Simplify::c2

Definition at line 395 of file Simplify_Internal.h.

## ◆ c3

IRMatcher::WildConst<3> Halide::Internal::Simplify::c3

Definition at line 396 of file Simplify_Internal.h.

## ◆ c4

IRMatcher::WildConst<4> Halide::Internal::Simplify::c4

Definition at line 397 of file Simplify_Internal.h.

## ◆ c5

IRMatcher::WildConst<5> Halide::Internal::Simplify::c5

Definition at line 398 of file Simplify_Internal.h.

## ◆ in_vector_loop

bool Halide::Internal::Simplify::in_vector_loop = false

Definition at line 403 of file Simplify_Internal.h.

## ◆ in_unreachable

bool Halide::Internal::Simplify::in_unreachable = false

Definition at line 406 of file Simplify_Internal.h.

## ◆ truths

std::set<Expr, IRDeepCompare> Halide::Internal::Simplify::truths

Definition at line 432 of file Simplify_Internal.h.

## ◆ falsehoods

std::set<Expr, IRDeepCompare> Halide::Internal::Simplify::falsehoods

Definition at line 432 of file Simplify_Internal.h.

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

- src/Simplify_Internal.h