-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCSE.h
32 lines (24 loc) · 919 Bytes
/
CSE.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef HALIDE_INTERNAL_CSE_H
#define HALIDE_INTERNAL_CSE_H
/** \file
* Defines a pass for introducing let expressions to wrap common sub-expressions. */
#include "IR.h"
namespace Halide {
namespace Internal {
/** Replace each common sub-expression in the argument with a
* variable, and wrap the resulting expr in a let statement giving a
* value to that variable.
*
* This is important to do within Halide (instead of punting to llvm),
* because exprs that come in from the front-end are small when
* considered as a graph, but combinatorially large when considered as
* a tree. For an example of a such a case, see
* test/code_explosion.cpp */
EXPORT Expr common_subexpression_elimination(Expr);
/** Do common-subexpression-elimination on each expression in a
* statement. Does not introduce let statements. */
EXPORT Stmt common_subexpression_elimination(Stmt);
EXPORT void cse_test();
}
}
#endif