rocm.bindings.llvm.c.lto

Contents

rocm.bindings.llvm.c.lto#

2026-09-24

33 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Attributes#

Classes#

lto_symbol_attributes

prior to LTO_API_VERSION=3

lto_debug_model

prior to LTO_API_VERSION=3

lto_codegen_model

prior to LTO_API_VERSION=3

LLVMOpaqueLTOModule

(No short description)

LLVMOpaqueLTOCodeGenerator

(No short description)

LLVMOpaqueThinLTOCodeGenerator

(No short description)

lto_codegen_diagnostic_severity_t

Diagnostic severity.

lto_diagnostic_handler_t

Diagnostic handler type.

LLVMOpaqueLTOInput

(No short description)

LTOObjectBuffer

Type to wrap a single object returned by ThinLTO.

Functions#

has_symbol(→ bool)

lto_get_version()

Returns a printable string.

lto_get_error_message()

Returns the last error string or NULL if last operation was successful.

lto_module_is_object_file(path)

Checks if a file is a loadable object file.

lto_module_is_object_file_for_target(path, ...)

Checks if a file is a loadable object compiled for requested target.

lto_module_has_objc_category(mem, length)

Return true if Buffer contains a bitcode file with ObjC code (category

lto_module_is_object_file_in_memory(mem, length)

Checks if a buffer is a loadable object file.

lto_module_is_object_file_in_memory_for_target(mem, ...)

Checks if a buffer is a loadable object compiled for requested target.

lto_module_create(path)

Loads an object file from disk.

lto_module_create_from_memory(mem, length)

Loads an object file from memory.

lto_module_create_from_memory_with_path(mem, length, path)

Loads an object file from memory with an extra path argument.

lto_module_create_in_local_context(mem, length, path)

Loads an object file in its own context.

lto_module_create_in_codegen_context(mem, length, path, cg)

Loads an object file in the codegen context.

lto_module_create_from_fd(fd, path, file_size)

Loads an object file from disk.

lto_module_create_from_fd_at_offset(fd, path, ...)

Loads an object file from disk.

lto_module_dispose(mod)

Frees all memory internally allocated by the module.

lto_module_get_target_triple(mod)

Returns triple string which the object module was compiled under.

lto_module_set_target_triple(mod, triple)

Sets triple string with which the object will be codegened.

lto_module_get_num_symbols(mod)

Returns the number of symbols in the object module.

lto_module_get_symbol_name(mod, index)

Returns the name of the ith symbol in the object module.

lto_module_get_symbol_attribute(mod, index)

Returns the attributes of the ith symbol in the object module.

lto_module_get_num_asm_undef_symbols(mod)

Returns the number of asm undefined symbols in the object module.

lto_module_get_asm_undef_symbol_name(mod, index)

Returns the name of the ith asm undefined symbol in the object module.

lto_module_get_linkeropts(mod)

Returns the module's linker options.

lto_module_get_macho_cputype(mod, out_cputype, ...)

If targeting mach-o on darwin, this function gets the CPU type and subtype

lto_module_has_ctor_dtor(mod)

This function can be used by the linker to check if a given module has

lto_codegen_set_diagnostic_handler(arg0, arg1, arg2)

Set a diagnostic handler and the related context (void *).

lto_codegen_create()

Instantiates a code generator.

lto_codegen_create_in_local_context()

Instantiate a code generator in its own context.

lto_codegen_dispose(arg0)

Frees all code generator and all memory it internally allocated.

lto_codegen_add_module(cg, mod)

Add an object module to the set of modules for which code will be generated.

lto_codegen_set_module(cg, mod)

Sets the object module for code generation.

lto_codegen_set_debug_model(cg, arg1)

Sets if debug info should be generated.

lto_codegen_set_pic_model(cg, arg1)

Sets which PIC code model to generated.

lto_codegen_set_cpu(cg, cpu)

Sets the cpu to generate code for.

lto_codegen_set_assembler_path(cg, path)

Sets the location of the assembler tool to run.

lto_codegen_set_assembler_args(cg, args, nargs)

Sets extra arguments that libLTO should pass to the assembler.

lto_codegen_add_must_preserve_symbol(cg, symbol)

Adds to a list of all global symbols that must exist in the final generated

lto_codegen_write_merged_modules(cg, path)

Writes a new object file at the specified path that contains the

lto_codegen_compile(cg, length)

Generates code for all added modules into one native object file.

lto_codegen_compile_to_file(cg, name)

Generates code for all added modules into one native object file.

lto_codegen_optimize(cg)

Runs optimization for the merged module. Returns true on error.

lto_codegen_compile_optimized(cg, length)

Generates code for the optimized merged module into one native object file.

lto_api_version()

Returns the runtime API version.

lto_set_debug_options(options, number)

Parses options immediately, making them available as early as possible.

lto_codegen_debug_options(cg, arg1)

Sets options to help debug codegen bugs.

lto_codegen_debug_options_array(cg, arg1, number)

Same as the previous function, but takes every option separately through an

lto_initialize_disassembler()

Initializes LLVM disassemblers.

lto_codegen_set_should_internalize(cg, ShouldInternalize)

Sets if we should run internalize pass during optimization and code

lto_codegen_set_should_embed_uselists(cg, ...)

Set whether to embed uselists in bitcode.

lto_input_create(buffer, buffer_size, path)

Creates an LTO input file from a buffer.

lto_input_dispose(input)

Frees all memory internally allocated by the LTO input file.

lto_input_get_num_dependent_libraries(input)

Returns the number of dependent library specifiers

lto_input_get_dependent_library(input, index, size)

Returns the ith dependent library specifier

lto_runtime_lib_symbols_list(size)

Returns the list of libcall symbols that can be generated by LTO

thinlto_create_codegen()

Instantiates a ThinLTO code generator.

thinlto_codegen_dispose(cg)

Frees the generator and all memory it internally allocated.

thinlto_codegen_add_module(cg, identifier, data, length)

Add a module to a ThinLTO code generator.

thinlto_codegen_process(cg)

Optimize and codegen all the modules added to the codegenerator using

thinlto_module_get_num_objects(cg)

Returns the number of object files produced by the ThinLTO CodeGenerator.

thinlto_module_get_object(cg, index)

Returns a reference to the ith object file produced by the ThinLTO

thinlto_module_get_num_object_files(cg)

Returns the number of object files produced by the ThinLTO CodeGenerator.

thinlto_module_get_object_file(cg, index)

Returns the path to the ith object file produced by the ThinLTO

thinlto_codegen_set_pic_model(cg, arg1)

Sets which PIC code model to generate.

thinlto_codegen_set_savetemps_dir(cg, save_temps_dir)

Sets the path to a directory to use as a storage for temporary bitcode files.

thinlto_set_generated_objects_dir(cg, save_temps_dir)

Set the path to a directory where to save generated object files.

thinlto_codegen_set_cpu(cg, cpu)

Sets the cpu to generate code for.

thinlto_codegen_disable_codegen(cg, disable)

Disable CodeGen, only run the stages till codegen and stop.

thinlto_codegen_set_codegen_only(cg, codegen_only)

Perform CodeGen only: disable all other stages.

thinlto_debug_options(options, number)

Parse -mllvm style debug options.

lto_module_is_thinlto(mod)

Test if a module has support for ThinLTO linking.

thinlto_codegen_add_must_preserve_symbol(cg, name, length)

Adds a symbol to the list of global symbols that must exist in the final

thinlto_codegen_add_cross_referenced_symbol(cg, name, ...)

Adds a symbol to the list of global symbols that are cross-referenced between

thinlto_codegen_set_cache_dir(cg, cache_dir)

Sets the path to a directory to use as a cache storage for incremental build.

thinlto_codegen_set_cache_pruning_interval(cg, interval)

Sets the cache pruning interval (in seconds).

thinlto_codegen_set_final_cache_size_relative_to_available_space(cg, ...)

Sets the maximum cache size that can be persistent across build, in terms of

thinlto_codegen_set_cache_entry_expiration(cg, expiration)

Sets the expiration (in seconds) for an entry in the cache.

thinlto_codegen_set_cache_size_bytes(cg, max_size_bytes)

Sets the maximum size of the cache directory (in bytes).

thinlto_codegen_set_cache_size_megabytes(cg, ...)

Same as thinlto_codegen_set_cache_size_bytes, except the maximum size is in

thinlto_codegen_set_cache_size_files(cg, max_size_files)

Sets the maximum number of files in the cache directory.

Module Contents#

rocm.bindings.llvm.c.lto.has_symbol(name: str | bytes | bytearray) → bool#
class rocm.bindings.llvm.c.lto.lto_symbol_attributes#

Bases: enum.IntEnum

prior to LTO_API_VERSION=3

Since:

LTO_SYMBOL_ALIGNMENT_MASK: int#
LTO_SYMBOL_PERMISSIONS_MASK: int#
LTO_SYMBOL_PERMISSIONS_CODE: int#
LTO_SYMBOL_PERMISSIONS_DATA: int#
LTO_SYMBOL_PERMISSIONS_RODATA: int#
LTO_SYMBOL_DEFINITION_MASK: int#
LTO_SYMBOL_DEFINITION_REGULAR: int#
LTO_SYMBOL_DEFINITION_TENTATIVE: int#
LTO_SYMBOL_DEFINITION_WEAK: int#
LTO_SYMBOL_DEFINITION_UNDEFINED: int#
LTO_SYMBOL_DEFINITION_WEAKUNDEF: int#
LTO_SYMBOL_SCOPE_MASK: int#
LTO_SYMBOL_SCOPE_INTERNAL: int#
LTO_SYMBOL_SCOPE_HIDDEN: int#
LTO_SYMBOL_SCOPE_PROTECTED: int#
LTO_SYMBOL_SCOPE_DEFAULT: int#
LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN: int#
LTO_SYMBOL_COMDAT: int#
LTO_SYMBOL_ALIAS: int#
class rocm.bindings.llvm.c.lto.lto_debug_model#

Bases: enum.IntEnum

prior to LTO_API_VERSION=3

Since:

LTO_DEBUG_MODEL_NONE: int#
LTO_DEBUG_MODEL_DWARF: int#
class rocm.bindings.llvm.c.lto.lto_codegen_model#

Bases: enum.IntEnum

prior to LTO_API_VERSION=3

Since:

LTO_CODEGEN_PIC_MODEL_STATIC: int#
LTO_CODEGEN_PIC_MODEL_DYNAMIC: int#
LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC: int#
LTO_CODEGEN_PIC_MODEL_DEFAULT: int#
class rocm.bindings.llvm.c.lto.LLVMOpaqueLTOModule(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.lto.lto_module_t#
class rocm.bindings.llvm.c.lto.LLVMOpaqueLTOCodeGenerator(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.lto.lto_code_gen_t#
class rocm.bindings.llvm.c.lto.LLVMOpaqueThinLTOCodeGenerator(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.lto.thinlto_code_gen_t#
rocm.bindings.llvm.c.lto.lto_get_version()#

Returns a printable string.

Since:

prior to LTO_API_VERSION=3

Returns:

bytes: (undocumented)

C signature

const char * lto_get_version()
rocm.bindings.llvm.c.lto.lto_get_error_message()#

Returns the last error string or NULL if last operation was successful.

Since:

prior to LTO_API_VERSION=3

Returns:

bytes: (undocumented)

C signature

const char * lto_get_error_message()
rocm.bindings.llvm.c.lto.lto_module_is_object_file(path)#

Checks if a file is a loadable object file.

Since:

prior to LTO_API_VERSION=3

Args:
path (CStr/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_module_is_object_file(const char * path)
rocm.bindings.llvm.c.lto.lto_module_is_object_file_for_target(path, target_triple_prefix)#

Checks if a file is a loadable object compiled for requested target.

Since:

prior to LTO_API_VERSION=3

Args:
path (CStr/object):

(undocumented)

target_triple_prefix (CStr/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_module_is_object_file_for_target(const char * path, const char * target_triple_prefix)
rocm.bindings.llvm.c.lto.lto_module_has_objc_category(mem, length)#

Return true if Buffer contains a bitcode file with ObjC code (category or class) in it.

Since:

LTO_API_VERSION=20

Args:
mem (Pointer/object):

(undocumented)

length (int):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_module_has_objc_category(const void * mem, size_t length)
rocm.bindings.llvm.c.lto.lto_module_is_object_file_in_memory(mem, length)#

Checks if a buffer is a loadable object file.

Since:

prior to LTO_API_VERSION=3

Args:
mem (Pointer/object):

(undocumented)

length (int):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_module_is_object_file_in_memory(const void * mem, size_t length)
rocm.bindings.llvm.c.lto.lto_module_is_object_file_in_memory_for_target(mem, length, target_triple_prefix)#

Checks if a buffer is a loadable object compiled for requested target.

Since:

prior to LTO_API_VERSION=3

Args:
mem (Pointer/object):

(undocumented)

length (int):

(undocumented)

target_triple_prefix (CStr/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_module_is_object_file_in_memory_for_target(const void * mem, size_t length, const char * target_triple_prefix)
rocm.bindings.llvm.c.lto.lto_module_create(path)#

Loads an object file from disk.

Returns NULL on error (check lto_get_error_message() for details).

Since:

prior to LTO_API_VERSION=3

Args:
path (CStr/object):

(undocumented)

Returns:

None: (undocumented)

C signature

lto_module_t lto_module_create(const char * path)
rocm.bindings.llvm.c.lto.lto_module_create_from_memory(mem, length)#

Loads an object file from memory.

Returns NULL on error (check lto_get_error_message() for details).

Since:

prior to LTO_API_VERSION=3

Args:
mem (Pointer/object):

(undocumented)

length (int):

(undocumented)

Returns:

None: (undocumented)

C signature

lto_module_t lto_module_create_from_memory(const void * mem, size_t length)
rocm.bindings.llvm.c.lto.lto_module_create_from_memory_with_path(mem, length, path)#

Loads an object file from memory with an extra path argument.

Returns NULL on error (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=9

Args:
mem (Pointer/object):

(undocumented)

length (int):

(undocumented)

path (CStr/object):

(undocumented)

Returns:

None: (undocumented)

C signature

lto_module_t lto_module_create_from_memory_with_path(const void * mem, size_t length, const char * path)
rocm.bindings.llvm.c.lto.lto_module_create_in_local_context(mem, length, path)#

Loads an object file in its own context.

Loads an object file in its own LLVMContext. This function call is thread-safe. However, modules created this way should not be merged into an lto_code_gen_t using lto_codegen_add_module().

Returns NULL on error (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=11

Args:
mem (Pointer/object):

(undocumented)

length (int):

(undocumented)

path (CStr/object):

(undocumented)

Returns:

None: (undocumented)

C signature

lto_module_t lto_module_create_in_local_context(const void * mem, size_t length, const char * path)
rocm.bindings.llvm.c.lto.lto_module_create_in_codegen_context(mem, length, path, cg)#

Loads an object file in the codegen context.

Loads an object file into the same context as cg. The module is safe to add using lto_codegen_add_module().

Returns NULL on error (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=11

Args:
mem (Pointer/object):

(undocumented)

length (int):

(undocumented)

path (CStr/object):

(undocumented)

cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

Returns:

None: (undocumented)

C signature

lto_module_t lto_module_create_in_codegen_context(const void * mem, size_t length, const char * path, lto_code_gen_t cg)
rocm.bindings.llvm.c.lto.lto_module_create_from_fd(fd, path, file_size)#

Loads an object file from disk.

The seek point of fd is not preserved. Returns NULL on error (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=5

Args:
fd (int):

(undocumented)

path (CStr/object):

(undocumented)

file_size (int):

(undocumented)

Returns:

None: (undocumented)

C signature

lto_module_t lto_module_create_from_fd(int fd, const char * path, size_t file_size)
rocm.bindings.llvm.c.lto.lto_module_create_from_fd_at_offset(fd, path, file_size, map_size, offset)#

Loads an object file from disk.

The seek point of fd is not preserved. Returns NULL on error (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=5

Args:
fd (int):

(undocumented)

path (CStr/object):

(undocumented)

file_size (int):

(undocumented)

map_size (int):

(undocumented)

offset (int):

(undocumented)

Returns:

None: (undocumented)

C signature

lto_module_t lto_module_create_from_fd_at_offset(int fd, const char * path, size_t file_size, size_t map_size, off_t offset)
rocm.bindings.llvm.c.lto.lto_module_dispose(mod)#

Frees all memory internally allocated by the module.

Upon return the lto_module_t is no longer valid.

Since:

prior to LTO_API_VERSION=3

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

C signature

void lto_module_dispose(lto_module_t mod)
rocm.bindings.llvm.c.lto.lto_module_get_target_triple(mod)#

Returns triple string which the object module was compiled under.

Since:

prior to LTO_API_VERSION=3

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * lto_module_get_target_triple(lto_module_t mod)
rocm.bindings.llvm.c.lto.lto_module_set_target_triple(mod, triple)#

Sets triple string with which the object will be codegened.

Since:

LTO_API_VERSION=4

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

triple (CStr/object):

(undocumented)

C signature

void lto_module_set_target_triple(lto_module_t mod, const char * triple)
rocm.bindings.llvm.c.lto.lto_module_get_num_symbols(mod)#

Returns the number of symbols in the object module.

Since:

prior to LTO_API_VERSION=3

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int lto_module_get_num_symbols(lto_module_t mod)
rocm.bindings.llvm.c.lto.lto_module_get_symbol_name(mod, index)#

Returns the name of the ith symbol in the object module.

Since:

prior to LTO_API_VERSION=3

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

index (int):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * lto_module_get_symbol_name(lto_module_t mod, unsigned int index)
rocm.bindings.llvm.c.lto.lto_module_get_symbol_attribute(mod, index)#

Returns the attributes of the ith symbol in the object module.

Since:

prior to LTO_API_VERSION=3

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

index (int):

(undocumented)

Returns:

lto_symbol_attributes: (undocumented)

C signature

lto_symbol_attributes lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index)
rocm.bindings.llvm.c.lto.lto_module_get_num_asm_undef_symbols(mod)#

Returns the number of asm undefined symbols in the object module.

Since:

prior to LTO_API_VERSION=30

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int lto_module_get_num_asm_undef_symbols(lto_module_t mod)
rocm.bindings.llvm.c.lto.lto_module_get_asm_undef_symbol_name(mod, index)#

Returns the name of the ith asm undefined symbol in the object module.

Since:

prior to LTO_API_VERSION=30

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

index (int):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * lto_module_get_asm_undef_symbol_name(lto_module_t mod, unsigned int index)
rocm.bindings.llvm.c.lto.lto_module_get_linkeropts(mod)#

Returns the module’s linker options.

The linker options may consist of multiple flags. It is the linker’s responsibility to split the flags using a platform-specific mechanism.

Since:

LTO_API_VERSION=16

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * lto_module_get_linkeropts(lto_module_t mod)
rocm.bindings.llvm.c.lto.lto_module_get_macho_cputype(mod, out_cputype, out_cpusubtype)#

If targeting mach-o on darwin, this function gets the CPU type and subtype that will end up being encoded in the mach-o header.

These are the values that can be found in mach/machine.h.

out_cputype and out_cpusubtype must be non-NULL.

Returns true on error (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=27

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

out_cputype (PointerToUnsigned/object):

(undocumented)

out_cpusubtype (PointerToUnsigned/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_module_get_macho_cputype(lto_module_t mod, unsigned int * out_cputype, unsigned int * out_cpusubtype)
rocm.bindings.llvm.c.lto.lto_module_has_ctor_dtor(mod)#

This function can be used by the linker to check if a given module has any constructor or destructor functions.

Returns true if the module has either the @llvm.global_ctors or the @llvm.global_dtors symbol. Otherwise returns false.

Since:

LTO_API_VERSION=29

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_module_has_ctor_dtor(lto_module_t mod)
class rocm.bindings.llvm.c.lto.lto_codegen_diagnostic_severity_t#

Bases: enum.IntEnum

Diagnostic severity.

Since:

LTO_API_VERSION=7

LTO_DS_ERROR: int#
LTO_DS_WARNING: int#
LTO_DS_REMARK: int#
LTO_DS_NOTE: int#
class rocm.bindings.llvm.c.lto.lto_diagnostic_handler_t(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Diagnostic handler type.

severity defines the severity. diag is the actual diagnostic. The diagnostic is not prefixed by any of severity keyword, e.g., ‘error: ‘. ctxt is used to pass the context set with the diagnostic handler.

Since:

LTO_API_VERSION=7

rocm.bindings.llvm.c.lto.lto_codegen_set_diagnostic_handler(arg0, arg1, arg2)#

Set a diagnostic handler and the related context (void *).

This is more general than lto_get_error_message, as the diagnostic handler can be called at anytime within lto.

Since:

LTO_API_VERSION=7

Args:
arg0 (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

arg1 (lto_diagnostic_handler_t/object):

(undocumented)

arg2 (Pointer/object):

(undocumented)

C signature

void lto_codegen_set_diagnostic_handler(lto_code_gen_t, lto_diagnostic_handler_t, void *)
rocm.bindings.llvm.c.lto.lto_codegen_create()#

Instantiates a code generator.

Returns NULL on error (check lto_get_error_message() for details).

All modules added using lto_codegen_add_module() must have been created in the same context as the codegen.

Since:

prior to LTO_API_VERSION=3

Returns:

None: (undocumented)

C signature

lto_code_gen_t lto_codegen_create()
rocm.bindings.llvm.c.lto.lto_codegen_create_in_local_context()#

Instantiate a code generator in its own context.

Instantiates a code generator in its own context. Modules added via a lto_codegen_add_module() must have all been created in the same context, using lto_module_create_in_codegen_context().

Since:

LTO_API_VERSION=11

Returns:

None: (undocumented)

C signature

lto_code_gen_t lto_codegen_create_in_local_context()
rocm.bindings.llvm.c.lto.lto_codegen_dispose(arg0)#

Frees all code generator and all memory it internally allocated.

Upon return the lto_code_gen_t is no longer valid.

Since:

prior to LTO_API_VERSION=3

Args:
arg0 (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

C signature

void lto_codegen_dispose(lto_code_gen_t)
rocm.bindings.llvm.c.lto.lto_codegen_add_module(cg, mod)#

Add an object module to the set of modules for which code will be generated.

Returns true on error (check lto_get_error_message() for details).

cg and mod must both be in the same context. See a lto_codegen_create_in_local_context() and a lto_module_create_in_codegen_context().

Since:

prior to LTO_API_VERSION=3

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

mod (LLVMOpaqueLTOModule/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod)
rocm.bindings.llvm.c.lto.lto_codegen_set_module(cg, mod)#

Sets the object module for code generation.

This will transfer the ownership of the module to the code generator.

cg and mod must both be in the same context.

Since:

LTO_API_VERSION=13

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

mod (LLVMOpaqueLTOModule/object):

(undocumented)

C signature

void lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod)
rocm.bindings.llvm.c.lto.lto_codegen_set_debug_model(cg, arg1)#

Sets if debug info should be generated.

Returns true on error (check lto_get_error_message() for details).

Since:

prior to LTO_API_VERSION=3

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

arg1 (lto_debug_model):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model)
rocm.bindings.llvm.c.lto.lto_codegen_set_pic_model(cg, arg1)#

Sets which PIC code model to generated.

Returns true on error (check lto_get_error_message() for details).

Since:

prior to LTO_API_VERSION=3

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

arg1 (lto_codegen_model):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model)
rocm.bindings.llvm.c.lto.lto_codegen_set_cpu(cg, cpu)#

Sets the cpu to generate code for.

Since:

LTO_API_VERSION=4

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

cpu (CStr/object):

(undocumented)

C signature

void lto_codegen_set_cpu(lto_code_gen_t cg, const char * cpu)
rocm.bindings.llvm.c.lto.lto_codegen_set_assembler_path(cg, path)#

Sets the location of the assembler tool to run.

If not set, libLTO will use gcc to invoke the assembler.

Since:

LTO_API_VERSION=3

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

path (CStr/object):

(undocumented)

C signature

void lto_codegen_set_assembler_path(lto_code_gen_t cg, const char * path)
rocm.bindings.llvm.c.lto.lto_codegen_set_assembler_args(cg, args, nargs)#

Sets extra arguments that libLTO should pass to the assembler.

Since:

LTO_API_VERSION=4

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

args (Pointer/object):

(undocumented)

nargs (int):

(undocumented)

C signature

void lto_codegen_set_assembler_args(lto_code_gen_t cg, const char ** args, int nargs)
rocm.bindings.llvm.c.lto.lto_codegen_add_must_preserve_symbol(cg, symbol)#

Adds to a list of all global symbols that must exist in the final generated code.

If a function is not listed there, it might be inlined into every usage and optimized away.

Since:

prior to LTO_API_VERSION=3

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

symbol (CStr/object):

(undocumented)

C signature

void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char * symbol)
rocm.bindings.llvm.c.lto.lto_codegen_write_merged_modules(cg, path)#

Writes a new object file at the specified path that contains the merged contents of all modules added so far.

Returns true on error (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=5

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

path (CStr/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_codegen_write_merged_modules(lto_code_gen_t cg, const char * path)
rocm.bindings.llvm.c.lto.lto_codegen_compile(cg, length)#

Generates code for all added modules into one native object file.

This calls lto_codegen_optimize then lto_codegen_compile_optimized.

On success returns a pointer to a generated mach-o/ELF buffer and length set to the buffer size. The buffer is owned by the lto_code_gen_t and will be freed when lto_codegen_dispose() is called, or lto_codegen_compile() is called again. On failure, returns NULL (check lto_get_error_message() for details).

Since:

prior to LTO_API_VERSION=3

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

length (PointerToUInt64/object):

(undocumented)

Returns:

None: (undocumented)

C signature

const void * lto_codegen_compile(lto_code_gen_t cg, size_t * length)
rocm.bindings.llvm.c.lto.lto_codegen_compile_to_file(cg, name)#

Generates code for all added modules into one native object file.

This calls lto_codegen_optimize then lto_codegen_compile_optimized (instead of returning a generated mach-o/ELF buffer, it writes to a file).

The name of the file is written to name. Returns true on error.

Since:

LTO_API_VERSION=5

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

name (Pointer/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_codegen_compile_to_file(lto_code_gen_t cg, const char ** name)
rocm.bindings.llvm.c.lto.lto_codegen_optimize(cg)#

Runs optimization for the merged module. Returns true on error.

Since:

LTO_API_VERSION=12

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_codegen_optimize(lto_code_gen_t cg)
rocm.bindings.llvm.c.lto.lto_codegen_compile_optimized(cg, length)#

Generates code for the optimized merged module into one native object file.

It will not run any IR optimizations on the merged module.

On success returns a pointer to a generated mach-o/ELF buffer and length set to the buffer size. The buffer is owned by the lto_code_gen_t and will be freed when lto_codegen_dispose() is called, or lto_codegen_compile_optimized() is called again. On failure, returns NULL (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=12

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

length (PointerToUInt64/object):

(undocumented)

Returns:

None: (undocumented)

C signature

const void * lto_codegen_compile_optimized(lto_code_gen_t cg, size_t * length)
rocm.bindings.llvm.c.lto.lto_api_version()#

Returns the runtime API version.

Since:

LTO_API_VERSION=12

Returns:

int: (undocumented)

C signature

unsigned int lto_api_version()
rocm.bindings.llvm.c.lto.lto_set_debug_options(options, number)#

Parses options immediately, making them available as early as possible.

For example during executing codegen::InitTargetOptionsFromCodeGenFlags. Since parsing shud only happen once, only one of lto_codegen_debug_options or lto_set_debug_options should be called.

This function takes one or more options separated by spaces. Warning: passing file paths through this function may confuse the argument parser if the paths contain spaces.

Since:

LTO_API_VERSION=28

Args:
options (Pointer/object):

(undocumented)

number (int):

(undocumented)

C signature

void lto_set_debug_options(const char *const * options, int number)
rocm.bindings.llvm.c.lto.lto_codegen_debug_options(cg, arg1)#

Sets options to help debug codegen bugs.

Since parsing shud only happen once, only one of lto_codegen_debug_options or lto_set_debug_options should be called.

This function takes one or more options separated by spaces. Warning: passing file paths through this function may confuse the argument parser if the paths contain spaces.

Since:

prior to LTO_API_VERSION=3

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

arg1 (CStr/object):

(undocumented)

C signature

void lto_codegen_debug_options(lto_code_gen_t cg, const char *)
rocm.bindings.llvm.c.lto.lto_codegen_debug_options_array(cg, arg1, number)#

Same as the previous function, but takes every option separately through an array.

Since:

prior to LTO_API_VERSION=26

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

arg1 (Pointer/object):

(undocumented)

number (int):

(undocumented)

C signature

void lto_codegen_debug_options_array(lto_code_gen_t cg, const char *const *, int number)
rocm.bindings.llvm.c.lto.lto_initialize_disassembler()#

Initializes LLVM disassemblers.

FIXME: This doesn’t really belong here.

Since:

LTO_API_VERSION=5

C signature

void lto_initialize_disassembler()
rocm.bindings.llvm.c.lto.lto_codegen_set_should_internalize(cg, ShouldInternalize)#

Sets if we should run internalize pass during optimization and code generation.

Since:

LTO_API_VERSION=14

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

ShouldInternalize (bint):

(undocumented)

C signature

void lto_codegen_set_should_internalize(lto_code_gen_t cg, lto_bool_t ShouldInternalize)
rocm.bindings.llvm.c.lto.lto_codegen_set_should_embed_uselists(cg, ShouldEmbedUselists)#

Set whether to embed uselists in bitcode.

Sets whether lto_codegen_write_merged_modules() should embed uselists in output bitcode. This should be turned on for all -save-temps output.

Since:

LTO_API_VERSION=15

Args:
cg (LLVMOpaqueLTOCodeGenerator/object):

(undocumented)

ShouldEmbedUselists (bint):

(undocumented)

C signature

void lto_codegen_set_should_embed_uselists(lto_code_gen_t cg, lto_bool_t ShouldEmbedUselists)
class rocm.bindings.llvm.c.lto.LLVMOpaqueLTOInput(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.lto.lto_input_t#
rocm.bindings.llvm.c.lto.lto_input_create(buffer, buffer_size, path)#

Creates an LTO input file from a buffer.

The path argument is used for diagnotics as this function otherwise does not know which file the given buffer is associated with.

Since:

LTO_API_VERSION=24

Args:
buffer (Pointer/object):

(undocumented)

buffer_size (int):

(undocumented)

path (CStr/object):

(undocumented)

Returns:

None: (undocumented)

C signature

lto_input_t lto_input_create(const void * buffer, size_t buffer_size, const char * path)
rocm.bindings.llvm.c.lto.lto_input_dispose(input)#

Frees all memory internally allocated by the LTO input file.

Upon return the lto_module_t is no longer valid.

Since:

LTO_API_VERSION=24

Args:
input (LLVMOpaqueLTOInput/object):

(undocumented)

C signature

void lto_input_dispose(lto_input_t input)
rocm.bindings.llvm.c.lto.lto_input_get_num_dependent_libraries(input)#

Returns the number of dependent library specifiers for the given LTO input file.

Since:

LTO_API_VERSION=24

Args:
input (LLVMOpaqueLTOInput/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int lto_input_get_num_dependent_libraries(lto_input_t input)
rocm.bindings.llvm.c.lto.lto_input_get_dependent_library(input, index, size)#

Returns the ith dependent library specifier for the given LTO input file.

The returned string is not null-terminated.

Since:

LTO_API_VERSION=24

Args:
input (LLVMOpaqueLTOInput/object):

(undocumented)

index (int):

(undocumented)

size (PointerToUInt64/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * lto_input_get_dependent_library(lto_input_t input, size_t index, size_t * size)
rocm.bindings.llvm.c.lto.lto_runtime_lib_symbols_list(size)#

Returns the list of libcall symbols that can be generated by LTO that might not be visible from the symbol table of bitcode files.

Since:

prior to LTO_API_VERSION=25

Args:
size (PointerToUInt64/object):

(undocumented)

Returns:

None: (undocumented)

C signature

const char *const * lto_runtime_lib_symbols_list(size_t * size)
class rocm.bindings.llvm.c.lto.LTOObjectBuffer(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

Type to wrap a single object returned by ThinLTO.

Since:

LTO_API_VERSION=18

Buffer: Any#
Size: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
rocm.bindings.llvm.c.lto.thinlto_create_codegen()#

Instantiates a ThinLTO code generator.

Returns NULL on error (check lto_get_error_message() for details).

The ThinLTOCodeGenerator is not intended to be reuse for multiple compilation: the model is that the client adds modules to the generator and ask to perform the ThinLTO optimizations / codegen, and finally destroys the codegenerator.

Since:

LTO_API_VERSION=18

Returns:

None: (undocumented)

C signature

thinlto_code_gen_t thinlto_create_codegen()
rocm.bindings.llvm.c.lto.thinlto_codegen_dispose(cg)#

Frees the generator and all memory it internally allocated.

Upon return the thinlto_code_gen_t is no longer valid.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

C signature

void thinlto_codegen_dispose(thinlto_code_gen_t cg)
rocm.bindings.llvm.c.lto.thinlto_codegen_add_module(cg, identifier, data, length)#

Add a module to a ThinLTO code generator.

Identifier has to be unique among all the modules in a code generator. The data buffer stays owned by the client, and is expected to be available for the entire lifetime of the thinlto_code_gen_t it is added to.

On failure, returns NULL (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

identifier (CStr/object):

(undocumented)

data (CStr/object):

(undocumented)

length (int):

(undocumented)

C signature

void thinlto_codegen_add_module(thinlto_code_gen_t cg, const char * identifier, const char * data, int length)
rocm.bindings.llvm.c.lto.thinlto_codegen_process(cg)#

Optimize and codegen all the modules added to the codegenerator using ThinLTO.

Resulting objects are accessible using thinlto_module_get_object().

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

C signature

void thinlto_codegen_process(thinlto_code_gen_t cg)
rocm.bindings.llvm.c.lto.thinlto_module_get_num_objects(cg)#

Returns the number of object files produced by the ThinLTO CodeGenerator.

It usually matches the number of input files, but this is not a guarantee of the API and may change in future implementation, so the client should not assume it.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg)
rocm.bindings.llvm.c.lto.thinlto_module_get_object(cg, index)#

Returns a reference to the ith object file produced by the ThinLTO CodeGenerator.

Client should use thinlto_module_get_num_objects() to get the number of available objects.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

index (int):

(undocumented)

Returns:

LTOObjectBuffer: (undocumented)

C signature

LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg, unsigned int index)
rocm.bindings.llvm.c.lto.thinlto_module_get_num_object_files(cg)#

Returns the number of object files produced by the ThinLTO CodeGenerator.

It usually matches the number of input files, but this is not a guarantee of the API and may change in future implementation, so the client should not assume it.

Since:

LTO_API_VERSION=21

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int thinlto_module_get_num_object_files(thinlto_code_gen_t cg)
rocm.bindings.llvm.c.lto.thinlto_module_get_object_file(cg, index)#

Returns the path to the ith object file produced by the ThinLTO CodeGenerator.

Client should use thinlto_module_get_num_object_files() to get the number of available objects.

Since:

LTO_API_VERSION=21

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

index (int):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * thinlto_module_get_object_file(thinlto_code_gen_t cg, unsigned int index)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_pic_model(cg, arg1)#

Sets which PIC code model to generate.

Returns true on error (check lto_get_error_message() for details).

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

arg1 (lto_codegen_model):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg, lto_codegen_model)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_savetemps_dir(cg, save_temps_dir)#

Sets the path to a directory to use as a storage for temporary bitcode files.

The intention is to make the bitcode files available for debugging at various stage of the pipeline.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

save_temps_dir (CStr/object):

(undocumented)

C signature

void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg, const char * save_temps_dir)
rocm.bindings.llvm.c.lto.thinlto_set_generated_objects_dir(cg, save_temps_dir)#

Set the path to a directory where to save generated object files.

This path can be used by a linker to request on-disk files instead of in-memory buffers. When set, results are available through thinlto_module_get_object_file() instead of thinlto_module_get_object().

Since:

LTO_API_VERSION=21

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

save_temps_dir (CStr/object):

(undocumented)

C signature

void thinlto_set_generated_objects_dir(thinlto_code_gen_t cg, const char * save_temps_dir)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_cpu(cg, cpu)#

Sets the cpu to generate code for.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

cpu (CStr/object):

(undocumented)

C signature

void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char * cpu)
rocm.bindings.llvm.c.lto.thinlto_codegen_disable_codegen(cg, disable)#

Disable CodeGen, only run the stages till codegen and stop.

The output will be bitcode.

Since:

LTO_API_VERSION=19

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

disable (bint):

(undocumented)

C signature

void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg, lto_bool_t disable)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_codegen_only(cg, codegen_only)#

Perform CodeGen only: disable all other stages.

Since:

LTO_API_VERSION=19

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

codegen_only (bint):

(undocumented)

C signature

void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg, lto_bool_t codegen_only)
rocm.bindings.llvm.c.lto.thinlto_debug_options(options, number)#

Parse -mllvm style debug options.

Since:

LTO_API_VERSION=18

Args:
options (Pointer/object):

(undocumented)

number (int):

(undocumented)

C signature

void thinlto_debug_options(const char *const * options, int number)
rocm.bindings.llvm.c.lto.lto_module_is_thinlto(mod)#

Test if a module has support for ThinLTO linking.

Since:

LTO_API_VERSION=18

Args:
mod (LLVMOpaqueLTOModule/object):

(undocumented)

Returns:

bool: (undocumented)

C signature

lto_bool_t lto_module_is_thinlto(lto_module_t mod)
rocm.bindings.llvm.c.lto.thinlto_codegen_add_must_preserve_symbol(cg, name, length)#

Adds a symbol to the list of global symbols that must exist in the final generated code.

If a function is not listed there, it might be inlined into every usage and optimized away. For every single module, the functions referenced from code outside of the ThinLTO modules need to be added here.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

name (CStr/object):

(undocumented)

length (int):

(undocumented)

C signature

void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg, const char * name, int length)
rocm.bindings.llvm.c.lto.thinlto_codegen_add_cross_referenced_symbol(cg, name, length)#

Adds a symbol to the list of global symbols that are cross-referenced between ThinLTO files.

If the ThinLTO CodeGenerator can ensure that every references from a ThinLTO module to this symbol is optimized away, then the symbol can be discarded.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

name (CStr/object):

(undocumented)

length (int):

(undocumented)

C signature

void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg, const char * name, int length)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_cache_dir(cg, cache_dir)#

Sets the path to a directory to use as a cache storage for incremental build.

Setting this activates caching.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

cache_dir (CStr/object):

(undocumented)

C signature

void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg, const char * cache_dir)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_cache_pruning_interval(cg, interval)#

Sets the cache pruning interval (in seconds).

A negative value disables the pruning. An unspecified default value will be applied, and a value of 0 will force prunning to occur.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

interval (int):

(undocumented)

C signature

void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg, int interval)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_final_cache_size_relative_to_available_space(cg, percentage)#

Sets the maximum cache size that can be persistent across build, in terms of percentage of the available space on the disk.

Set to 100 to indicate no limit, 50 to indicate that the cache size will not be left over half the available space. A value over 100 will be reduced to 100, a value of 0 will be ignored. An unspecified default value will be applied.

The formula looks like:

AvailableSpace = FreeSpace + ExistingCacheSize NewCacheSize = AvailableSpace * P/100

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

percentage (int):

(undocumented)

C signature

void thinlto_codegen_set_final_cache_size_relative_to_available_space(thinlto_code_gen_t cg, unsigned int percentage)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_cache_entry_expiration(cg, expiration)#

Sets the expiration (in seconds) for an entry in the cache.

An unspecified default value will be applied. A value of 0 will be ignored.

Since:

LTO_API_VERSION=18

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

expiration (int):

(undocumented)

C signature

void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg, unsigned int expiration)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_cache_size_bytes(cg, max_size_bytes)#

Sets the maximum size of the cache directory (in bytes).

A value over the amount of available space on the disk will be reduced to the amount of available space. An unspecified default value will be applied. A value of 0 will be ignored.

Since:

LTO_API_VERSION=22

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

max_size_bytes (int):

(undocumented)

C signature

void thinlto_codegen_set_cache_size_bytes(thinlto_code_gen_t cg, unsigned int max_size_bytes)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_cache_size_megabytes(cg, max_size_megabytes)#

Same as thinlto_codegen_set_cache_size_bytes, except the maximum size is in megabytes (2^20 bytes).

Since:

LTO_API_VERSION=23

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

max_size_megabytes (int):

(undocumented)

C signature

void thinlto_codegen_set_cache_size_megabytes(thinlto_code_gen_t cg, unsigned int max_size_megabytes)
rocm.bindings.llvm.c.lto.thinlto_codegen_set_cache_size_files(cg, max_size_files)#

Sets the maximum number of files in the cache directory.

An unspecified default value will be applied. A value of 0 will be ignored.

Since:

LTO_API_VERSION=22

Args:
cg (LLVMOpaqueThinLTOCodeGenerator/object):

(undocumented)

max_size_files (int):

(undocumented)

C signature

void thinlto_codegen_set_cache_size_files(thinlto_code_gen_t cg, unsigned int max_size_files)