Expand description
The shared IR: expressions, statements, types, functions, modules and operators.
Laid out like python/tvm_tirx/ir/. Expr, Stmt and Type are the bases of the three
node hierarchies, and IRModule holds the functions of a program. prim holds the
primitive expressions and transform the pass infrastructure.
Re-exports§
pub use attrs::*;pub use base::*;pub use expr::*;pub use function::*;pub use global_info::*;pub use location::*;pub use module::*;pub use op::*;pub use op_def::*;pub use stmt::*;pub use type::*;pub use type_def::*;pub use unique_name_supply::*;
Modules§
- Attributes attached to calls, functions and modules.
- Functions of the global registry referred to by name.
- The DLPack data types by their fields, for a caller that knows the type it wants:
dtype::int(32)where C++ writesDataType::Int(32), instead of parsing"int32"withDLDataType::try_from_str. These are plain values with no native call, so they can be constants and can be compared;PrimType::intand its siblings give the IR type of each. - Expressions: variables, constants, calls, tuples and tensor accesses.
- The base of every function.
- Module-level information that is not a function.
- Source locations of IR nodes, for diagnostics.
- The module: the unit of compilation.
- Operators: the registry entry
Op, itsArgumentInfo, and its attribute columns. - Registering operators from Rust: C++
OpDef, with its signature descriptors (sig) and attribute keys (op_attr), whose chains atvm_ffi::static_init_block!runs to define operators, as C++ defines them in aTVM_FFI_STATIC_INIT_BLOCK. - Primitive expressions: scalar arithmetic, comparisons and vector lanes.
- Statements: bindings, assertions, loops, conditionals, tensor stores and sequences.
- The pass infrastructure: passes, pass contexts and instrumentation.
- Types: primitive, pointer, tuple, function and the special types.
- Registering IR types from Rust:
register_type, which atvm_ffi::static_init_block!calls for anrs_classtype, as C++ registers a type withrefl::ObjectDefin aTVM_FFI_STATIC_INIT_BLOCK. - A supply of unique names, for building and rewriting IR.