31 #ifndef TVM_S_TIR_SBLOCK_DEPENDENCE_INFO_H_
32 #define TVM_S_TIR_SBLOCK_DEPENDENCE_INFO_H_
34 #include <tvm/ffi/reflection/registry.h>
37 #include <unordered_map>
60 std::unordered_map<StmtSRef, SBlockScope, ffi::ObjectPtrHash, ffi::ObjectPtrEqual>
sref2scope;
62 std::unordered_map<const StmtNode*, StmtSRef>
stmt2ref;
65 namespace refl = tvm::ffi::reflection;
66 refl::ObjectDef<SBlockDependenceInfoNode>();
78 TVM_FFI_CHECK(it !=
sref2scope.end(), IndexError)
79 <<
"Cannot find the corresponding SBlockScope to the block sref:\n"
80 << ffi::GetRef<Stmt>(scope_root->stmt);
Managed reference class to IRModuleNode.
Definition: module.h:258
An object that helps build and query block level dependences using the 2 core objects SBlockScope and...
Definition: sblock_dependence_info.h:54
std::unordered_map< const StmtNode *, StmtSRef > stmt2ref
The reverse mapping from block/for-loop to their corresponding srefs.
Definition: sblock_dependence_info.h:62
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("s_tir.SBlockDependenceInfo", SBlockDependenceInfoNode, ffi::Object)
std::unordered_map< StmtSRef, SBlockScope, ffi::ObjectPtrHash, ffi::ObjectPtrEqual > sref2scope
Mapping from a block sref to its corresponding SBlockScope, tracking the dependency inside the block ...
Definition: sblock_dependence_info.h:60
static void RegisterReflection()
Definition: sblock_dependence_info.h:64
SBlockScope GetSBlockScope(const StmtSRef &scope_root) const
Get the SBlockScope corresponding to the sref of scope root block.
Definition: sblock_dependence_info.h:76
Managed reference to SBlockDependenceInfoNode.
Definition: sblock_dependence_info.h:89
SBlockDependenceInfo(IRModule mod)
Construct a SBlockDependenceInfo from IRModule.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(SBlockDependenceInfo, ffi::ObjectRef, SBlockDependenceInfoNode)
Managed reference to SBlockScopeNode.
Definition: sblock_scope.h:296
Managed reference to StmtSRefNode.
Definition: sblock_scope.h:107
tvm::PrimExpr mod(const tvm::PrimExpr &a, const tvm::PrimExpr &b)
Definition: broadcast.h:308
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
Definition of two pillar data structure for TensorIR scheduling: StmtSRef, SBlockScope.