This is an automated email from the ASF dual-hosted git repository.
spectrometerHBH 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 ca2d1e8732 [REFACTOR][IR] Migrate include/tvm/node into include/tvm/ir
(#19463)
ca2d1e8732 is described below
commit ca2d1e8732555d148579fd52c55665c451228ff5
Author: Tianqi Chen <[email protected]>
AuthorDate: Tue Apr 28 14:33:15 2026 -0400
[REFACTOR][IR] Migrate include/tvm/node into include/tvm/ir (#19463)
## Summary
`include/tvm/node/` is a leftover separation from when "node" was a
distinct concept from "ir". Today everything in `include/tvm/node/` is
just lower-level IR plumbing routinely included from `ir/`. This PR
collapses the two by moving surviving headers into `ir/`, deleting dead
ones, and redirecting the rest to tvm-ffi where the machinery already
lives.
Main changes:
- Migrate
`include/tvm/node/{functor,cast,script_printer,attr_registry_map,repr}.h`
→ `include/tvm/ir/` (functor renamed to `node_functor.h` to preserve
type-name connection)
- Delete `repr_printer.h`, `structural_equal.h`, `structural_hash.h`
(post-#19461 shims and forwarding stubs; redirect 3 cpptest consumers to
`tvm/ffi/extra/structural_equal.h`)
- Remove inline `AccessStep`/`AccessPath` `operator<<` definitions
(existing `__ffi_repr__` registrations already cover these; migrate to
generic ObjectRef streaming via kRepr)
- Move `src/node/{repr,script_printer}.cc` → `src/ir/`
- Delete `src/node/` and empty `include/tvm/node/` directories entirely
(no shims)
- Update 35 includers across IR, relax, script, target, tirx, and tests
---
CMakeLists.txt | 1 -
include/tvm/ir/analysis.h | 2 +-
include/tvm/{node => ir}/attr_registry_map.h | 8 ++--
include/tvm/{node => ir}/cast.h | 8 ++--
include/tvm/ir/expr.h | 6 +--
include/tvm/ir/module.h | 2 +-
include/tvm/{node/functor.h => ir/node_functor.h} | 8 ++--
include/tvm/ir/op.h | 2 +-
include/tvm/{node => ir}/repr.h | 54 ++--------------------
include/tvm/{node => ir}/script_printer.h | 10 ++--
include/tvm/ir/type_functor.h | 2 +-
include/tvm/node/repr_printer.h | 30 ------------
include/tvm/node/structural_equal.h | 29 ------------
include/tvm/node/structural_hash.h | 29 ------------
include/tvm/relax/exec_builder.h | 2 +-
include/tvm/relax/expr_functor.h | 2 +-
include/tvm/relax/struct_info.h | 2 +-
include/tvm/relax/struct_info_functor.h | 2 +-
include/tvm/script/ir_builder/base.h | 2 +-
include/tvm/script/printer/ir_docsifier.h | 2 +-
include/tvm/target/tag.h | 2 +-
include/tvm/target/target.h | 2 +-
include/tvm/target/target_kind.h | 2 +-
include/tvm/tirx/buffer.h | 2 +-
include/tvm/tirx/expr.h | 2 +-
include/tvm/tirx/expr_functor.h | 2 +-
include/tvm/tirx/function.h | 2 +-
include/tvm/tirx/stmt.h | 2 +-
include/tvm/tirx/stmt_functor.h | 2 +-
src/ir/attr_functor.h | 2 +-
src/ir/attr_registry.h | 2 +-
src/ir/instrument.cc | 2 +-
src/{node => ir}/repr.cc | 4 +-
src/{node => ir}/script_printer.cc | 6 +--
src/ir/structural_equal.cc | 6 +--
src/ir/structural_hash.cc | 2 +-
src/ir/transform.cc | 2 +-
src/node/container_printing.cc | 26 -----------
src/node/repr_printer.cc | 25 ----------
src/relax/ir/dataflow_pattern.cc | 2 +-
src/relax/ir/transform.cc | 2 +-
src/s_tir/meta_schedule/utils.h | 2 +-
.../schedule/primitive/layout_transformation.cc | 2 +-
src/tirx/ir/transform.cc | 2 +-
tests/cpp/arith_simplify_test.cc | 2 +-
tests/cpp/expr_test.cc | 2 +-
tests/cpp/ir_functor_test.cc | 2 +-
tests/cpp/nested_msg_test.cc | 2 +-
48 files changed, 65 insertions(+), 251 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f75f5b6e73..8056a1d780 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -267,7 +267,6 @@ assign_source_group("Include" ${GROUP_INCLUDE})
# Source file lists
tvm_file_glob(GLOB_RECURSE COMPILER_SRCS
- src/node/*.cc
src/ir/*.cc
src/arith/*.cc
src/te/*.cc
diff --git a/include/tvm/ir/analysis.h b/include/tvm/ir/analysis.h
index 5879f34633..43db06f89e 100644
--- a/include/tvm/ir/analysis.h
+++ b/include/tvm/ir/analysis.h
@@ -30,7 +30,7 @@
#include <tvm/ffi/container/array.h>
#include <tvm/ir/expr.h>
#include <tvm/ir/module.h>
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
namespace tvm {
namespace ir {
diff --git a/include/tvm/node/attr_registry_map.h
b/include/tvm/ir/attr_registry_map.h
similarity index 96%
rename from include/tvm/node/attr_registry_map.h
rename to include/tvm/ir/attr_registry_map.h
index 9b689304ca..fd4c53bc4f 100644
--- a/include/tvm/node/attr_registry_map.h
+++ b/include/tvm/ir/attr_registry_map.h
@@ -17,11 +17,11 @@
* under the License.
*/
/*!
- * \file tvm/node/attr_registry_map.h
+ * \file tvm/ir/attr_registry_map.h
* \brief Attribute map used in registry.
*/
-#ifndef TVM_NODE_ATTR_REGISTRY_MAP_H_
-#define TVM_NODE_ATTR_REGISTRY_MAP_H_
+#ifndef TVM_IR_ATTR_REGISTRY_MAP_H_
+#define TVM_IR_ATTR_REGISTRY_MAP_H_
#include <tvm/ffi/string.h>
@@ -141,4 +141,4 @@ class AttrRegistryMap {
};
} // namespace tvm
-#endif // TVM_NODE_ATTR_REGISTRY_MAP_H_
+#endif // TVM_IR_ATTR_REGISTRY_MAP_H_
diff --git a/include/tvm/node/cast.h b/include/tvm/ir/cast.h
similarity index 97%
rename from include/tvm/node/cast.h
rename to include/tvm/ir/cast.h
index 32d4be7216..dedd5f05b8 100644
--- a/include/tvm/node/cast.h
+++ b/include/tvm/ir/cast.h
@@ -17,11 +17,11 @@
* under the License.
*/
/*!
- * \file tvm/node/cast.h
+ * \file tvm/ir/cast.h
* \brief Value casting helpers
*/
-#ifndef TVM_NODE_CAST_H_
-#define TVM_NODE_CAST_H_
+#ifndef TVM_IR_CAST_H_
+#define TVM_IR_CAST_H_
#include <tvm/ffi/any.h>
#include <tvm/ffi/cast.h>
@@ -115,4 +115,4 @@ inline OptionalType Downcast(const std::optional<ffi::Any>&
ref) {
}
}
} // namespace tvm
-#endif // TVM_NODE_CAST_H_
+#endif // TVM_IR_CAST_H_
diff --git a/include/tvm/ir/expr.h b/include/tvm/ir/expr.h
index 968bef0727..b7c1b0140c 100644
--- a/include/tvm/ir/expr.h
+++ b/include/tvm/ir/expr.h
@@ -26,11 +26,11 @@
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ffi/string.h>
+#include <tvm/ir/cast.h>
+#include <tvm/ir/repr.h>
+#include <tvm/ir/script_printer.h>
#include <tvm/ir/source_map.h>
#include <tvm/ir/type.h>
-#include <tvm/node/cast.h>
-#include <tvm/node/repr.h>
-#include <tvm/node/script_printer.h>
#include <tvm/runtime/object.h>
#include <algorithm>
diff --git a/include/tvm/ir/module.h b/include/tvm/ir/module.h
index 543c895ce5..2d53efbcd5 100644
--- a/include/tvm/ir/module.h
+++ b/include/tvm/ir/module.h
@@ -31,9 +31,9 @@
#include <tvm/ir/expr.h>
#include <tvm/ir/function.h>
#include <tvm/ir/global_info.h>
+#include <tvm/ir/script_printer.h>
#include <tvm/ir/source_map.h>
#include <tvm/ir/type.h>
-#include <tvm/node/script_printer.h>
#include <string>
#include <unordered_map>
diff --git a/include/tvm/node/functor.h b/include/tvm/ir/node_functor.h
similarity index 98%
rename from include/tvm/node/functor.h
rename to include/tvm/ir/node_functor.h
index bb507beb3c..b88a3b2fce 100644
--- a/include/tvm/node/functor.h
+++ b/include/tvm/ir/node_functor.h
@@ -17,11 +17,11 @@
* under the License.
*/
/*!
- * \file tvm/node/functor.h
+ * \file tvm/ir/node_functor.h
* \brief Defines the Functor data structures.
*/
-#ifndef TVM_NODE_FUNCTOR_H_
-#define TVM_NODE_FUNCTOR_H_
+#ifndef TVM_IR_NODE_FUNCTOR_H_
+#define TVM_IR_NODE_FUNCTOR_H_
#include <tvm/runtime/logging.h>
#include <tvm/runtime/object.h>
@@ -194,4 +194,4 @@ class NodeFunctor<R(const ObjectRef& n, Args...)> {
#define TVM_STATIC_IR_FUNCTOR(ClsName, FField) \
TVM_STR_CONCAT(TVM_REG_FUNC_VAR_DEF(ClsName), __COUNTER__) =
ClsName::FField()
} // namespace tvm
-#endif // TVM_NODE_FUNCTOR_H_
+#endif // TVM_IR_NODE_FUNCTOR_H_
diff --git a/include/tvm/ir/op.h b/include/tvm/ir/op.h
index 062ac3116f..60eb6febf1 100644
--- a/include/tvm/ir/op.h
+++ b/include/tvm/ir/op.h
@@ -27,11 +27,11 @@
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/registry.h>
+#include <tvm/ir/attr_registry_map.h>
#include <tvm/ir/attrs.h>
#include <tvm/ir/env_func.h>
#include <tvm/ir/expr.h>
#include <tvm/ir/type.h>
-#include <tvm/node/attr_registry_map.h>
#include <tvm/runtime/logging.h>
#include <string>
diff --git a/include/tvm/node/repr.h b/include/tvm/ir/repr.h
similarity index 60%
rename from include/tvm/node/repr.h
rename to include/tvm/ir/repr.h
index 48276df1ec..126a209b2a 100644
--- a/include/tvm/node/repr.h
+++ b/include/tvm/ir/repr.h
@@ -17,18 +17,17 @@
* under the License.
*/
/*!
- * \file tvm/node/repr.h
+ * \file tvm/ir/repr.h
* \brief ostream operator<< for ObjectRef, Any, and Variant, delegating to
* ffi::ReprPrint. Also re-exports the Dump() debug helpers.
*
* Include this header wherever you need `os << some_objectref` and you are
* no longer pulling in the legacy repr_printer.h.
*/
-#ifndef TVM_NODE_REPR_H_
-#define TVM_NODE_REPR_H_
+#ifndef TVM_IR_REPR_H_
+#define TVM_IR_REPR_H_
#include <tvm/ffi/extra/dataclass.h>
-#include <tvm/ffi/reflection/access_path.h>
#include <tvm/runtime/object.h>
#include <iostream>
@@ -68,51 +67,6 @@ inline std::ostream& operator<<(std::ostream& os, const
ffi::Variant<V...>& n) {
return os << ffi::ReprPrint(Any(n));
}
-namespace reflection {
-
-inline std::ostream& operator<<(std::ostream& os, const AccessStep& step) {
- namespace refl = ffi::reflection;
- switch (step->kind) {
- case refl::AccessKind::kAttr: {
- os << '.' << step->key.cast<ffi::String>();
- return os;
- }
- case refl::AccessKind::kArrayItem: {
- os << "[" << step->key.cast<int64_t>() << "]";
- return os;
- }
- case refl::AccessKind::kMapItem: {
- os << "[" << step->key << "]";
- return os;
- }
- case refl::AccessKind::kAttrMissing: {
- os << ".<missing attr " << step->key.cast<ffi::String>() << "`>";
- return os;
- }
- case refl::AccessKind::kArrayItemMissing: {
- os << "[<missing item at " << step->key.cast<int64_t>() << ">]";
- return os;
- }
- case refl::AccessKind::kMapItemMissing: {
- os << "[<missing item at " << step->key << ">]";
- return os;
- }
- default: {
- TVM_FFI_THROW(InternalError) << "Unknown access step kind: " <<
static_cast<int>(step->kind);
- }
- }
- return os;
-}
-
-inline std::ostream& operator<<(std::ostream& os, const AccessPath& path) {
- ffi::Array<AccessStep> steps = path->ToSteps();
- os << "<root>";
- for (const auto& step : steps) {
- os << step;
- }
- return os;
-}
-} // namespace reflection
} // namespace ffi
} // namespace tvm
-#endif // TVM_NODE_REPR_H_
+#endif // TVM_IR_REPR_H_
diff --git a/include/tvm/node/script_printer.h b/include/tvm/ir/script_printer.h
similarity index 97%
rename from include/tvm/node/script_printer.h
rename to include/tvm/ir/script_printer.h
index 5eeab20107..9c0b7c2cc2 100644
--- a/include/tvm/node/script_printer.h
+++ b/include/tvm/ir/script_printer.h
@@ -17,11 +17,11 @@
* under the License.
*/
/*!
- * \file tvm/node/repr_printer.h
+ * \file tvm/ir/script_printer.h
* \brief Printer class to print repr string of each AST/IR nodes.
*/
-#ifndef TVM_NODE_SCRIPT_PRINTER_H_
-#define TVM_NODE_SCRIPT_PRINTER_H_
+#ifndef TVM_IR_SCRIPT_PRINTER_H_
+#define TVM_IR_SCRIPT_PRINTER_H_
#include <tvm/ffi/any.h>
#include <tvm/ffi/container/array.h>
@@ -29,7 +29,7 @@
#include <tvm/ffi/reflection/access_path.h>
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ffi/string.h>
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
#include <tvm/runtime/data_type.h>
#include <iostream>
@@ -178,4 +178,4 @@ class TVMScriptPrinter {
}
} // namespace tvm
-#endif // TVM_NODE_SCRIPT_PRINTER_H_
+#endif // TVM_IR_SCRIPT_PRINTER_H_
diff --git a/include/tvm/ir/type_functor.h b/include/tvm/ir/type_functor.h
index 7d5c9ed519..41f5c223dc 100644
--- a/include/tvm/ir/type_functor.h
+++ b/include/tvm/ir/type_functor.h
@@ -24,8 +24,8 @@
#ifndef TVM_IR_TYPE_FUNCTOR_H_
#define TVM_IR_TYPE_FUNCTOR_H_
+#include <tvm/ir/node_functor.h>
#include <tvm/ir/type.h>
-#include <tvm/node/functor.h>
#include <string>
#include <utility>
diff --git a/include/tvm/node/repr_printer.h b/include/tvm/node/repr_printer.h
deleted file mode 100644
index 71d19f5245..0000000000
--- a/include/tvm/node/repr_printer.h
+++ /dev/null
@@ -1,30 +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.
- */
-/*!
- * \file tvm/node/repr_printer.h
- * \brief DEPRECATED: The legacy ReprPrinter has been replaced by
- * ffi::ReprPrint. This header is kept as an empty shim;
- * include <tvm/node/repr.h> instead.
- */
-#ifndef TVM_NODE_REPR_PRINTER_H_
-#define TVM_NODE_REPR_PRINTER_H_
-
-#include <tvm/node/repr.h>
-
-#endif // TVM_NODE_REPR_PRINTER_H_
diff --git a/include/tvm/node/structural_equal.h
b/include/tvm/node/structural_equal.h
deleted file mode 100644
index cbf7652b80..0000000000
--- a/include/tvm/node/structural_equal.h
+++ /dev/null
@@ -1,29 +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.
- */
-/*!
- * \file tvm/node/structural_equal.h
- * \brief Forwarding header. Use tvm/ffi/extra/structural_equal.h instead.
- */
-#ifndef TVM_NODE_STRUCTURAL_EQUAL_H_
-#define TVM_NODE_STRUCTURAL_EQUAL_H_
-
-// This header has moved to tvm/ffi/extra/structural_equal.h
-#include <tvm/ffi/extra/structural_equal.h>
-
-#endif // TVM_NODE_STRUCTURAL_EQUAL_H_
diff --git a/include/tvm/node/structural_hash.h
b/include/tvm/node/structural_hash.h
deleted file mode 100644
index 8f90820b15..0000000000
--- a/include/tvm/node/structural_hash.h
+++ /dev/null
@@ -1,29 +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.
- */
-/*!
- * \file tvm/node/structural_hash.h
- * \brief Forwarding header. Use tvm/ffi/extra/structural_hash.h instead.
- */
-#ifndef TVM_NODE_STRUCTURAL_HASH_H_
-#define TVM_NODE_STRUCTURAL_HASH_H_
-
-// This header has moved to tvm/ffi/extra/structural_hash.h
-#include <tvm/ffi/extra/structural_hash.h>
-
-#endif // TVM_NODE_STRUCTURAL_HASH_H_
diff --git a/include/tvm/relax/exec_builder.h b/include/tvm/relax/exec_builder.h
index f85b5af460..c4f680d176 100644
--- a/include/tvm/relax/exec_builder.h
+++ b/include/tvm/relax/exec_builder.h
@@ -28,7 +28,7 @@
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ir/expr.h>
-#include <tvm/node/repr.h>
+#include <tvm/ir/repr.h>
#include <tvm/runtime/object.h>
#include <tvm/runtime/vm/bytecode.h>
#include <tvm/runtime/vm/executable.h>
diff --git a/include/tvm/relax/expr_functor.h b/include/tvm/relax/expr_functor.h
index e633603ff3..1993d5248d 100644
--- a/include/tvm/relax/expr_functor.h
+++ b/include/tvm/relax/expr_functor.h
@@ -25,7 +25,7 @@
#ifndef TVM_RELAX_EXPR_FUNCTOR_H_
#define TVM_RELAX_EXPR_FUNCTOR_H_
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
#include <tvm/relax/block_builder.h>
#include <tvm/relax/expr.h>
#include <tvm/relax/struct_info.h>
diff --git a/include/tvm/relax/struct_info.h b/include/tvm/relax/struct_info.h
index 0d9658d8cf..512c70453b 100644
--- a/include/tvm/relax/struct_info.h
+++ b/include/tvm/relax/struct_info.h
@@ -20,9 +20,9 @@
#define TVM_RELAX_STRUCT_INFO_H_
#include <tvm/ffi/reflection/registry.h>
+#include <tvm/ir/cast.h>
#include <tvm/ir/env_func.h>
#include <tvm/ir/source_map.h>
-#include <tvm/node/cast.h>
#include <tvm/relax/block_builder.h>
#include <tvm/relax/expr.h>
#include <tvm/relax/type.h>
diff --git a/include/tvm/relax/struct_info_functor.h
b/include/tvm/relax/struct_info_functor.h
index ae47e7dd94..80719383fc 100644
--- a/include/tvm/relax/struct_info_functor.h
+++ b/include/tvm/relax/struct_info_functor.h
@@ -24,7 +24,7 @@
#ifndef TVM_RELAX_STRUCT_INFO_FUNCTOR_H_
#define TVM_RELAX_STRUCT_INFO_FUNCTOR_H_
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
#include <tvm/relax/distributed/struct_info.h>
#include <tvm/relax/struct_info.h>
diff --git a/include/tvm/script/ir_builder/base.h
b/include/tvm/script/ir_builder/base.h
index 86888dea1c..50901b4b63 100644
--- a/include/tvm/script/ir_builder/base.h
+++ b/include/tvm/script/ir_builder/base.h
@@ -20,9 +20,9 @@
#define TVM_SCRIPT_IR_BUILDER_BASE_H_
#include <tvm/ffi/reflection/registry.h>
+#include <tvm/ir/cast.h>
#include <tvm/ir/expr.h>
#include <tvm/ir/function.h>
-#include <tvm/node/cast.h>
#include <vector>
diff --git a/include/tvm/script/printer/ir_docsifier.h
b/include/tvm/script/printer/ir_docsifier.h
index bd8c37780c..45b8fbea38 100644
--- a/include/tvm/script/printer/ir_docsifier.h
+++ b/include/tvm/script/printer/ir_docsifier.h
@@ -21,8 +21,8 @@
#include <tvm/ffi/reflection/access_path.h>
#include <tvm/ffi/reflection/registry.h>
+#include <tvm/ir/cast.h>
#include <tvm/ir/module.h>
-#include <tvm/node/cast.h>
#include <tvm/script/printer/doc.h>
#include <tvm/script/printer/ir_docsifier_functor.h>
diff --git a/include/tvm/target/tag.h b/include/tvm/target/tag.h
index 4557d20740..f150edf4f8 100644
--- a/include/tvm/target/tag.h
+++ b/include/tvm/target/tag.h
@@ -25,7 +25,7 @@
#define TVM_TARGET_TAG_H_
#include <tvm/ffi/reflection/registry.h>
-#include <tvm/node/attr_registry_map.h>
+#include <tvm/ir/attr_registry_map.h>
#include <tvm/target/target.h>
#include <utility>
diff --git a/include/tvm/target/target.h b/include/tvm/target/target.h
index b71a4952b5..a9f6f6e848 100644
--- a/include/tvm/target/target.h
+++ b/include/tvm/target/target.h
@@ -25,9 +25,9 @@
#define TVM_TARGET_TARGET_H_
#include <tvm/ffi/reflection/registry.h>
+#include <tvm/ir/cast.h>
#include <tvm/ir/expr.h>
#include <tvm/ir/function.h>
-#include <tvm/node/cast.h>
#include <tvm/runtime/device_api.h>
#include <tvm/support/with.h>
#include <tvm/target/target_kind.h>
diff --git a/include/tvm/target/target_kind.h b/include/tvm/target/target_kind.h
index 48c670ef2c..53441a380e 100644
--- a/include/tvm/target/target_kind.h
+++ b/include/tvm/target/target_kind.h
@@ -26,8 +26,8 @@
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/registry.h>
+#include <tvm/ir/attr_registry_map.h>
#include <tvm/ir/config_schema.h>
-#include <tvm/node/attr_registry_map.h>
#include <tvm/runtime/object.h>
#include <memory>
diff --git a/include/tvm/tirx/buffer.h b/include/tvm/tirx/buffer.h
index 8f5c916a5c..fe9014b376 100644
--- a/include/tvm/tirx/buffer.h
+++ b/include/tvm/tirx/buffer.h
@@ -28,7 +28,7 @@
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ffi/string.h>
#include <tvm/ir/expr.h>
-#include <tvm/node/script_printer.h>
+#include <tvm/ir/script_printer.h>
#include <tvm/tirx/var.h>
#include <string>
diff --git a/include/tvm/tirx/expr.h b/include/tvm/tirx/expr.h
index ebd318d822..9af78271b5 100644
--- a/include/tvm/tirx/expr.h
+++ b/include/tvm/tirx/expr.h
@@ -29,7 +29,7 @@
#include <tvm/ffi/container/map.h>
#include <tvm/ffi/string.h>
#include <tvm/ir/expr.h>
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
#include <tvm/runtime/base.h>
#include <tvm/runtime/data_type.h>
#include <tvm/tirx/buffer.h>
diff --git a/include/tvm/tirx/expr_functor.h b/include/tvm/tirx/expr_functor.h
index 78e8076932..79c09473a8 100644
--- a/include/tvm/tirx/expr_functor.h
+++ b/include/tvm/tirx/expr_functor.h
@@ -25,7 +25,7 @@
#ifndef TVM_TIR_EXPR_FUNCTOR_H_
#define TVM_TIR_EXPR_FUNCTOR_H_
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
#include <tvm/tirx/expr.h>
#include <utility>
diff --git a/include/tvm/tirx/function.h b/include/tvm/tirx/function.h
index 0c98deb8b3..7c9015758c 100644
--- a/include/tvm/tirx/function.h
+++ b/include/tvm/tirx/function.h
@@ -27,7 +27,7 @@
#include <tvm/ffi/container/map.h>
#include <tvm/ffi/container/variant.h>
#include <tvm/ir/function.h>
-#include <tvm/node/script_printer.h>
+#include <tvm/ir/script_printer.h>
#include <tvm/runtime/tensor.h>
#include <tvm/tirx/buffer.h>
#include <tvm/tirx/expr.h>
diff --git a/include/tvm/tirx/stmt.h b/include/tvm/tirx/stmt.h
index c191c4e6bf..44de692def 100644
--- a/include/tvm/tirx/stmt.h
+++ b/include/tvm/tirx/stmt.h
@@ -25,7 +25,7 @@
#define TVM_TIR_STMT_H_
#include <tvm/ffi/reflection/registry.h>
-#include <tvm/node/script_printer.h>
+#include <tvm/ir/script_printer.h>
#include <tvm/tirx/expr.h>
#include <optional>
diff --git a/include/tvm/tirx/stmt_functor.h b/include/tvm/tirx/stmt_functor.h
index a756f03198..69991ab6cf 100644
--- a/include/tvm/tirx/stmt_functor.h
+++ b/include/tvm/tirx/stmt_functor.h
@@ -26,7 +26,7 @@
#ifndef TVM_TIR_STMT_FUNCTOR_H_
#define TVM_TIR_STMT_FUNCTOR_H_
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
#include <tvm/tirx/expr.h>
#include <tvm/tirx/expr_functor.h>
#include <tvm/tirx/function.h>
diff --git a/src/ir/attr_functor.h b/src/ir/attr_functor.h
index c2a26cb136..e399bfc441 100644
--- a/src/ir/attr_functor.h
+++ b/src/ir/attr_functor.h
@@ -30,7 +30,7 @@
#ifndef TVM_IR_ATTR_FUNCTOR_H_
#define TVM_IR_ATTR_FUNCTOR_H_
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
#include <tvm/tirx/expr.h>
#include <utility>
diff --git a/src/ir/attr_registry.h b/src/ir/attr_registry.h
index 1d1fdb2742..de80e5054e 100644
--- a/src/ir/attr_registry.h
+++ b/src/ir/attr_registry.h
@@ -25,7 +25,7 @@
#define TVM_IR_ATTR_REGISTRY_H_
#include <tvm/ffi/function.h>
-#include <tvm/node/attr_registry_map.h>
+#include <tvm/ir/attr_registry_map.h>
#include <memory>
#include <unordered_map>
diff --git a/src/ir/instrument.cc b/src/ir/instrument.cc
index ced20ba1b1..32dc19f7cb 100644
--- a/src/ir/instrument.cc
+++ b/src/ir/instrument.cc
@@ -24,8 +24,8 @@
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ir/instrument.h>
+#include <tvm/ir/repr.h>
#include <tvm/ir/transform.h>
-#include <tvm/node/repr.h>
#include <chrono>
#include <stack>
diff --git a/src/node/repr.cc b/src/ir/repr.cc
similarity index 98%
rename from src/node/repr.cc
rename to src/ir/repr.cc
index a194708c6d..6b87bfd9e3 100644
--- a/src/node/repr.cc
+++ b/src/ir/repr.cc
@@ -18,7 +18,7 @@
*/
/*!
- * \file node/repr.cc
+ * \file ir/repr.cc
* \brief Implements Dump helpers and FFI registration for ffi-repr-based
printing.
*
* The legacy ReprPrinter has been replaced by ffi::ReprPrint. This file:
@@ -30,7 +30,7 @@
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/access_path.h>
#include <tvm/ffi/reflection/registry.h>
-#include <tvm/node/repr.h>
+#include <tvm/ir/repr.h>
#include <tvm/runtime/device_api.h>
#include <sstream>
diff --git a/src/node/script_printer.cc b/src/ir/script_printer.cc
similarity index 98%
rename from src/node/script_printer.cc
rename to src/ir/script_printer.cc
index 2edf7860b5..1f7bea52e0 100644
--- a/src/node/script_printer.cc
+++ b/src/ir/script_printer.cc
@@ -19,10 +19,10 @@
#include <tvm/ffi/extra/dataclass.h>
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/registry.h>
+#include <tvm/ir/cast.h>
#include <tvm/ir/expr.h>
-#include <tvm/node/cast.h>
-#include <tvm/node/repr.h>
-#include <tvm/node/script_printer.h>
+#include <tvm/ir/repr.h>
+#include <tvm/ir/script_printer.h>
#include <algorithm>
diff --git a/src/ir/structural_equal.cc b/src/ir/structural_equal.cc
index b8f80f4d57..8c2cc754f0 100644
--- a/src/ir/structural_equal.cc
+++ b/src/ir/structural_equal.cc
@@ -24,9 +24,9 @@
#include <tvm/ffi/reflection/access_path.h>
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ir/module.h>
-#include <tvm/node/functor.h>
-#include <tvm/node/repr.h>
-#include <tvm/node/script_printer.h>
+#include <tvm/ir/node_functor.h>
+#include <tvm/ir/repr.h>
+#include <tvm/ir/script_printer.h>
#include <optional>
#include <unordered_map>
diff --git a/src/ir/structural_hash.cc b/src/ir/structural_hash.cc
index 01ea19e4b7..a622eb3d04 100644
--- a/src/ir/structural_hash.cc
+++ b/src/ir/structural_hash.cc
@@ -25,7 +25,7 @@
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/access_path.h>
#include <tvm/ffi/reflection/registry.h>
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
#include <tvm/runtime/tensor.h>
#include <tvm/support/io.h>
#include <tvm/target/codegen.h>
diff --git a/src/ir/transform.cc b/src/ir/transform.cc
index 8c56f737d4..c301037732 100644
--- a/src/ir/transform.cc
+++ b/src/ir/transform.cc
@@ -25,8 +25,8 @@
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ffi/rvalue_ref.h>
+#include <tvm/ir/repr.h>
#include <tvm/ir/transform.h>
-#include <tvm/node/repr.h>
#include <tvm/relax/expr.h>
#include <tvm/runtime/device_api.h>
diff --git a/src/node/container_printing.cc b/src/node/container_printing.cc
deleted file mode 100644
index 3a6700c788..0000000000
--- a/src/node/container_printing.cc
+++ /dev/null
@@ -1,26 +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.
- */
-
-/*!
- * \file node/container_printing.cc
- * \brief DEPRECATED — tvm-ffi provides built-in repr for Array/Map/Shape.
- * The legacy ReprPrinter dispatches for containers are no longer
needed.
- */
-// This file is intentionally empty. Container repr is handled by
-// ffi::ReprPrint (tvm-ffi/src/ffi/extra/dataclass.cc).
diff --git a/src/node/repr_printer.cc b/src/node/repr_printer.cc
deleted file mode 100644
index de01909c8d..0000000000
--- a/src/node/repr_printer.cc
+++ /dev/null
@@ -1,25 +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.
- */
-
-/*!
- * \file node/repr_printer.cc
- * \brief DEPRECATED — implementation moved to src/node/repr.cc.
- */
-// This file is intentionally empty. The legacy ReprPrinter has been removed.
-// See src/node/repr.cc for the replacement implementation.
diff --git a/src/relax/ir/dataflow_pattern.cc b/src/relax/ir/dataflow_pattern.cc
index ed400b82bf..57fdf66a39 100644
--- a/src/relax/ir/dataflow_pattern.cc
+++ b/src/relax/ir/dataflow_pattern.cc
@@ -24,7 +24,7 @@
#include <tvm/ffi/extra/dataclass.h>
#include <tvm/ffi/reflection/registry.h>
-#include <tvm/node/repr.h>
+#include <tvm/ir/repr.h>
#include <tvm/relax/dataflow_pattern.h>
#include <tvm/relax/dataflow_pattern_functor.h>
diff --git a/src/relax/ir/transform.cc b/src/relax/ir/transform.cc
index 49b32307f7..7be08203a8 100644
--- a/src/relax/ir/transform.cc
+++ b/src/relax/ir/transform.cc
@@ -24,7 +24,7 @@
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ffi/rvalue_ref.h>
-#include <tvm/node/repr.h>
+#include <tvm/ir/repr.h>
#include <tvm/relax/analysis.h>
#include <tvm/relax/expr_functor.h>
#include <tvm/relax/struct_info_functor.h>
diff --git a/src/s_tir/meta_schedule/utils.h b/src/s_tir/meta_schedule/utils.h
index cd0eee04c9..9bfbddd7f9 100644
--- a/src/s_tir/meta_schedule/utils.h
+++ b/src/s_tir/meta_schedule/utils.h
@@ -23,7 +23,7 @@
#include <tvm/ffi/extra/json.h>
#include <tvm/ffi/extra/serialization.h>
#include <tvm/ffi/optional.h>
-#include <tvm/node/cast.h>
+#include <tvm/ir/cast.h>
#include <tvm/runtime/object.h>
#include <tvm/s_tir/meta_schedule/arg_info.h>
#include <tvm/s_tir/meta_schedule/builder.h>
diff --git a/src/s_tir/schedule/primitive/layout_transformation.cc
b/src/s_tir/schedule/primitive/layout_transformation.cc
index b505e952cc..33c4add697 100644
--- a/src/s_tir/schedule/primitive/layout_transformation.cc
+++ b/src/s_tir/schedule/primitive/layout_transformation.cc
@@ -18,7 +18,7 @@
*/
#include <tvm/arith/analyzer.h>
-#include <tvm/node/cast.h>
+#include <tvm/ir/cast.h>
#include <tvm/runtime/object.h>
#include <optional>
diff --git a/src/tirx/ir/transform.cc b/src/tirx/ir/transform.cc
index 3cf2f58008..3c6a786845 100644
--- a/src/tirx/ir/transform.cc
+++ b/src/tirx/ir/transform.cc
@@ -24,7 +24,7 @@
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ffi/rvalue_ref.h>
-#include <tvm/node/repr.h>
+#include <tvm/ir/repr.h>
#include <tvm/tirx/transform.h>
namespace tvm {
diff --git a/tests/cpp/arith_simplify_test.cc b/tests/cpp/arith_simplify_test.cc
index 703e83c531..2724f3a042 100644
--- a/tests/cpp/arith_simplify_test.cc
+++ b/tests/cpp/arith_simplify_test.cc
@@ -19,7 +19,7 @@
#include <gtest/gtest.h>
#include <tvm/arith/analyzer.h>
-#include <tvm/node/structural_equal.h>
+#include <tvm/ffi/extra/structural_equal.h>
#include <tvm/runtime/logging.h>
#include <tvm/te/operation.h>
diff --git a/tests/cpp/expr_test.cc b/tests/cpp/expr_test.cc
index 16fe4d8dfd..e89e10ad51 100644
--- a/tests/cpp/expr_test.cc
+++ b/tests/cpp/expr_test.cc
@@ -18,7 +18,7 @@
*/
#include <gtest/gtest.h>
-#include <tvm/node/structural_equal.h>
+#include <tvm/ffi/extra/structural_equal.h>
#include <tvm/runtime/logging.h>
#include <tvm/te/operation.h>
diff --git a/tests/cpp/ir_functor_test.cc b/tests/cpp/ir_functor_test.cc
index 8ad1a17377..ffab42dc31 100644
--- a/tests/cpp/ir_functor_test.cc
+++ b/tests/cpp/ir_functor_test.cc
@@ -19,7 +19,7 @@
#include <gtest/gtest.h>
#include <tvm/ir/module.h>
-#include <tvm/node/functor.h>
+#include <tvm/ir/node_functor.h>
#include <tvm/runtime/logging.h>
#include <tvm/tirx/analysis.h>
#include <tvm/tirx/builtin.h>
diff --git a/tests/cpp/nested_msg_test.cc b/tests/cpp/nested_msg_test.cc
index a23be7ebdd..c5effba7a1 100644
--- a/tests/cpp/nested_msg_test.cc
+++ b/tests/cpp/nested_msg_test.cc
@@ -18,7 +18,7 @@
*/
#include <gtest/gtest.h>
-#include <tvm/node/structural_equal.h>
+#include <tvm/ffi/extra/structural_equal.h>
#include <tvm/relax/nested_msg.h>
#include <tvm/relax/struct_info.h>
#include <tvm/runtime/data_type.h>