tvm
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Protected Member Functions | List of all members
tvm::s_tir::StmtExprMutatorWithAnalyzer Class Reference

#include <stmt_functor_with_analyzer.h>

Inheritance diagram for tvm::s_tir::StmtExprMutatorWithAnalyzer:
Collaboration diagram for tvm::s_tir::StmtExprMutatorWithAnalyzer:

Public Types

using Parent = tirx::StmtExprMutatorWithAnalyzer
 

Public Member Functions

 StmtExprMutatorWithAnalyzer (const sym::Analyzer &analyzer)
 
 StmtExprMutatorWithAnalyzer (sym::AnalyzerObj *analyzer)
 
virtual UnchangedOr< Stmt > Mutate_ (const SBlockNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const SBlockRealizeNode *op, InplaceMode inplace_mode)
 
UnchangedOr< Stmt > Mutate_ (const ForNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Stmt > Mutate_ (const BindNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Stmt > Mutate_ (const IfNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Stmt > Mutate_ (const RegionStmtNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Stmt > Mutate_ (const AssertStmtNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Expr > Mutate_ (const CallNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< PrimExpr > Mutate_ (const prim::LetNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< PrimExpr > Mutate_ (const prim::SelectNode *op, InplaceMode inplace_mode) override
 
- Public Member Functions inherited from tvm::tirx::StmtExprMutatorWithAnalyzer
 StmtExprMutatorWithAnalyzer (const sym::Analyzer &analyzer)
 
 StmtExprMutatorWithAnalyzer (sym::AnalyzerObj *analyzer)
 
UnchangedOr< Stmt > Mutate_ (const ForNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Stmt > Mutate_ (const BindNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Stmt > Mutate_ (const IfNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Stmt > Mutate_ (const RegionStmtNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Stmt > Mutate_ (const AssertStmtNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< Expr > Mutate_ (const CallNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< PrimExpr > Mutate_ (const prim::LetNode *op, InplaceMode inplace_mode) override
 
UnchangedOr< PrimExpr > Mutate_ (const prim::SelectNode *op, InplaceMode inplace_mode) override
 
TVM_FFI_INLINE UnchangedOr< Stmt > Mutate (const Stmt &stmt, InplaceMode inplace_mode=InplaceMode::kDisallow)
 Mutate a borrowed statement through the virtual generic entry.
 
TVM_FFI_INLINE UnchangedOr< SeqStmt > Mutate (const SeqStmt &stmt, InplaceMode inplace_mode=InplaceMode::kDisallow)
 Mutate a scope body without collapsing its sequence container.
 
TVM_FFI_INLINE UnchangedOr< ffi::Optional< SeqStmt > > Mutate (const ffi::Optional< SeqStmt > &stmt, InplaceMode inplace_mode=InplaceMode::kDisallow)
 
TVM_FFI_INLINE UnchangedOr< ffi::Optional< Stmt > > Mutate (const ffi::Optional< Stmt > &stmt, InplaceMode inplace_mode=InplaceMode::kDisallow)
 Mutate an optional statement, preserving an absent function body.
 
virtual UnchangedOr< Stmt > Mutate_ (const BindNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const RegionStmtNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const IfNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const ForNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const WhileNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const ReturnNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const BreakNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const ContinueNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const TensorStoreNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const AssertStmtNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const SeqStmtNode *op, InplaceMode inplace_mode)
 
virtual UnchangedOr< Stmt > Mutate_ (const EvaluateNode *op, InplaceMode inplace_mode)
 
- Public Member Functions inherited from tvm::tirx::StmtExprMutator
TVM_FFI_INLINE UnchangedOr< Stmt > Mutate (const Stmt &stmt, InplaceMode inplace_mode=InplaceMode::kDisallow)
 Mutate a borrowed statement through the virtual generic entry.
 
TVM_FFI_INLINE UnchangedOr< SeqStmt > Mutate (const SeqStmt &stmt, InplaceMode inplace_mode=InplaceMode::kDisallow)
 Mutate a scope body without collapsing its sequence container.
 
TVM_FFI_INLINE UnchangedOr< ffi::Optional< SeqStmt > > Mutate (const ffi::Optional< SeqStmt > &stmt, InplaceMode inplace_mode=InplaceMode::kDisallow)
 
TVM_FFI_INLINE UnchangedOr< ffi::Optional< Stmt > > Mutate (const ffi::Optional< Stmt > &stmt, InplaceMode inplace_mode=InplaceMode::kDisallow)
 Mutate an optional statement, preserving an absent function body.
 
- Public Member Functions inherited from tvm::ExprMutator
TVM_FFI_INLINE UnchangedOr< PrimExpr > Mutate (const PrimExpr &expr, InplaceMode inplace_mode=InplaceMode::kDisallow)
 Mutate a primitive expression, preserving its expression category.
 
TVM_FFI_INLINE UnchangedOr< Expr > Mutate (const Expr &expr, InplaceMode inplace_mode=InplaceMode::kDisallow)
 Mutate an expression, preserving its expression category.
 
virtual UnchangedOr< Expr > Mutate_ (const OpaqueExprNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< Expr > Mutate_ (const TupleNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< Expr > Mutate_ (const TupleGetItemNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const TensorLoadNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< Expr > Mutate_ (const TensorRegionNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< Expr > Mutate_ (const VarNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< Expr > Mutate_ (const GlobalVarNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< Expr > Mutate_ (const GenericConstNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< Expr > Mutate_ (const DataTypeImmNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const IntImmNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const FloatImmNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< Expr > Mutate_ (const OpNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< Expr > Mutate_ (const StringImmNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::CastNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::AddNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::LShiftNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::RShiftNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::BitwiseAndNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::BitwiseOrNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::BitwiseXorNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::BitwiseNotNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::SubNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::MulNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::DivNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::ModNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::FloorDivNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::FloorModNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::MinNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::MaxNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::EQNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::NENode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::LTNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::LENode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::GTNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::GENode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::AndNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::OrNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::NotNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::RampNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::BroadcastNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< PrimExpr > Mutate_ (const prim::ShuffleNode *node, InplaceMode inplace_mode)
 
virtual UnchangedOr< ffi::Any > Mutate (ffi::AnyView value, InplaceMode inplace_mode=InplaceMode::kDisallow)
 Construct a mutator with the core expression hooks.
 
- Public Member Functions inherited from tvm::ObjectMutator
 ObjectMutator ()
 Construct a mutator using structural fallback for every object.
 
 ObjectMutator (const ObjectMutator &other)=delete
 
ObjectMutator & operator= (const ObjectMutator &other)=delete
 
Expected< UnchangedOr< ffi::Any > > MutateExpected (ffi::AnyView value, InplaceMode inplace_mode=InplaceMode::kDisallow) noexcept
 Adapt the virtual throwing entrypoint to the structural ABI.
 
ffi::Any VarRemapGet (ffi::AnyView var)
 Look up a variable replacement, throwing on failure.
 
void VarRemapSet (ffi::AnyView var, ffi::AnyView value)
 Record a variable replacement, throwing on failure.
 
TVM_FFI_INLINE Expected< ffi::Any > VarRemapGetExpected (ffi::AnyView var) noexcept
 Look up a replacement in the variable-remap environment.
 
TVM_FFI_INLINE Expected< void > VarRemapSetExpected (ffi::AnyView var, ffi::AnyView mapped_value) noexcept
 Record a replacement in the variable-remap environment.
 

Static Protected Member Functions

static void InitVTable (VTable *vtable)
 
static const VTable * GlobalVTable ()
 
- Static Protected Member Functions inherited from tvm::tirx::StmtExprMutatorWithAnalyzer
static void InitVTable (VTable *vtable)
 
static const VTable * GlobalVTable ()
 
- Static Protected Member Functions inherited from tvm::tirx::StmtExprMutator
static void InitVTable (VTable *vtable)
 
- Static Protected Member Functions inherited from tvm::ExprMutator
static UnchangedOr< Expr > ReinferMutatedCallType (UnchangedOr< Expr > mutated, const CallNode *original, InplaceMode inplace_mode)
 Reinfer the result type of a Call after ordinary mutation.
 
static void InitVTable (VTable *vtable)
 Register core expression hooks in a fresh mutable table.
 
- Static Protected Member Functions inherited from tvm::ObjectMutator
static void InitVTable (VTable *vtable)
 Initialize the base registrations in a fresh mutable table.
 
template<typename Self , typename Node >
static void SetDispatch (VTable *vtable)
 Register an exact node type in a fresh table initialized by its parent. Derived node types require separate registrations.
 

Additional Inherited Members

- Protected Types inherited from tvm::ObjectMutator
using VTable = ObjectFunctor< UnchangedOr< ffi::Any >(const ffi::Object *, ObjectMutator *, InplaceMode)>
 Exact native dispatch table with owning replacement results.
 
- Protected Member Functions inherited from tvm::tirx::StmtExprMutatorWithAnalyzer
 StmtExprMutatorWithAnalyzer (sym::AnalyzerObj *analyzer, const VTable *vtable)
 
void MarkTensorParamShapes (const Function &func)
 Mark all tensor-parameter shape values as positive values.
 
ffi::Array< PrimExpr > IterMapSimplifyWithContext (const ffi::Array< PrimExpr > &indices, bool non_trivial_only)
 Use internal bound information to perform inter map simplification of indices.
 
template<typename FLambda >
void WithRecordIterPredicate (PrimExpr condition, FLambda callback)
 Run callback while trying to record iter predicate.
 
- Protected Member Functions inherited from tvm::tirx::StmtExprMutator
 StmtExprMutator (const VTable *vtable)
 
- Protected Member Functions inherited from tvm::ExprMutator
 ExprMutator (const VTable *vtable)
 Construct a mutator with an extended native dispatch table.
 
- Protected Member Functions inherited from tvm::ObjectMutator
 ObjectMutator (const VTable *vtable)
 Construct a mutator with a finalized native dispatch table.
 
- Protected Attributes inherited from tvm::tirx::StmtExprMutatorWithAnalyzer
sym::AnalyzerObj * analyzer_
 internal analyzer field.
 
ScopeStack< WithGroup< sym::ConstraintContext > > constraint_scope_
 Scope stack for accumulated assert constraints.
 
ffi::Map< PrimVar, Range > iter_vars_
 Recorded loop iterators.
 
ffi::Array< PrimExpr > iter_predicates_
 iterator predicates
 

Member Typedef Documentation

◆ Parent

Constructor & Destructor Documentation

◆ StmtExprMutatorWithAnalyzer() [1/2]

tvm::s_tir::StmtExprMutatorWithAnalyzer::StmtExprMutatorWithAnalyzer ( const sym::Analyzer &  analyzer)
inlineexplicit

◆ StmtExprMutatorWithAnalyzer() [2/2]

tvm::s_tir::StmtExprMutatorWithAnalyzer::StmtExprMutatorWithAnalyzer ( sym::AnalyzerObj *  analyzer)
inlineexplicit

Member Function Documentation

◆ GlobalVTable()

static const VTable * tvm::s_tir::StmtExprMutatorWithAnalyzer::GlobalVTable ( )
inlinestaticprotected

◆ InitVTable()

static void tvm::s_tir::StmtExprMutatorWithAnalyzer::InitVTable ( VTable *  vtable)
inlinestaticprotected

◆ Mutate_() [1/10]

UnchangedOr< Stmt > tvm::tirx::StmtExprMutatorWithAnalyzer::Mutate_ ( const AssertStmtNode *  op,
InplaceMode  inplace_mode 
)
overridevirtual

Reimplemented from tvm::tirx::StmtExprMutator.

◆ Mutate_() [2/10]

UnchangedOr< Stmt > tvm::tirx::StmtExprMutatorWithAnalyzer::Mutate_ ( const BindNode *  op,
InplaceMode  inplace_mode 
)
overridevirtual

Reimplemented from tvm::tirx::StmtExprMutator.

◆ Mutate_() [3/10]

UnchangedOr< Expr > tvm::tirx::StmtExprMutatorWithAnalyzer::Mutate_ ( const CallNode *  op,
InplaceMode  inplace_mode 
)
overridevirtual

Reimplemented from tvm::ExprMutator.

◆ Mutate_() [4/10]

UnchangedOr< Stmt > tvm::tirx::StmtExprMutatorWithAnalyzer::Mutate_ ( const ForNode *  op,
InplaceMode  inplace_mode 
)
overridevirtual

Reimplemented from tvm::tirx::StmtExprMutator.

◆ Mutate_() [5/10]

UnchangedOr< Stmt > tvm::tirx::StmtExprMutatorWithAnalyzer::Mutate_ ( const IfNode *  op,
InplaceMode  inplace_mode 
)
overridevirtual

Reimplemented from tvm::tirx::StmtExprMutator.

◆ Mutate_() [6/10]

UnchangedOr< PrimExpr > tvm::tirx::StmtExprMutatorWithAnalyzer::Mutate_ ( const prim::LetNode *  op,
InplaceMode  inplace_mode 
)
overridevirtual

Reimplemented from tvm::ExprMutator.

◆ Mutate_() [7/10]

UnchangedOr< PrimExpr > tvm::tirx::StmtExprMutatorWithAnalyzer::Mutate_ ( const prim::SelectNode *  op,
InplaceMode  inplace_mode 
)
overridevirtual

Reimplemented from tvm::ExprMutator.

◆ Mutate_() [8/10]

UnchangedOr< Stmt > tvm::tirx::StmtExprMutatorWithAnalyzer::Mutate_ ( const RegionStmtNode *  op,
InplaceMode  inplace_mode 
)
overridevirtual

Reimplemented from tvm::tirx::StmtExprMutator.

◆ Mutate_() [9/10]

virtual UnchangedOr< Stmt > tvm::s_tir::StmtExprMutatorWithAnalyzer::Mutate_ ( const SBlockNode *  op,
InplaceMode  inplace_mode 
)
virtual

◆ Mutate_() [10/10]

virtual UnchangedOr< Stmt > tvm::s_tir::StmtExprMutatorWithAnalyzer::Mutate_ ( const SBlockRealizeNode *  op,
InplaceMode  inplace_mode 
)
inlinevirtual

The documentation for this class was generated from the following file: