StmtMutator that mutates the statements.
More...
#include <stmt_functor.h>
|
bool | allow_copy_on_write_ {false} |
| Internal state to indicate whether copy on write is enabled. COW is enabled iff all the parents of the node are unique. More...
|
|
StmtMutator that mutates the statements.
◆ CopyOnWrite()
template<typename TNode >
ObjectPtr<TNode> tvm::tir::StmtMutator::CopyOnWrite |
( |
const TNode * |
node | ) |
|
|
inlineprotected |
Perform copy on write on node.
If CopyOnWrite is allowed, directly return a strong reference to the node container. Otherwise, return a copy of the node.
- Returns
- The result object pointer.
◆ operator()()
Stmt tvm::tir::StmtMutator::operator() |
( |
Stmt |
stmt | ) |
|
|
inline |
Mutate stmt.
- Parameters
-
stmt | The input statement to be mutated. |
- Returns
- The result of the call
- Note
- It is important that stmt is passed by value. so copy on write can be triggered correctly. do mutator(std::move(stmt)) or when copy elison is triggered.
◆ VisitExpr()
◆ VisitSeqStmt_()
Stmt tvm::tir::StmtMutator::VisitSeqStmt_ |
( |
const SeqStmtNode * |
op, |
|
|
bool |
flatten_before_visit, |
|
|
std::function< Stmt(const Stmt &)> |
fmutate = nullptr |
|
) |
| |
|
protected |
Alternative advance method for SeqStmtNode.
This function can be called when a child class override VisitStmt_(const SeqStmtNode*) to introduce the special behavior to visit
- Parameters
-
op | The sequence. |
flatten_before_visit | Whether to flatten the sequence before visit. |
fmutate | The mutate function, can be nullptr, which defaults to Visit. |
- Returns
- The mutated result.
◆ VisitStmt()
Stmt tvm::tir::StmtMutator::VisitStmt |
( |
const Stmt & |
stmt | ) |
|
|
inlineoverrideprotected |
Internal mutator that everyone calls.
- Note
- To override mutate's behavior, override VisitExpr instead.
- Parameters
-
- Returns
- The mutated results.
◆ VisitStmt_() [1/18]
◆ VisitStmt_() [2/18]
◆ VisitStmt_() [3/18]
◆ VisitStmt_() [4/18]
◆ VisitStmt_() [5/18]
◆ VisitStmt_() [6/18]
◆ VisitStmt_() [7/18]
◆ VisitStmt_() [8/18]
◆ VisitStmt_() [9/18]
◆ VisitStmt_() [10/18]
◆ VisitStmt_() [11/18]
Stmt tvm::tir::StmtMutator::VisitStmt_ |
( |
const ForNode * |
op | ) |
|
|
overrideprotected |
◆ VisitStmt_() [12/18]
◆ VisitStmt_() [13/18]
◆ VisitStmt_() [14/18]
◆ VisitStmt_() [15/18]
◆ VisitStmt_() [16/18]
◆ VisitStmt_() [17/18]
◆ VisitStmt_() [18/18]
◆ allow_copy_on_write_
bool tvm::tir::StmtMutator::allow_copy_on_write_ {false} |
|
protected |
Internal state to indicate whether copy on write is enabled. COW is enabled iff all the parents of the node are unique.
The documentation for this class was generated from the following file: