|
Loom C API
Public Loom compiler C API
|
Prepared pass programs. More...
Go to the source code of this file.
Data Structures | |
| struct | loomc_pass_program_options_t |
| Pass program creation options. More... | |
Typedefs | |
| typedef struct loomc_pass_program_t | loomc_pass_program_t |
| Prepared immutable pass program. | |
Functions | |
| loomc_status_t | loomc_pass_program_create_empty (loomc_context_t *context, const loomc_pass_program_options_t *options, loomc_allocator_t allocator, loomc_pass_program_t **out_pass_program) |
| Creates a prepared no-op pass program. | |
| loomc_status_t | loomc_pass_program_create_from_pipeline_text (loomc_context_t *context, loomc_string_view_t pipeline_text, const loomc_pass_program_options_t *options, loomc_allocator_t allocator, loomc_pass_program_t **out_pass_program, loomc_result_t **out_result) |
| Creates a prepared pass program from a shallow textual pass list. | |
| loomc_status_t | loomc_pass_program_create_from_module_symbol (const loomc_module_t *module, loomc_string_view_t pipeline_symbol, const loomc_pass_program_options_t *options, loomc_allocator_t allocator, loomc_pass_program_t **out_pass_program, loomc_result_t **out_result) |
| Creates a prepared pass program from a named pass.pipeline symbol. | |
| void | loomc_pass_program_retain (loomc_pass_program_t *pass_program) |
| Retains a pass program for another owner. | |
| void | loomc_pass_program_release (loomc_pass_program_t *pass_program) |
| Releases a pass program from one owner. | |
Prepared pass programs.
A pass program is the reusable, immutable representation of a Loom compile pipeline. Constructor helpers prepare this handle from cold configuration forms such as a textual flag-like pass list; compile invocations borrow the prepared object directly. This keeps the hot JIT path from reparsing pipeline strings or rebuilding pass descriptor state for every kernel.
| typedef struct loomc_pass_program_t loomc_pass_program_t |
Prepared immutable pass program.
Pass programs are separate from compilers so JITs and autotuners can cache common pipelines, choose among several prepared programs per invocation, or sweep pipeline configurations without constructing many compiler handles. Pass programs remain target-independent. Target-aware predicates resolve each function's durable target when the program executes.
| loomc_status_t loomc_pass_program_create_empty | ( | loomc_context_t * | context, |
| const loomc_pass_program_options_t * | options, | ||
| loomc_allocator_t | allocator, | ||
| loomc_pass_program_t ** | out_pass_program ) |
Creates a prepared no-op pass program.
| context | Context shared with modules compiled using this pass program. |
| options | Pass program options, or NULL for defaults. |
| allocator | Host allocator used for pass-program-owned storage. |
| out_pass_program | Receives one retained pass program on success. |
| loomc_status_t loomc_pass_program_create_from_module_symbol | ( | const loomc_module_t * | module, |
| loomc_string_view_t | pipeline_symbol, | ||
| const loomc_pass_program_options_t * | options, | ||
| loomc_allocator_t | allocator, | ||
| loomc_pass_program_t ** | out_pass_program, | ||
| loomc_result_t ** | out_result ) |
Creates a prepared pass program from a named pass.pipeline symbol.
pipeline_symbol names a symbol in module; both cleanup and @cleanup are accepted. The symbol must resolve to a pass.pipeline op. Any pipeline symbols reached through call @other_pipeline are included in the prepared program snapshot so the returned handle is independent of the source module.
| module | Module containing the selected pass pipeline. |
| pipeline_symbol | Borrowed, non-NUL-terminated pipeline symbol name. |
| options | Pass program options, or NULL for defaults. |
| allocator | Host allocator used for pass-program and result storage. |
| out_pass_program | Receives one retained pass program when the result succeeds. Receives NULL when the symbol does not resolve to a valid pipeline program. |
| out_result | Receives a retained result containing pipeline selection, verification, and preparation diagnostics. |
| loomc_status_t loomc_pass_program_create_from_pipeline_text | ( | loomc_context_t * | context, |
| loomc_string_view_t | pipeline_text, | ||
| const loomc_pass_program_options_t * | options, | ||
| loomc_allocator_t | allocator, | ||
| loomc_pass_program_t ** | out_pass_program, | ||
| loomc_result_t ** | out_result ) |
Creates a prepared pass program from a shallow textual pass list.
pipeline_text is the same cold-path pass-list shape used by command-line flags, for example canonicalize{max-iterations=20},dce. The textual form is intended for configuration and examples; hot paths should create a pass program once and pass the prepared handle to every compile invocation.
| context | Context shared with modules compiled using this pass program. |
| pipeline_text | Borrowed, non-NUL-terminated textual pass list. |
| options | Pass program options, or NULL for defaults. |
| allocator | Host allocator used for pass-program and result storage. |
| out_pass_program | Receives one retained pass program when the result succeeds. Receives NULL when the pass list is invalid. |
| out_result | Receives a retained result containing pass-list diagnostics and operation state. |
| void loomc_pass_program_release | ( | loomc_pass_program_t * | pass_program | ) |
Releases a pass program from one owner.
| pass_program | Pass program to release. Passing NULL is allowed. |
| void loomc_pass_program_retain | ( | loomc_pass_program_t * | pass_program | ) |
Retains a pass program for another owner.
| pass_program | Pass program to retain. |