|
tvm
|
Classes | |
| class | Pass |
| class | PassContext |
| PassContext that is used to configure the pass behavior. More... | |
| class | PassContextObj |
| PassContextObj contains the information that a pass can rely on, such as analysis results. More... | |
| class | PassInfo |
| Managed reference class for PassInfoObj. More... | |
| class | PassInfoObj |
| Meta data that will be used to help optimization and analysis. More... | |
| class | PassInstrument |
| Managed reference class for PassInstrumentObj. More... | |
| class | PassInstrumentObj |
| PassInstrumentObj forms an instrument implementation. It provides API for users to register callbacks at different instrumentation points. More... | |
| class | PassObj |
| PassObj is the base type of different types of optimization passes. It is designed as a pure class and implemented by different pass subclasses at different granularity of IR nodes. More... | |
| class | Sequential |
| class | SequentialObj |
| The SequentialObj contains a set of passes that transform programs from one AST to another semantically equivalent one. More... | |
Functions | |
| template<typename TConfig > | |
| TConfig | PassConfigWithDefaults () |
| Create a pass-config object with all default values, using the reflection defaults. | |
| TVM_TIRX_DLL Pass | CreateModulePass (ffi::TypedFunction< IRModule(ffi::RValueRef< IRModule >, PassContext)> pass_func, int opt_level, ffi::String name) |
| Create a module pass from an owning FFI callback. | |
| Pass | CreateModulePass (std::function< IRModule(IRModule, PassContext)> pass_func, int opt_level, ffi::String name) |
| Create a module pass from a native C++ callback. | |
| TVM_TIRX_DLL Pass | PrintIR (ffi::String header="") |
| A special trace pass that prints the header and IR to LOG(INFO). | |
| TVM_TIRX_DLL ffi::Error | EnrichErrorWithContext (const ffi::Error &err, const ffi::ObjectRef &root, ffi::String context="") |
| Append an underlined TVMScript location from an error's visit context. | |
| TVM_TIRX_DLL ffi::Error | EnrichPassErrorWithContext (const ffi::Error &err, const IRModule &mod, ffi::String pass_name, ffi::Optional< GlobalVar > func=ffi::Optional< GlobalVar >(std::nullopt)) |
| Enrich a pass-time error with a TVMScript-rendered, underlined source location derived from the error's embedded VisitErrorContext. | |
| TVM_TIRX_DLL Pass tvm::transform::CreateModulePass | ( | ffi::TypedFunction< IRModule(ffi::RValueRef< IRModule >, PassContext)> | pass_func, |
| int | opt_level, | ||
| ffi::String | name | ||
| ) |
Create a module pass from an owning FFI callback.
| pass_func | The callback that transforms the module. |
| opt_level | The optimization level of the module pass. |
| name | The name of the module pass. |
|
inline |
Create a module pass from a native C++ callback.
| pass_func | The callback that transforms the module. |
| opt_level | The optimization level of the module pass. |
| name | The name of the module pass. |
| TVM_TIRX_DLL ffi::Error tvm::transform::EnrichErrorWithContext | ( | const ffi::Error & | err, |
| const ffi::ObjectRef & | root, | ||
| ffi::String | context = "" |
||
| ) |
Append an underlined TVMScript location from an error's visit context.
Preserve the original error kind, message, and backtrace. Return the original error if the context cannot be resolved or printed. A rendered error drops its visit context so outer handlers do not append the location again.
| err | The original error. |
| root | The IR root containing the visited nodes. |
| context | Optional operation description preceding the location. |
| TVM_TIRX_DLL ffi::Error tvm::transform::EnrichPassErrorWithContext | ( | const ffi::Error & | err, |
| const IRModule & | mod, | ||
| ffi::String | pass_name, | ||
| ffi::Optional< GlobalVar > | func = ffi::Optional< GlobalVar >(std::nullopt) |
||
| ) |
Enrich a pass-time error with a TVMScript-rendered, underlined source location derived from the error's embedded VisitErrorContext.
Returns an ffi::Error that preserves err's kind, original message, and backtrace, and appends the failing pass name plus the offending location rendered as TVMScript (the whole mod, or local to func when provided). The returned error drops the VisitErrorContext payload, so an outer catch that re-enriches finds no context and returns the error unchanged.
Pure and total: never throws; returns err unchanged when there is no context, the path is unresolvable, or rendering fails.
| err | The error thrown by the pass body. |
| mod | The IRModule the pass ran on (the access-path root, or the container of func when func is provided). |
| pass_name | The name of the failing pass, shown in the message. |
| func | When set, resolve and render the location local to mod->functions[func]; otherwise use the whole module. |
|
inline |
Create a pass-config object with all default values, using the reflection defaults.
| TConfig | the ObjectRef type to be created. |
| TVM_TIRX_DLL Pass tvm::transform::PrintIR | ( | ffi::String | header = "" | ) |
A special trace pass that prints the header and IR to LOG(INFO).
| header | The header to be attached to the output. |