Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
pass.h
Go to the documentation of this file.
1// Copyright 2026 The IREE Authors
2//
3// Licensed under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
7#ifndef LOOMC_PASS_H_
8#define LOOMC_PASS_H_
9
10#include "loomc/context.h"
11#include "loomc/module.h"
12#include "loomc/result.h"
13
72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
89
110
125
143 loomc_context_t* context, const loomc_pass_program_options_t* options,
144 loomc_allocator_t allocator, loomc_pass_program_t** out_pass_program);
145
185 loomc_context_t* context, loomc_string_view_t pipeline_text,
186 const loomc_pass_program_options_t* options, loomc_allocator_t allocator,
187 loomc_pass_program_t** out_pass_program, loomc_result_t** out_result);
188
231 const loomc_module_t* module, loomc_string_view_t pipeline_symbol,
232 const loomc_pass_program_options_t* options, loomc_allocator_t allocator,
233 loomc_pass_program_t** out_pass_program, loomc_result_t** out_result);
234
242 loomc_pass_program_t* pass_program);
243
252 loomc_pass_program_t* pass_program);
253
288 const loomc_pass_program_t* pass_program, loomc_workspace_t* workspace,
289 loomc_module_t* module, const loomc_pass_run_options_t* options,
290 loomc_allocator_t allocator, loomc_result_t** out_result);
291
292#ifdef __cplusplus
293} // extern "C"
294#endif
295
296#endif // LOOMC_PASS_H_
#define LOOMC_API_EXPORT
Exports a public Loom C API symbol from a shared library build.
Definition base.h:34
size_t loomc_host_size_t
Host allocation and container size type.
Definition base.h:45
loomc_structure_type_t
Structure type values used by extensible public descriptors.
Definition base.h:181
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
Reusable Loom API context.
struct loomc_context_t loomc_context_t
Immutable Loom API context.
Definition context.h:63
Opaque in-memory Loom modules.
struct loomc_module_t loomc_module_t
Opaque parsed, linked, optimized, or lowered module.
Definition module.h:90
void loomc_pass_program_release(loomc_pass_program_t *pass_program)
Releases a pass program from one owner.
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_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_run(const loomc_pass_program_t *pass_program, loomc_workspace_t *workspace, loomc_module_t *module, const loomc_pass_run_options_t *options, loomc_allocator_t allocator, loomc_result_t **out_result)
Executes a prepared pipeline, transforming a caller-owned module in place.
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.
struct loomc_pass_program_t loomc_pass_program_t
Prepared immutable pass program.
Definition pass.h:88
void loomc_pass_program_retain(loomc_pass_program_t *pass_program)
Retains a pass program for another owner.
Shared operation result container.
struct loomc_result_t loomc_result_t
Immutable operation result.
Definition result.h:71
Host allocator used for persistent Loom object storage.
Definition base.h:414
Pass program creation options.
Definition pass.h:95
loomc_string_view_t identifier
Stable identifier used in diagnostics and reports.
Definition pass.h:108
loomc_structure_type_t type
Structure type.
Definition pass.h:98
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition pass.h:101
const void * next
Extension chain reserved for future pass-program options.
Definition pass.h:104
Options for executing one prepared pass program.
Definition pass.h:116
loomc_host_size_t structure_size
Size of this structure in bytes, or zero.
Definition pass.h:120
const void * next
Invocation extensions, borrowed until execution returns.
Definition pass.h:123
loomc_structure_type_t type
Structure type; LOOMC_STRUCTURE_TYPE_PASS_RUN_OPTIONS when nonzero.
Definition pass.h:118
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63
struct loomc_workspace_t loomc_workspace_t
Mutable per-worker scratch workspace.
Definition workspace.h:54