Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/ir/analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -141,4 +141,4 @@ class AttrRegistryMap {
};

} // namespace tvm
#endif // TVM_NODE_ATTR_REGISTRY_MAP_H_
#endif // TVM_IR_ATTR_REGISTRY_MAP_H_
8 changes: 4 additions & 4 deletions include/tvm/node/cast.h → include/tvm/ir/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions include/tvm/ir/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/ir/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 4 additions & 4 deletions include/tvm/node/functor.h → include/tvm/ir/node_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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_
2 changes: 1 addition & 1 deletion include/tvm/ir/op.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
54 changes: 4 additions & 50 deletions include/tvm/node/repr.h → include/tvm/ir/repr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
* 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>
#include <tvm/ffi/container/map.h>
#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>
Expand Down Expand Up @@ -178,4 +178,4 @@ class TVMScriptPrinter {
}

} // namespace tvm
#endif // TVM_NODE_SCRIPT_PRINTER_H_
#endif // TVM_IR_SCRIPT_PRINTER_H_
2 changes: 1 addition & 1 deletion include/tvm/ir/type_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
30 changes: 0 additions & 30 deletions include/tvm/node/repr_printer.h

This file was deleted.

29 changes: 0 additions & 29 deletions include/tvm/node/structural_equal.h

This file was deleted.

29 changes: 0 additions & 29 deletions include/tvm/node/structural_hash.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/tvm/relax/exec_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/relax/expr_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/relax/struct_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/relax/struct_info_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion include/tvm/script/ir_builder/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion include/tvm/script/printer/ir_docsifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion include/tvm/target/tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Loading
Loading