This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 467b330517 [REFACTOR][S-TIR] Cleanup items on block scope (#18754)
467b330517 is described below

commit 467b330517b0df1111eedbcbe46269810446f88a
Author: Tianqi Chen <[email protected]>
AuthorDate: Wed Feb 11 10:57:25 2026 -0500

    [REFACTOR][S-TIR] Cleanup items on block scope (#18754)
    
    This PR finishes cleans up items for sblock scope migration into s_tir
    namespace.
---
 python/tvm/s_tir/block_dependence_info.py          | 88 ----------------------
 .../ir/block_scope.cc => s_tir/sblock_scope.cc}    |  0
 2 files changed, 88 deletions(-)

diff --git a/python/tvm/s_tir/block_dependence_info.py 
b/python/tvm/s_tir/block_dependence_info.py
deleted file mode 100644
index a95f018d30..0000000000
--- a/python/tvm/s_tir/block_dependence_info.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-"""Define SBlockDependenceInfoNode that uses the SBlockScope and StmtSRef 
objects
-to store the block level dependences"""
-
-from typing import Union, Optional
-from tvm_ffi import register_object
-from tvm.ir.module import IRModule
-from tvm.runtime import Object
-from tvm.tir import SBlock, PrimFunc
-
-from .sblock_scope import SBlockScope, StmtSRef
-from . import _ffi_api
-
-
-@register_object("s_tir.SBlockDependenceInfo")
-class SBlockDependenceInfo(Object):
-    """
-    SBlockDependenceInfo
-    An object that helps build and query block level dependences using the 2 
core objects
-    SBlockScope and StmtSRef
-
-    The data structures exposed are:
-    1) sref2scope: Mapping from the srefs to its corresponding SBlockScope
-    2) stmt2ref: Mapping from blocks to corresponding StmtSRefs
-
-    Note that this object does not store SRefs to loops as the purpose is only 
to expose block level
-    dependences. This provides the advantage that the scope block (parent 
block) for a given block
-    sref can be directly accessed as sref->parent
-    """
-
-    mod: IRModule
-
-    def __init__(self, mod: Union[IRModule, PrimFunc]):
-        if isinstance(mod, PrimFunc):
-            mod = IRModule({"main": mod})
-        if not isinstance(mod, IRModule):
-            raise TypeError(f"Expected `mod` to be PrimFunc or IRModule, but 
gets: {mod}")
-        self.__init_handle_by_constructor__(
-            _ffi_api.SBlockDependenceInfo,  # type: ignore # pylint: 
disable=no-member
-            mod,
-        )
-
-    def get_sref(self, block: SBlock) -> Optional[StmtSRef]:
-        """Return the corresponding sref that points to the block
-
-        Parameters
-        ----------
-        stmt : Block
-            The block for which the sref is to be retrived
-
-        Returns
-        -------
-        sref : StmtSRef
-            The corresponding sref
-        """
-        return _ffi_api.SBlockDependenceInfoGetSRef(self, block)  # type: 
ignore # pylint: disable=no-member
-
-    def get_sblock_scope(self, block_sref: StmtSRef) -> SBlockScope:
-        """Get the SBlockScope correpsonding to the block sref
-
-        Parameters
-        ----------
-        block_sref : StmtSRef
-            The block sref to be retrieved
-
-        Returns
-        -------
-        scope : StmtSRef
-            The corresponding SBlockScope
-        """
-        return _ffi_api.SBlockDependenceInfoGetSBlockScope(  # type: ignore # 
pylint: disable=no-member
-            self, block_sref
-        )
diff --git a/src/tir/ir/block_scope.cc b/src/s_tir/sblock_scope.cc
similarity index 100%
rename from src/tir/ir/block_scope.cc
rename to src/s_tir/sblock_scope.cc

Reply via email to