Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Halide::Internal::Simplify Class Reference

#include <Simplify_Internal.h>

Inheritance diagram for Halide::Internal::Simplify:
Halide::Internal::VariadicVisitor< Simplify, Expr, Stmt >

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 *b)
 
HALIDE_ALWAYS_INLINE Expr mutate (const Expr &e, ExprInfo *b)
 
Stmt mutate (const Stmt &s)
 
HALIDE_ALWAYS_INLINE bool may_simplify (const Type &t) const
 
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
 
bool no_float_simplify = false
 
Scope< VarInfovar_info
 
Scope< ExprInfobounds_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, IRDeepComparetruths
 
std::set< Expr, IRDeepComparefalsehoods
 

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 * b)
inline

Definition at line 131 of file Simplify_Internal.h.

◆ mutate() [1/2]

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

◆ mutate() [2/2]

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

◆ may_simplify()

HALIDE_ALWAYS_INLINE bool Halide::Internal::Simplify::may_simplify ( const Type & t) const
inline

Definition at line 203 of file Simplify_Internal.h.

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

◆ no_overflow_int()

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

Definition at line 209 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 214 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

◆ 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

◆ scoped_truth()

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

◆ scoped_falsehood()

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

◆ mutate_let_body() [1/2]

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

Definition at line 325 of file Simplify_Internal.h.

References mutate().

◆ mutate_let_body() [2/2]

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

Definition at line 328 of file Simplify_Internal.h.

References 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 199 of file Simplify_Internal.h.

◆ no_float_simplify

bool Halide::Internal::Simplify::no_float_simplify = false

Definition at line 200 of file Simplify_Internal.h.

Referenced by may_simplify().

◆ var_info

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

Definition at line 230 of file Simplify_Internal.h.

◆ bounds_and_alignment_info

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

Definition at line 233 of file Simplify_Internal.h.

◆ x

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

Definition at line 236 of file Simplify_Internal.h.

◆ y

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

Definition at line 237 of file Simplify_Internal.h.

◆ z

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

Definition at line 238 of file Simplify_Internal.h.

◆ w

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

Definition at line 239 of file Simplify_Internal.h.

◆ u

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

Definition at line 240 of file Simplify_Internal.h.

◆ v

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

Definition at line 241 of file Simplify_Internal.h.

◆ c0

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

Definition at line 242 of file Simplify_Internal.h.

◆ c1

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

Definition at line 243 of file Simplify_Internal.h.

◆ c2

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

Definition at line 244 of file Simplify_Internal.h.

◆ c3

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

Definition at line 245 of file Simplify_Internal.h.

◆ c4

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

Definition at line 246 of file Simplify_Internal.h.

◆ c5

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

Definition at line 247 of file Simplify_Internal.h.

◆ in_vector_loop

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

Definition at line 252 of file Simplify_Internal.h.

◆ in_unreachable

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

Definition at line 255 of file Simplify_Internal.h.

◆ truths

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

Definition at line 281 of file Simplify_Internal.h.

◆ falsehoods

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

Definition at line 281 of file Simplify_Internal.h.


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