Halide
Simplify.h
Go to the documentation of this file.
1 #ifndef HALIDE_SIMPLIFY_H
2 #define HALIDE_SIMPLIFY_H
3 
4 /** \file
5  * Methods for simplifying halide statements and expressions
6  */
7 
8 #include "Expr.h"
9 #include "Interval.h"
10 #include "ModulusRemainder.h"
11 #include "Scope.h"
12 
13 namespace Halide {
14 namespace Internal {
15 
16 /** Perform a a wide range of simplifications to expressions and
17  * statements, including constant folding, substituting in trivial
18  * values, arithmetic rearranging, etc. Simplifies across let
19  * statements, so must not be called on stmts with dangling or
20  * repeated variable names.
21  */
22 // @{
23 Stmt simplify(const Stmt &, bool remove_dead_code = true,
24  const Scope<Interval> &bounds = Scope<Interval>::empty_scope(),
25  const Scope<ModulusRemainder> &alignment = Scope<ModulusRemainder>::empty_scope());
26 Expr simplify(const Expr &, bool remove_dead_code = true,
27  const Scope<Interval> &bounds = Scope<Interval>::empty_scope(),
28  const Scope<ModulusRemainder> &alignment = Scope<ModulusRemainder>::empty_scope());
29 // @}
30 
31 /** Attempt to statically prove an expression is true using the simplifier. */
32 bool can_prove(Expr e, const Scope<Interval> &bounds = Scope<Interval>::empty_scope());
33 
34 /** Simplify expressions found in a statement, but don't simplify
35  * across different statements. This is safe to perform at an earlier
36  * stage in lowering than full simplification of a stmt. */
37 Stmt simplify_exprs(const Stmt &);
38 
39 } // namespace Internal
40 } // namespace Halide
41 
42 #endif
Scope.h
Halide::Internal::can_prove
bool can_prove(Expr e, const Scope< Interval > &bounds=Scope< Interval >::empty_scope())
Attempt to statically prove an expression is true using the simplifier.
Halide::Internal::simplify
Stmt simplify(const Stmt &, bool remove_dead_code=true, const Scope< Interval > &bounds=Scope< Interval >::empty_scope(), const Scope< ModulusRemainder > &alignment=Scope< ModulusRemainder >::empty_scope())
Perform a a wide range of simplifications to expressions and statements, including constant folding,...
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AbstractGenerator.h:19
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Expr.h
ModulusRemainder.h
Halide::Internal::simplify_exprs
Stmt simplify_exprs(const Stmt &)
Simplify expressions found in a statement, but don't simplify across different statements.
Halide::Internal::Scope::empty_scope
static const Scope< T > & empty_scope()
A const ref to an empty scope.
Definition: Scope.h:120
Interval.h