Class StmtExprMutatorWithConstraintContext#
Defined in File stmt_functor_with_constraint_context.h
Inheritance Relationships#
Base Type#
public tvm::tirx::ObjectMutatorWithConstraintContext(Class ObjectMutatorWithConstraintContext)
Class Documentation#
-
class StmtExprMutatorWithConstraintContext : public tvm::tirx::ObjectMutatorWithConstraintContext#
Native virtual mutation hooks over one structural constraint engine.
Override Mutate_ for known nodes or Mutate for general dispatch. Allocate with ffi::make_object; typed entry points preserve expression/statement categories. Defaults share matching native expression bodies and delegate scope-sensitive nodes to the same hooks as StructuralMapWithConstraintContext and StructuralMutateWithConstraintContext, with one context and one variable-remap environment. Unknown node types use structural fallback.
Forward the inherited mode to child mutations. Entry overrides must preserve inherited denial and check uniqueness before writing. The default entry does so before calling a node hook. Errors propagate without restoring constraints, in-place IR changes, or identity remaps; discard the context after failure.
struct Rewrite : StmtExprMutatorWithConstraintContext { using StmtExprMutatorWithConstraintContext::Mutate_; ffi::UnchangedOr<PrimExpr> Mutate_(const prim::AddObj* node, ffi::InplaceMode mode) override { // Inspect constraints here; delegate to retain default recursive behavior. return StmtExprMutatorWithConstraintContext::Mutate_(node, mode); } }; auto mutator = ffi::make_object<Rewrite>(); auto result = mutator->Mutate(stmt);
Public Functions
-
inline StmtExprMutatorWithConstraintContext()#
-
inline explicit StmtExprMutatorWithConstraintContext(const sym::ConstraintContext &context)#
Capture the supplied environment; the mutator owns its analyzer and local facts.
-
inline ffi::UnchangedOr<Expr> Mutate(const Expr &value, ffi::InplaceMode mode = ffi::InplaceMode::kDisallow)#
Typed entry preserving the expression or statement category.
-
inline ffi::UnchangedOr<PrimExpr> Mutate(const PrimExpr &value, ffi::InplaceMode mode = ffi::InplaceMode::kDisallow)#
Mutate a primitive expression, allowing a different primitive node kind.
-
inline ffi::UnchangedOr<Stmt> Mutate(const Stmt &value, ffi::InplaceMode mode = ffi::InplaceMode::kDisallow)#
Mutate a statement, allowing a different statement kind.
-
inline ffi::UnchangedOr<SeqStmt> Mutate(const SeqStmt &value, ffi::InplaceMode mode = ffi::InplaceMode::kDisallow)#
Keep a sequence entry point canonical when its callback returns one statement.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const LambdaExprObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize LambdaExprObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const OpaqueExprObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize OpaqueExprObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const TupleObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize TupleObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const TupleGetItemObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize TupleGetItemObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const TensorLoadObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize TensorLoadObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const TensorRegionObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize TensorRegionObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const VarObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize VarObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const GlobalVarObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize GlobalVarObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const CallObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize CallObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const GenericConstObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize GenericConstObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const DataTypeImmObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize DataTypeImmObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const IntImmObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize IntImmObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const FloatImmObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize FloatImmObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const OpObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize OpObj.
-
virtual ffi::UnchangedOr<Expr> Mutate_(const StringImmObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize StringImmObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::CastObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::CastObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::AddObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::AddObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::LShiftObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::LShiftObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::RShiftObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::RShiftObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::BitwiseAndObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::BitwiseAndObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::BitwiseOrObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::BitwiseOrObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::BitwiseXorObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::BitwiseXorObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::BitwiseNotObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::BitwiseNotObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::SubObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::SubObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::MulObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::MulObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::DivObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::DivObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::ModObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::ModObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::FloorDivObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::FloorDivObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::FloorModObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::FloorModObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::MinObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::MinObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::MaxObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::MaxObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::EQObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::EQObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::NEObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::NEObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::LTObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::LTObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::LEObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::LEObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::GTObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::GTObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::GEObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::GEObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::AndObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::AndObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::OrObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::OrObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::NotObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::NotObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::SelectObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::SelectObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::LetObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::LetObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::RampObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::RampObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::BroadcastObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::BroadcastObj.
-
virtual ffi::UnchangedOr<PrimExpr> Mutate_(const prim::ShuffleObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize prim::ShuffleObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const BindObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize BindObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const RegionStmtObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize RegionStmtObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const IfObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize IfObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const ForObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize ForObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const WhileObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize WhileObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const ReturnObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize ReturnObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const BreakObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize BreakObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const ContinueObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize ContinueObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const TensorStoreObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize TensorStoreObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const AssertStmtObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize AssertStmtObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const SeqStmtObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize SeqStmtObj.
-
virtual ffi::UnchangedOr<Stmt> Mutate_(const EvaluateObj *node, ffi::InplaceMode mode)#
Default constraint-aware descent; override to customize EvaluateObj.
-
virtual ffi::UnchangedOr<ffi::Any> Mutate(ffi::AnyView value, ffi::InplaceMode mode = ffi::InplaceMode::kDisallow)#
Dispatch a borrowed value after checking mutation permission and uniqueness.
Protected Functions
-
inline sym::AnalyzerObj *GetSyncedAnalyzer()#
Synchronize before every analysis, including after child traversal. The borrowed pointer is not a live view: reacquire it after changing context.
-
void AddParamConstraints(const Function &func)#
Add global nonnegative tensor-parameter shape premises before traversal.
-
ffi::Array<PrimExpr> IterMapSimplifyWithContext(const ffi::Array<PrimExpr> &indices, bool non_trivial_only)#
Simplify indices using the active collector’s iterator facts.
-
inline explicit StmtExprMutatorWithConstraintContext(const VTable *table)#
Construct with a finalized table extended by a native subclass.
Protected Static Functions
-
static void InitVTable(VTable *table)#
-
inline StmtExprMutatorWithConstraintContext()#