36 bool const_bound =
false);
61 explicit Box(
size_t sz)
64 explicit Box(
const std::vector<Interval> &b)
174 const std::map<std::string, Function> &env);
Defines the Interval class.
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...
FuncValueBounds compute_function_value_bounds(const std::vector< std::string > &order, const std::map< std::string, Function > &env)
Compute the maximum and minimum possible value for each function in an environment.
Expr find_constant_bound(const Expr &e, Direction d, const Scope< Interval > &scope=Scope< Interval >::empty_scope())
Box box_required(const Expr &e, const std::string &fn, const Scope< Interval > &scope=Scope< Interval >::empty_scope(), const FuncValueBounds &func_bounds=empty_func_value_bounds())
Variants of the above that are only concerned with a single function.
const FuncValueBounds & empty_func_value_bounds()
std::map< std::string, Box > boxes_touched(const Expr &e, const Scope< Interval > &scope=Scope< Interval >::empty_scope(), const FuncValueBounds &func_bounds=empty_func_value_bounds())
Compute rectangular domains large enough to cover all the 'Call's and 'Provides's to each function th...
Direction
Given a varying expression, try to find a constant that is either: An upper bound (always greater tha...
std::map< std::string, Box > boxes_provided(const Expr &e, const Scope< Interval > &scope=Scope< Interval >::empty_scope(), const FuncValueBounds &func_bounds=empty_func_value_bounds())
Compute rectangular domains large enough to cover all the 'Provides's to each function that occurs wi...
Box box_intersection(const Box &a, const Box &b)
The intersection of two boxes.
bool box_contains(const Box &a, const Box &b)
Test if box a provably contains box b.
Interval bounds_of_expr_in_scope(const Expr &expr, const Scope< Interval > &scope, const FuncValueBounds &func_bounds=empty_func_value_bounds(), bool const_bound=false)
Given an expression in some variables, and a map from those variables to their bounds (in the form of...
Expr span_of_bounds(const Interval &bounds)
Interval find_constant_bounds(const Expr &e, const Scope< Interval > &scope)
Find bounds for a varying expression that are either constants or +/-inf.
Box box_touched(const Expr &e, const std::string &fn, const Scope< Interval > &scope=Scope< Interval >::empty_scope(), const FuncValueBounds &func_bounds=empty_func_value_bounds())
std::map< std::pair< std::string, int >, Interval > FuncValueBounds
void merge_boxes(Box &a, const Box &b)
Expand box a to encompass box b.
bool boxes_overlap(const Box &a, const Box &b)
Test if box a could possibly overlap box b.
std::map< std::string, Box > boxes_required(const Expr &e, const Scope< Interval > &scope=Scope< Interval >::empty_scope(), const FuncValueBounds &func_bounds=empty_func_value_bounds())
Compute rectangular domains large enough to cover all the 'Call's to each function that occurs within...
Box box_provided(const Expr &e, const std::string &fn, const Scope< Interval > &scope=Scope< Interval >::empty_scope(), const FuncValueBounds &func_bounds=empty_func_value_bounds())
Box box_union(const Box &a, const Box &b)
The union of two boxes.
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.
Represents the bounds of a region of arbitrary dimension.
bool maybe_unused() const
Check if the used condition is defined and not trivially true.
const Interval & operator[](size_t i) const
Expr used
The conditions under which this region may be touched.
void push_back(const Interval &i)
friend std::ostream & operator<<(std::ostream &stream, const Box &b)
Box(const std::vector< Interval > &b)
std::vector< Interval > bounds
The bounds if it is touched.
Interval & operator[](size_t i)
A class to represent ranges of Exprs.
A reference-counted handle to a statement node.