tvm
|
A wrapper around ExprFunctor which functionally updates the AST. More...
#include <expr_functor.h>
Public Member Functions | |
Expr | Mutate (const Expr &expr) |
Mutate is alias for VisitExpr. More... | |
Expr | VisitExpr (const Expr &expr) override |
Expr | VisitExpr_ (const VarNode *op) override |
Expr | VisitExpr_ (const ConstantNode *op) override |
Expr | VisitExpr_ (const GlobalVarNode *op) override |
Expr | VisitExpr_ (const OpNode *op) override |
Expr | VisitExpr_ (const TupleNode *op) override |
Expr | VisitExpr_ (const FunctionNode *op) override |
Expr | VisitExpr_ (const CallNode *call_node) override |
Expr | VisitExpr_ (const LetNode *op) override |
Expr | VisitExpr_ (const IfNode *op) override |
Expr | VisitExpr_ (const TupleGetItemNode *op) override |
Expr | VisitExpr_ (const RefCreateNode *op) override |
Expr | VisitExpr_ (const RefReadNode *op) override |
Expr | VisitExpr_ (const RefWriteNode *op) override |
Expr | VisitExpr_ (const ConstructorNode *op) override |
Expr | VisitExpr_ (const MatchNode *op) override |
virtual Type | VisitType (const Type &t) |
Used to visit the types inside of expressions. More... | |
virtual Clause | VisitClause (const Clause &c) |
virtual Pattern | VisitPattern (const Pattern &c) |
Protected Attributes | |
std::unordered_map< Expr, Expr, ObjectPtrHash, ObjectPtrEqual > | memo_ |
Internal map used for memoization. More... | |
A wrapper around ExprFunctor which functionally updates the AST.
ExprMutator treats Expr as dataflow graph, and only Mutate each Expr once. The mutated results are memoized in a map and reused so that local transformation on the dataflow preserves the graph structure.
Mutate is alias for VisitExpr.
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
Used to visit the types inside of expressions.
Can be overloaded to transform the types in arbitrary ways, one way would be to define a sub-class of type visitor for types which transform them appropriately.
|
protected |
Internal map used for memoization.