Halide 16.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
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
13namespace Halide {
14namespace 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// @{
23Stmt simplify(const Stmt &, bool remove_dead_code = true,
26Expr simplify(const Expr &, bool remove_dead_code = true,
29// @}
30
31/** Attempt to statically prove an expression is true using the simplifier. */
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. */
38
39} // namespace Internal
40} // namespace Halide
41
42#endif
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines the Interval class.
Routines for statically determining what expressions are divisible by.
Defines the Scope class, which is used for keeping track of names in a scope while traversing IR.
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Le...
Definition Scope.h:94
Stmt simplify_exprs(const Stmt &)
Simplify expressions found in a statement, but don't simplify across different statements.
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,...
bool can_prove(Expr e, const Scope< Interval > &bounds=Scope< Interval >::empty_scope())
Attempt to statically prove an expression is true using the simplifier.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A fragment of Halide syntax.
Definition Expr.h:257
A reference-counted handle to a statement node.
Definition Expr.h:418