23#ifndef TVM_S_TIR_STMT_FUNCTOR_H_
24#define TVM_S_TIR_STMT_FUNCTOR_H_
37template <
typename FType>
40template <
typename R,
typename... Args>
46 using Parent::Dispatch_;
49 return this->DispatchDefault_(op, std::forward<Args>(args)...);
52 return this->DispatchDefault_(op, std::forward<Args>(args)...);
59 Parent::InitVTable(vtable);
60 Parent::template SetDispatch<StmtFunctor, SBlockObj>(vtable);
61 Parent::template SetDispatch<StmtFunctor, SBlockRealizeObj>(vtable);
80 using tirx::StmtExprVisitor::Visit;
81 using tirx::StmtExprVisitor::Visit_;
87 static ffi::Optional<VisitInterrupt>
VisitBlock(ffi::StructuralVisitorObj* visitor,
110 using tirx::StmtExprMutator::Mutate;
111 using tirx::StmtExprMutator::Mutate_;
118 InplaceMode inplace_mode);
Functors for tirx stmts utility functions to call common functors.
A dynamically dispatched functor on the type of the first argument.
Definition object_functor.h:85
Container of all statements.
Definition stmt.h:61
A block is a basic schedule unit in TIR.
Definition stmt.h:112
A block realization node represents execution of the block at the binding values.
Definition stmt.h:188
Extend native TIRX mutation while preserving block iterator binders.
Definition stmt_functor.h:107
static void InitVTable(VTable *vtable)
static UnchangedOr< Stmt > MutateBlock(ffi::StructuralMutatorObj *mutator, const SBlockObj *op, InplaceMode inplace_mode)
StmtExprMutator(const VTable *vtable)
Definition stmt_functor.h:123
static UnchangedOr< Stmt > MutateBlockRealize(ffi::StructuralMutatorObj *mutator, const SBlockRealizeObj *op, InplaceMode inplace_mode)
virtual UnchangedOr< Stmt > Mutate_(const SBlockRealizeObj *op, InplaceMode inplace_mode)
virtual UnchangedOr< Stmt > Mutate_(const SBlockObj *op, InplaceMode inplace_mode)
Extend native TIRX traversal with schedulable block semantics.
Definition stmt_functor.h:77
virtual ffi::Optional< VisitInterrupt > Visit_(const SBlockObj *op)
static ffi::Optional< VisitInterrupt > VisitBlockRealize(ffi::StructuralVisitorObj *visitor, const SBlockRealizeObj *op)
StmtExprVisitor(const VTable *vtable)
Definition stmt_functor.h:93
virtual ffi::Optional< VisitInterrupt > Visit_(const SBlockRealizeObj *op)
static ffi::Optional< VisitInterrupt > VisitBlock(ffi::StructuralVisitorObj *visitor, const SBlockObj *op)
static void InitVTable(VTable *vtable)
typename Parent::VTable VTable
Definition stmt_functor.h:56
virtual R Dispatch_(const SBlockObj *op, Args... args)
Definition stmt_functor.h:48
virtual R Dispatch_(const SBlockRealizeObj *op, Args... args)
Definition stmt_functor.h:51
StmtFunctor(const VTable *vtable)
Definition stmt_functor.h:57
static void InitVTable(VTable *vtable)
Definition stmt_functor.h:58
Extend TIRX statement dispatch with schedulable blocks.
Definition stmt_functor.h:38
Mutator that recursively mutates stmts and exprs on them.
Definition stmt_functor.h:226
Native visitor for TIRx statements and their expression operands.
Definition stmt_functor.h:181
Definition stmt_functor.h:54
Type-dispatched statement functor with a caller-selected signature.
Definition stmt_functor.h:51
Parent compiler symbol visibility.
S-TIR (Schedulable TIR) statements and attributes.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analysis.h:41
#define TVM_DEFINE_OBJECT_FUNCTOR_DEFAULT_CONSTRUCTOR(Class, Parent)
Define a default constructor backed by one initialized native dispatch table.
Definition object_functor.h:529