Halide
Halide::Internal::Simplify Class Reference

#include <Simplify_Internal.h>

Inherits 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_bounds_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)
 
bool const_float (const Expr &e, double *f)
 
bool const_int (const Expr &e, int64_t *i)
 
bool const_uint (const Expr &e, uint64_t *u)
 
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 *bounds)
 
template<typename T , typename Body >
Body simplify_let (const T *op, ExprInfo *bounds)
 
Expr visit (const IntImm *op, ExprInfo *bounds)
 
Expr visit (const UIntImm *op, ExprInfo *bounds)
 
Expr visit (const FloatImm *op, ExprInfo *bounds)
 
Expr visit (const StringImm *op, ExprInfo *bounds)
 
Expr visit (const Broadcast *op, ExprInfo *bounds)
 
Expr visit (const Cast *op, ExprInfo *bounds)
 
Expr visit (const Reinterpret *op, ExprInfo *bounds)
 
Expr visit (const Variable *op, ExprInfo *bounds)
 
Expr visit (const Add *op, ExprInfo *bounds)
 
Expr visit (const Sub *op, ExprInfo *bounds)
 
Expr visit (const Mul *op, ExprInfo *bounds)
 
Expr visit (const Div *op, ExprInfo *bounds)
 
Expr visit (const Mod *op, ExprInfo *bounds)
 
Expr visit (const Min *op, ExprInfo *bounds)
 
Expr visit (const Max *op, ExprInfo *bounds)
 
Expr visit (const EQ *op, ExprInfo *bounds)
 
Expr visit (const NE *op, ExprInfo *bounds)
 
Expr visit (const LT *op, ExprInfo *bounds)
 
Expr visit (const LE *op, ExprInfo *bounds)
 
Expr visit (const GT *op, ExprInfo *bounds)
 
Expr visit (const GE *op, ExprInfo *bounds)
 
Expr visit (const And *op, ExprInfo *bounds)
 
Expr visit (const Or *op, ExprInfo *bounds)
 
Expr visit (const Not *op, ExprInfo *bounds)
 
Expr visit (const Select *op, ExprInfo *bounds)
 
Expr visit (const Ramp *op, ExprInfo *bounds)
 
Stmt visit (const IfThenElse *op)
 
Expr visit (const Load *op, ExprInfo *bounds)
 
Expr visit (const Call *op, ExprInfo *bounds)
 
Expr visit (const Shuffle *op, ExprInfo *bounds)
 
Expr visit (const VectorReduce *op, ExprInfo *bounds)
 
Expr visit (const Let *op, ExprInfo *bounds)
 
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)
 
std::pair< std::vector< Expr >, bool > mutate_with_changes (const std::vector< Expr > &old_exprs, ExprInfo *bounds)
 
- 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
 
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 42 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_bounds_info()

HALIDE_ALWAYS_INLINE void Halide::Internal::Simplify::clear_bounds_info ( ExprInfo b)
inline

Definition at line 106 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 164 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 170 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 175 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 181 of file Simplify_Internal.h.

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

◆ found_buffer_reference()

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

◆ const_float()

bool Halide::Internal::Simplify::const_float ( const Expr e,
double *  f 
)

◆ const_int()

bool Halide::Internal::Simplify::const_int ( const Expr e,
int64_t i 
)

◆ const_uint()

bool Halide::Internal::Simplify::const_uint ( const Expr e,
uint64_t u 
)

◆ 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 292 of file Simplify_Internal.h.

References mutate().

◆ mutate_let_body() [2/2]

Expr Halide::Internal::Simplify::mutate_let_body ( const Expr e,
ExprInfo bounds 
)
inline

Definition at line 295 of file Simplify_Internal.h.

References mutate().

◆ simplify_let()

template<typename T , typename Body >
Body Halide::Internal::Simplify::simplify_let ( const T *  op,
ExprInfo bounds 
)

◆ visit() [1/47]

Expr Halide::Internal::Simplify::visit ( const IntImm op,
ExprInfo bounds 
)

◆ visit() [2/47]

Expr Halide::Internal::Simplify::visit ( const UIntImm op,
ExprInfo bounds 
)

◆ visit() [3/47]

Expr Halide::Internal::Simplify::visit ( const FloatImm op,
ExprInfo bounds 
)

◆ visit() [4/47]

Expr Halide::Internal::Simplify::visit ( const StringImm op,
ExprInfo bounds 
)

◆ visit() [5/47]

Expr Halide::Internal::Simplify::visit ( const Broadcast op,
ExprInfo bounds 
)

◆ visit() [6/47]

Expr Halide::Internal::Simplify::visit ( const Cast op,
ExprInfo bounds 
)

◆ visit() [7/47]

Expr Halide::Internal::Simplify::visit ( const Reinterpret op,
ExprInfo bounds 
)

◆ visit() [8/47]

Expr Halide::Internal::Simplify::visit ( const Variable op,
ExprInfo bounds 
)

◆ visit() [9/47]

Expr Halide::Internal::Simplify::visit ( const Add op,
ExprInfo bounds 
)

◆ visit() [10/47]

Expr Halide::Internal::Simplify::visit ( const Sub op,
ExprInfo bounds 
)

◆ visit() [11/47]

Expr Halide::Internal::Simplify::visit ( const Mul op,
ExprInfo bounds 
)

◆ visit() [12/47]

Expr Halide::Internal::Simplify::visit ( const Div op,
ExprInfo bounds 
)

◆ visit() [13/47]

Expr Halide::Internal::Simplify::visit ( const Mod op,
ExprInfo bounds 
)

◆ visit() [14/47]

Expr Halide::Internal::Simplify::visit ( const Min op,
ExprInfo bounds 
)

◆ visit() [15/47]

Expr Halide::Internal::Simplify::visit ( const Max op,
ExprInfo bounds 
)

◆ visit() [16/47]

Expr Halide::Internal::Simplify::visit ( const EQ op,
ExprInfo bounds 
)

◆ visit() [17/47]

Expr Halide::Internal::Simplify::visit ( const NE op,
ExprInfo bounds 
)

◆ visit() [18/47]

Expr Halide::Internal::Simplify::visit ( const LT op,
ExprInfo bounds 
)

◆ visit() [19/47]

Expr Halide::Internal::Simplify::visit ( const LE op,
ExprInfo bounds 
)

◆ visit() [20/47]

Expr Halide::Internal::Simplify::visit ( const GT op,
ExprInfo bounds 
)

◆ visit() [21/47]

Expr Halide::Internal::Simplify::visit ( const GE op,
ExprInfo bounds 
)

◆ visit() [22/47]

Expr Halide::Internal::Simplify::visit ( const And op,
ExprInfo bounds 
)

◆ visit() [23/47]

Expr Halide::Internal::Simplify::visit ( const Or op,
ExprInfo bounds 
)

◆ visit() [24/47]

Expr Halide::Internal::Simplify::visit ( const Not op,
ExprInfo bounds 
)

◆ visit() [25/47]

Expr Halide::Internal::Simplify::visit ( const Select op,
ExprInfo bounds 
)

◆ visit() [26/47]

Expr Halide::Internal::Simplify::visit ( const Ramp op,
ExprInfo bounds 
)

◆ visit() [27/47]

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

◆ visit() [28/47]

Expr Halide::Internal::Simplify::visit ( const Load op,
ExprInfo bounds 
)

◆ visit() [29/47]

Expr Halide::Internal::Simplify::visit ( const Call op,
ExprInfo bounds 
)

◆ visit() [30/47]

Expr Halide::Internal::Simplify::visit ( const Shuffle op,
ExprInfo bounds 
)

◆ visit() [31/47]

Expr Halide::Internal::Simplify::visit ( const VectorReduce op,
ExprInfo bounds 
)

◆ visit() [32/47]

Expr Halide::Internal::Simplify::visit ( const Let op,
ExprInfo bounds 
)

◆ visit() [33/47]

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

◆ visit() [34/47]

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

◆ visit() [35/47]

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

◆ visit() [36/47]

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

◆ visit() [37/47]

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

◆ visit() [38/47]

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

◆ visit() [39/47]

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

◆ visit() [40/47]

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

◆ visit() [41/47]

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

◆ visit() [42/47]

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

◆ visit() [43/47]

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

◆ visit() [44/47]

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

◆ visit() [45/47]

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

◆ visit() [46/47]

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

◆ visit() [47/47]

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

◆ mutate_with_changes()

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

Member Data Documentation

◆ remove_dead_code

bool Halide::Internal::Simplify::remove_dead_code

Definition at line 160 of file Simplify_Internal.h.

◆ no_float_simplify

bool Halide::Internal::Simplify::no_float_simplify

Definition at line 161 of file Simplify_Internal.h.

Referenced by may_simplify().

◆ var_info

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

Definition at line 191 of file Simplify_Internal.h.

◆ bounds_and_alignment_info

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

Definition at line 194 of file Simplify_Internal.h.

◆ x

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

Definition at line 197 of file Simplify_Internal.h.

◆ y

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

Definition at line 198 of file Simplify_Internal.h.

◆ z

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

Definition at line 199 of file Simplify_Internal.h.

◆ w

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

Definition at line 200 of file Simplify_Internal.h.

◆ u

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

Definition at line 201 of file Simplify_Internal.h.

◆ v

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

Definition at line 202 of file Simplify_Internal.h.

◆ c0

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

Definition at line 203 of file Simplify_Internal.h.

◆ c1

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

Definition at line 204 of file Simplify_Internal.h.

◆ c2

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

Definition at line 205 of file Simplify_Internal.h.

◆ c3

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

Definition at line 206 of file Simplify_Internal.h.

◆ c4

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

Definition at line 207 of file Simplify_Internal.h.

◆ c5

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

Definition at line 208 of file Simplify_Internal.h.

◆ in_vector_loop

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

Definition at line 213 of file Simplify_Internal.h.

◆ in_unreachable

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

Definition at line 216 of file Simplify_Internal.h.

◆ truths

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

Definition at line 248 of file Simplify_Internal.h.

◆ falsehoods

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

Definition at line 248 of file Simplify_Internal.h.


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