Halide
|
A wrapper about Exprs so that they can be deeply compared with a cache for known-equal subexpressions. More...
#include <IREquality.h>
Public Member Functions | |
ExprWithCompareCache ()=default | |
ExprWithCompareCache (const Expr &e, IRCompareCache *c) | |
bool | operator< (const ExprWithCompareCache &other) const |
The comparison uses (and updates) the cache. More... | |
Public Attributes | |
Expr | expr |
IRCompareCache * | cache = nullptr |
A wrapper about Exprs so that they can be deeply compared with a cache for known-equal subexpressions.
Useful for unsanitized Exprs coming in from the front-end, which may be horrible graphs with sub-expressions that are equal by value but not by identity. This isn't a comparison object like IRDeepCompare above, because libc++ requires that comparison objects be stateless (and constructs a new one for each comparison!), so they can't have a cache associated with them. However, by sneakily making the cache a mutable member of the objects being compared, we can dodge this issue.
Clunky example usage:
Definition at line 95 of file IREquality.h.
|
default |
|
inline |
Definition at line 100 of file IREquality.h.
bool Halide::Internal::ExprWithCompareCache::operator< | ( | const ExprWithCompareCache & | other | ) | const |
The comparison uses (and updates) the cache.
Expr Halide::Internal::ExprWithCompareCache::expr |
Definition at line 96 of file IREquality.h.
|
mutable |
Definition at line 97 of file IREquality.h.