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 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)
 
template<typename T >
Expr hoist_slice_vector (Expr e)
 
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 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)
 
- 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_lets
 
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
 
bool in_vector_loop = false
 
std::set< Expr, IRDeepComparetruths
 
std::set< Expr, IRDeepComparefalsehoods
 

Detailed Description

Definition at line 31 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

◆ 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 146 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 152 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 157 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 163 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

◆ hoist_slice_vector()

template<typename T >
Expr Halide::Internal::Simplify::hoist_slice_vector ( Expr  e)

◆ mutate_let_body() [1/2]

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

Definition at line 266 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 269 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/46]

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

◆ visit() [2/46]

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

◆ visit() [3/46]

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

◆ visit() [4/46]

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

◆ visit() [5/46]

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

◆ visit() [6/46]

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

◆ visit() [7/46]

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

◆ visit() [8/46]

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

◆ visit() [9/46]

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

◆ visit() [10/46]

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

◆ visit() [11/46]

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

◆ visit() [12/46]

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

◆ visit() [13/46]

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

◆ visit() [14/46]

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

◆ visit() [15/46]

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

◆ visit() [16/46]

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

◆ visit() [17/46]

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

◆ visit() [18/46]

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

◆ visit() [19/46]

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

◆ visit() [20/46]

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

◆ visit() [21/46]

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

◆ visit() [22/46]

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

◆ visit() [23/46]

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

◆ visit() [24/46]

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

◆ visit() [25/46]

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

◆ visit() [26/46]

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

◆ visit() [27/46]

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

◆ visit() [28/46]

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

◆ visit() [29/46]

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

◆ visit() [30/46]

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

◆ visit() [31/46]

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

◆ visit() [32/46]

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

◆ visit() [33/46]

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

◆ visit() [34/46]

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

◆ visit() [35/46]

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

◆ visit() [36/46]

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

◆ visit() [37/46]

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

◆ visit() [38/46]

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

◆ visit() [39/46]

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

◆ visit() [40/46]

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

◆ visit() [41/46]

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

◆ visit() [42/46]

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

◆ visit() [43/46]

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

◆ visit() [44/46]

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

◆ visit() [45/46]

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

◆ visit() [46/46]

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

Member Data Documentation

◆ remove_dead_lets

bool Halide::Internal::Simplify::remove_dead_lets

Definition at line 142 of file Simplify_Internal.h.

◆ no_float_simplify

bool Halide::Internal::Simplify::no_float_simplify

Definition at line 143 of file Simplify_Internal.h.

Referenced by may_simplify().

◆ var_info

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

Definition at line 173 of file Simplify_Internal.h.

◆ bounds_and_alignment_info

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

Definition at line 176 of file Simplify_Internal.h.

◆ x

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

Definition at line 179 of file Simplify_Internal.h.

◆ y

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

Definition at line 180 of file Simplify_Internal.h.

◆ z

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

Definition at line 181 of file Simplify_Internal.h.

◆ w

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

Definition at line 182 of file Simplify_Internal.h.

◆ u

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

Definition at line 183 of file Simplify_Internal.h.

◆ v

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

Definition at line 184 of file Simplify_Internal.h.

◆ c0

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

Definition at line 185 of file Simplify_Internal.h.

◆ c1

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

Definition at line 186 of file Simplify_Internal.h.

◆ c2

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

Definition at line 187 of file Simplify_Internal.h.

◆ c3

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

Definition at line 188 of file Simplify_Internal.h.

◆ in_vector_loop

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

Definition at line 193 of file Simplify_Internal.h.

◆ truths

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

Definition at line 223 of file Simplify_Internal.h.

◆ falsehoods

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

Definition at line 223 of file Simplify_Internal.h.


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