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

tqchen pushed a commit to branch script/canonical-parser-df
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 8b282f4fed6af94b0405fbf469421666aa82b167
Author: Tianqi Chen <[email protected]>
AuthorDate: Wed Sep 23 13:18:11 2026 +0000

    [REFACTOR][TIRx] Check constexpr marker identity directly
    
    Use the existing resolved annotation identity at the sole call site and 
remove the redundant parser predicate.
---
 python/tvm/script/parser/protocol.py | 5 -----
 python/tvm/tirx/script/jit.py        | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/python/tvm/script/parser/protocol.py 
b/python/tvm/script/parser/protocol.py
index 5c2a281e37..1ced956274 100644
--- a/python/tvm/script/parser/protocol.py
+++ b/python/tvm/script/parser/protocol.py
@@ -40,11 +40,6 @@ def constexpr(value: object) -> NoReturn:
     raise TypeError("constexpr is a parser syntax marker, not a runtime 
operation")
 
 
-def is_constexpr_marker(value: object) -> bool:
-    """Recognize the shared marker by identity without inspecting host 
values."""
-    return value is constexpr
-
-
 class ExprStrPolicy(NamedTuple):
     """Immutable syntax policy for registered constructor arguments.
 
diff --git a/python/tvm/tirx/script/jit.py b/python/tvm/tirx/script/jit.py
index 04f826c9f9..5cfc854fba 100644
--- a/python/tvm/tirx/script/jit.py
+++ b/python/tvm/tirx/script/jit.py
@@ -170,7 +170,7 @@ class TIRJit:
                     ann = resolve_marker(node)
                 except SyntaxError:
                     ann = None
-            if protocol.is_constexpr_marker(ann):
+            if ann is protocol.constexpr:
                 constexpr_names.add(name)
                 if param.default is not inspect.Parameter.empty:
                     constexpr_defaults[name] = param.default

Reply via email to