Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
target.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_TARGET_H_
8#define LOOMC_TARGET_H_
9
10#include "loomc/context.h"
11#include "loomc/pass.h"
12#include "loomc/result.h"
13#include "loomc/sanitizer.h"
14
109
110#ifdef __cplusplus
111extern "C" {
112#endif
113
124
136
152
173
182
205
215
224
257
290 loomc_context_t* context, const loomc_target_pipeline_options_t* options,
291 loomc_allocator_t allocator, loomc_pass_program_t** out_pass_program,
292 loomc_result_t** out_result);
293
301 loomc_target_profile_t* profile);
302
311 loomc_target_profile_t* profile);
312
320 loomc_target_environment_t* target_environment);
321
331 loomc_target_environment_t* target_environment);
332
333#ifdef __cplusplus
334} // extern "C"
335#endif
336
337#endif // LOOMC_TARGET_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:47
Prepared pass programs.
struct loomc_pass_program_t loomc_pass_program_t
Prepared immutable pass program.
Definition pass.h:86
Shared operation result container.
struct loomc_result_t loomc_result_t
Immutable operation result.
Definition result.h:63
Sanitizer compile options.
Host allocator used for persistent Loom object storage.
Definition base.h:375
Context option extension that registers a target environment.
Definition target.h:159
loomc_target_environment_t * target_environment
Target environment to register with the context.
Definition target.h:171
const void * next
Next context option extension.
Definition target.h:168
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition target.h:165
loomc_structure_type_t type
Structure type.
Definition target.h:162
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63
Target pipeline creation options.
Definition target.h:232
loomc_target_control_flow_lowering_t control_flow_lowering
Control-flow shape selected for the source-to-low boundary.
Definition target.h:252
loomc_target_pipeline_kind_t kind
Target pipeline boundary to build.
Definition target.h:249
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition target.h:238
loomc_structure_type_t type
Structure type.
Definition target.h:235
const void * next
Extension chain for target pipeline options such as loomc_sanitizer_options_t.
Definition target.h:242
uint32_t source_to_low_max_errors
Maximum source-to-low diagnostics. Zero uses source-to-low's default.
Definition target.h:255
loomc_string_view_t identifier
Stable identifier used for the synthetic pipeline module and diagnostics.
Definition target.h:246
Option extension carrying per-function target specializations.
Definition target.h:188
const void * next
Additional option extensions in the same unordered chain.
Definition target.h:197
const loomc_target_specialization_t * specializations
Specialization rows borrowed for the invocation.
Definition target.h:200
loomc_structure_type_t type
Structure type.
Definition target.h:191
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition target.h:194
loomc_host_size_t specialization_count
Number of rows in specializations.
Definition target.h:203
One function version to specialize to one structured target profile.
Definition target.h:175
loomc_target_profile_t * target_profile
Complete target profile borrowed for the invocation.
Definition target.h:180
loomc_string_view_t function_symbol
Function symbol name. A leading @ is accepted.
Definition target.h:177
void loomc_target_profile_release(loomc_target_profile_t *profile)
Releases a target profile from one owner.
struct loomc_target_environment_t loomc_target_environment_t
Prepared immutable target environment.
Definition target.h:123
loomc_target_control_flow_lowering_t
Control-flow shape selected for source-to-low lowering.
Definition target.h:217
@ LOOMC_TARGET_CONTROL_FLOW_LOWERING_CFG
Lower source structured control flow to explicit CFG before source-to-low.
Definition target.h:219
@ LOOMC_TARGET_CONTROL_FLOW_LOWERING_STRUCTURED_LOW
Preserve supported structured control flow into target-low IR.
Definition target.h:222
void loomc_target_environment_retain(loomc_target_environment_t *target_environment)
Retains a target environment for another owner.
loomc_target_fact_state_t
Three-valued target fact state.
Definition target.h:142
@ LOOMC_TARGET_FACT_STATE_UNKNOWN
No fact has been supplied yet.
Definition target.h:144
@ LOOMC_TARGET_FACT_STATE_FALSE
The fact is known to be unavailable or false.
Definition target.h:147
@ LOOMC_TARGET_FACT_STATE_TRUE
The fact is known to be available or true.
Definition target.h:150
loomc_target_pipeline_kind_t
Target lowering pipeline boundary.
Definition target.h:207
@ LOOMC_TARGET_PIPELINE_KIND_PREPARED_LOW
Lower source/kernel IR to target-low IR prepared for target emission.
Definition target.h:209
@ LOOMC_TARGET_PIPELINE_KIND_SOURCE_LOW
Lower source/kernel IR to target-low IR before target ABI/resource materialization and packetization ...
Definition target.h:213
loomc_status_t loomc_pass_program_create_from_target_pipeline(loomc_context_t *context, const loomc_target_pipeline_options_t *options, loomc_allocator_t allocator, loomc_pass_program_t **out_pass_program, loomc_result_t **out_result)
Creates a prepared target lowering pass program.
void loomc_target_environment_release(loomc_target_environment_t *target_environment)
Releases a target environment from one owner.
struct loomc_target_profile_t loomc_target_profile_t
Prepared immutable target profile.
Definition target.h:135
void loomc_target_profile_retain(loomc_target_profile_t *profile)
Retains a target profile for another owner.