tvm
Classes | Namespaces | Macros | Functions
stmt_functor.h File Reference

Functors for tir stmts utility functions to call common functors. More...

#include <tvm/node/functor.h>
#include <tvm/tir/expr.h>
#include <tvm/tir/expr_functor.h>
#include <tvm/tir/stmt.h>
#include <unordered_map>
#include <utility>
Include dependency graph for stmt_functor.h:

Go to the source code of this file.

Classes

class  tvm::tir::StmtFunctor< FType >
 Same as ExprFunctor except it is applied on statements. More...
 
class  tvm::tir::StmtFunctor< R(const Stmt &n, Args... args)>
 
class  tvm::tir::StmtVisitor
 StmtVisitor. More...
 
class  tvm::tir::StmtMutator
 StmtMutator that mutates the statements. More...
 
class  tvm::tir::StmtExprVisitor
 Visitor that recursively visit stmts and exprs on them. More...
 
class  tvm::tir::StmtExprMutator
 Mutator that recursively mutates stmts and exprs on them. More...
 

Namespaces

 tvm
 Performance counters for profiling via the PAPI library.
 
 tvm::tir
 

Macros

#define STMT_FUNCTOR_DEFAULT   { return VisitStmtDefault_(op, std::forward<Args>(args)...); }
 
#define IR_STMT_FUNCTOR_DISPATCH(OP)
 

Functions

Stmt tvm::tir::IRTransform (Stmt stmt, const runtime::PackedFunc &preorder, const runtime::PackedFunc &postorder, Optional< Array< String >> only_enable=NullOpt)
 recursively visit the ir nodes in post DFS order, and transform it More...
 
void tvm::tir::PostOrderVisit (const ObjectRef &node, std::function< void(const ObjectRef &)> fvisit)
 Recursively visit the ir in post DFS order node, apply fvisit Each node is guaranteed to be visited only once. More...
 
Stmt tvm::tir::Substitute (Stmt stmt, std::function< Optional< PrimExpr >(const Var &var)> vmap)
 Substitute the var specified by vmap. More...
 
PrimExpr tvm::tir::Substitute (PrimExpr expr, std::function< Optional< PrimExpr >(const Var &var)> vmap)
 Substitute the var specified by vmap. More...
 
Array< Range > tvm::tir::Substitute (const Array< Range > &region, const Map< Var, PrimExpr > &vmap)
 Substitute the var specified by vmap. More...
 
template<typename T >
auto tvm::tir::Substitute (T input, const Map< Var, PrimExpr > &value_map)
 Sugar for substitute via a given map. More...
 
template<typename T >
tvm::tir::Substitute (T input, const std::unordered_map< const VarNode *, PrimExpr > &value_map)
 Sugar for substitute via a given map. More...
 
void tvm::tir::PreOrderVisit (const ObjectRef &stmt_or_expr, const std::function< bool(const ObjectRef &)> &fvisit)
 Recursively visit the IR in pre DFS order node, apply fvisit. If fvisit returns false, it won't visit the children of the node. More...
 

Detailed Description

Functors for tir stmts utility functions to call common functors.

Macro Definition Documentation

◆ IR_STMT_FUNCTOR_DISPATCH

#define IR_STMT_FUNCTOR_DISPATCH (   OP)
Value:
vtable.template set_dispatch<OP>([](const ObjectRef& n, TSelf* self, Args... args) { \
return self->VisitStmt_(static_cast<const OP*>(n.get()), std::forward<Args>(args)...); \
});

◆ STMT_FUNCTOR_DEFAULT

#define STMT_FUNCTOR_DEFAULT   { return VisitStmtDefault_(op, std::forward<Args>(args)...); }