1 #ifndef HALIDE_IR_EQUALITY_H
2 #define HALIDE_IR_EQUALITY_H
36 uint64_t mix = (pa + pb) + (pa ^ pb);
38 mix ^= (mix >> (bits * 2));
39 uint32_t bottom = mix & ((1 << bits) - 1);
43 std::vector<Entry> entries;
54 const Entry &e = entries[h];
60 for (
size_t i = 0; i < entries.size(); i++) {
61 entries[i].a =
Expr();
62 entries[i].b =
Expr();
68 : bits(b), entries(static_cast<
size_t>(1) << bits) {
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Lossily track known equal exprs with a cache.
void insert(const Expr &a, const Expr &b)
bool contains(const Expr &a, const Expr &b) const
bool graph_equal(const Expr &a, const Expr &b)
bool equal(const RDom &bounds0, const RDom &bounds1)
Return true if bounds0 and bounds1 represent the same bounds.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
unsigned __INT64_TYPE__ uint64_t
unsigned __INT32_TYPE__ uint32_t
A fragment of Halide syntax.
HALIDE_ALWAYS_INLINE const Internal::BaseExprNode * get() const
Override get() to return a BaseExprNode * instead of an IRNode *.
A wrapper about Exprs so that they can be deeply compared with a cache for known-equal subexpressions...
ExprWithCompareCache(const Expr &e, IRCompareCache *c)
ExprWithCompareCache()=default
bool operator<(const ExprWithCompareCache &other) const
The comparison uses (and updates) the cache.
A compare struct suitable for use in std::map and std::set that computes a lexical ordering on IR nod...
bool operator()(const Expr &a, const Expr &b) const
bool operator()(const Stmt &a, const Stmt &b) const
HALIDE_ALWAYS_INLINE bool same_as(const IntrusivePtr &other) const
A reference-counted handle to a statement node.