rocm.bindings.llvm.c.targetmachine#
2026-09-24
14 min read time
Advanced Micro Devices, Inc.
Attributes#
Classes#
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
Functions#
|
|
Returns the first llvm::Target in the registered targets list. |
|
Returns the next llvm::Target given a previous one (or null if there's none) |
|
|
Finds the target corresponding to the given name and stores it in |
|
Finds the target corresponding to the given triple and stores it in |
Returns the name of a target. See llvm::Target::getName |
|
Returns the description of a target. See llvm::Target::getDescription |
|
Returns if the target has a JIT |
|
Returns if the target has a TargetMachine associated |
|
Returns if the target as an ASM backend (required for emitting output) |
|
Create a new set of options for an llvm::TargetMachine. |
|
|
Dispose of an LLVMTargetMachineOptionsRef instance. |
|
Dispose of an LLVMTargetMachineOptionsRef instance. |
|
Set the list of features for the target machine. |
|
Set the list of features for the target machine. |
|
Set the list of features for the target machine. |
|
Set the list of features for the target machine. |
|
Set the list of features for the target machine. |
|
Create a new llvm::TargetMachine. |
|
Creates a new llvm::TargetMachine. See llvm::Target::createTargetMachine |
Dispose the LLVMTargetMachineRef instance generated by |
|
Returns the Target used in a TargetMachine |
|
Returns the triple used creating this target machine. |
|
Returns the cpu used creating this target machine. |
|
Returns the feature string used creating this target machine. |
|
Create a DataLayout based on the targetMachine. |
|
|
Set the target machine's ASM verbosity. |
|
Enable fast-path instruction selection. |
|
Enable global instruction selection. |
|
Set abort behaviour when global instruction selection fails to lower/select |
|
Enable the MachineOutliner pass. |
|
Emits an asm or object file for the given module to the filename. |
|
Compile the LLVM IR stored in |
Get a triple for the host machine as a string. |
|
|
Normalize a target triple. |
Get the host CPU as a string. |
|
Get the host CPU's features as a string. |
|
|
Adds the target-specific analysis passes to the pass manager. |
Module Contents#
- class rocm.bindings.llvm.c.targetmachine.LLVMOpaqueTargetMachineOptions(*args, **kwargs)#
Bases:
rocm.bindings.util.types.Pointer(No short description)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineOptionsRef#
- class rocm.bindings.llvm.c.targetmachine.LLVMOpaqueTargetMachine(*args, **kwargs)#
Bases:
rocm.bindings.util.types.Pointer(No short description)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineRef#
- class rocm.bindings.llvm.c.targetmachine.LLVMTarget(*args, **kwargs)#
Bases:
rocm.bindings.util.types.Pointer(No short description)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetRef#
- class rocm.bindings.llvm.c.targetmachine.LLVMCodeGenOptLevel#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.llvm.c.targetmachine.LLVMRelocMode#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.llvm.c.targetmachine.LLVMCodeModel#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.llvm.c.targetmachine.LLVMCodeGenFileType#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.llvm.c.targetmachine.LLVMGlobalISelAbortMode#
Bases:
enum.IntEnum(No short description)
- rocm.bindings.llvm.c.targetmachine.LLVMGetFirstTarget()#
Returns the first llvm::Target in the registered targets list.
- Returns:
None: (undocumented)
C signature
LLVMTargetRef LLVMGetFirstTarget()
- rocm.bindings.llvm.c.targetmachine.LLVMGetNextTarget(T)#
Returns the next llvm::Target given a previous one (or null if there’s none)
- Args:
- T (
LLVMTarget/object): (undocumented)
- T (
- Returns:
None: (undocumented)
C signature
LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMGetTargetFromName(Name)#
Finds the target corresponding to the given name and stores it in
T.Returns 0 on success.C signature
LLVMTargetRef LLVMGetTargetFromName(const char * Name)
- rocm.bindings.llvm.c.targetmachine.LLVMGetTargetFromTriple(Triple)#
Finds the target corresponding to the given triple and stores it in
T.Returns 0 on success.Optionally returns any error in ErrorMessage. Use LLVMDisposeMessage to dispose the message.
- Args:
- Returns:
A
tupleof size 3 that contains (in that order):int: (undocumented)- T (
LLVMTarget): (undocumented)
- T (
C signature
LLVMBool LLVMGetTargetFromTriple(const char * Triple, LLVMTargetRef * T, char ** ErrorMessage)
- rocm.bindings.llvm.c.targetmachine.LLVMGetTargetName(T)#
Returns the name of a target. See llvm::Target::getName
- Args:
- T (
LLVMTarget/object): (undocumented)
- T (
- Returns:
bytes: (undocumented)
C signature
const char * LLVMGetTargetName(LLVMTargetRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMGetTargetDescription(T)#
Returns the description of a target. See llvm::Target::getDescription
- Args:
- T (
LLVMTarget/object): (undocumented)
- T (
- Returns:
bytes: (undocumented)
C signature
const char * LLVMGetTargetDescription(LLVMTargetRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetHasJIT(T)#
Returns if the target has a JIT
- Args:
- T (
LLVMTarget/object): (undocumented)
- T (
- Returns:
int: (undocumented)
C signature
LLVMBool LLVMTargetHasJIT(LLVMTargetRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetHasTargetMachine(T)#
Returns if the target has a TargetMachine associated
- Args:
- T (
LLVMTarget/object): (undocumented)
- T (
- Returns:
int: (undocumented)
C signature
LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetHasAsmBackend(T)#
Returns if the target as an ASM backend (required for emitting output)
- Args:
- T (
LLVMTarget/object): (undocumented)
- T (
- Returns:
int: (undocumented)
C signature
LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMCreateTargetMachineOptions()#
Create a new set of options for an llvm::TargetMachine.
The returned option structure must be released with LLVMDisposeTargetMachineOptions() after the call to LLVMCreateTargetMachineWithOptions().
- Returns:
None: (undocumented)
C signature
LLVMTargetMachineOptionsRef LLVMCreateTargetMachineOptions()
- rocm.bindings.llvm.c.targetmachine.LLVMDisposeTargetMachineOptions(Options)#
Dispose of an LLVMTargetMachineOptionsRef instance.
- Args:
- Options (
LLVMOpaqueTargetMachineOptions/object): (undocumented)
- Options (
C signature
void LLVMDisposeTargetMachineOptions(LLVMTargetMachineOptionsRef Options)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineOptionsSetCPU(Options, CPU)#
Dispose of an LLVMTargetMachineOptionsRef instance.
- Args:
- Options (
LLVMOpaqueTargetMachineOptions/object): (undocumented)
- CPU (
CStr/object): (undocumented)
- Options (
C signature
void LLVMTargetMachineOptionsSetCPU(LLVMTargetMachineOptionsRef Options, const char * CPU)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineOptionsSetFeatures(Options, Features)#
Set the list of features for the target machine.
- Args:
- Options (
LLVMOpaqueTargetMachineOptions/object): (undocumented)
- Features (
CStr/object): a comma-separated list of features.
- Options (
C signature
void LLVMTargetMachineOptionsSetFeatures(LLVMTargetMachineOptionsRef Options, const char * Features)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineOptionsSetABI(Options, ABI)#
Set the list of features for the target machine.
- Args:
- Options (
LLVMOpaqueTargetMachineOptions/object): (undocumented)
- ABI (
CStr/object): (undocumented)
- Options (
C signature
void LLVMTargetMachineOptionsSetABI(LLVMTargetMachineOptionsRef Options, const char * ABI)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineOptionsSetCodeGenOptLevel(Options, Level)#
Set the list of features for the target machine.
- Args:
- Options (
LLVMOpaqueTargetMachineOptions/object): (undocumented)
- Level (
LLVMCodeGenOptLevel): (undocumented)
- Options (
C signature
void LLVMTargetMachineOptionsSetCodeGenOptLevel(LLVMTargetMachineOptionsRef Options, LLVMCodeGenOptLevel Level)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineOptionsSetRelocMode(Options, Reloc)#
Set the list of features for the target machine.
- Args:
- Options (
LLVMOpaqueTargetMachineOptions/object): (undocumented)
- Reloc (
LLVMRelocMode): (undocumented)
- Options (
C signature
void LLVMTargetMachineOptionsSetRelocMode(LLVMTargetMachineOptionsRef Options, LLVMRelocMode Reloc)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineOptionsSetCodeModel(Options, CodeModel)#
Set the list of features for the target machine.
- Args:
- Options (
LLVMOpaqueTargetMachineOptions/object): (undocumented)
- CodeModel (
LLVMCodeModel): (undocumented)
- Options (
C signature
void LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options, LLVMCodeModel CodeModel)
- rocm.bindings.llvm.c.targetmachine.LLVMCreateTargetMachineWithOptions(T, Triple, Options)#
Create a new llvm::TargetMachine.
- Args:
- T (
LLVMTarget/object): the target to create a machine for.
- Triple (
CStr/object): a triple describing the target machine.
- Options (
LLVMOpaqueTargetMachineOptions/object): additional configuration (see LLVMCreateTargetMachineOptions()).
- T (
- Returns:
None: (undocumented)
C signature
LLVMTargetMachineRef LLVMCreateTargetMachineWithOptions(LLVMTargetRef T, const char * Triple, LLVMTargetMachineOptionsRef Options)
- rocm.bindings.llvm.c.targetmachine.LLVMCreateTargetMachine(T, Triple, CPU, Features, Level, Reloc, CodeModel)#
Creates a new llvm::TargetMachine. See llvm::Target::createTargetMachine
- Args:
- T (
LLVMTarget/object): (undocumented)
- Triple (
CStr/object): (undocumented)
- CPU (
CStr/object): (undocumented)
- Features (
CStr/object): (undocumented)
- Level (
LLVMCodeGenOptLevel): (undocumented)
- Reloc (
LLVMRelocMode): (undocumented)
- CodeModel (
LLVMCodeModel): (undocumented)
- T (
- Returns:
None: (undocumented)
C signature
LLVMTargetMachineRef LLVMCreateTargetMachine(LLVMTargetRef T, const char * Triple, const char * CPU, const char * Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc, LLVMCodeModel CodeModel)
- rocm.bindings.llvm.c.targetmachine.LLVMDisposeTargetMachine(T)#
Dispose the LLVMTargetMachineRef instance generated by LLVMCreateTargetMachine.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- T (
C signature
void LLVMDisposeTargetMachine(LLVMTargetMachineRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMGetTargetMachineTarget(T)#
Returns the Target used in a TargetMachine
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- T (
- Returns:
None: (undocumented)
C signature
LLVMTargetRef LLVMGetTargetMachineTarget(LLVMTargetMachineRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMGetTargetMachineTriple(T)#
Returns the triple used creating this target machine.
See llvm::TargetMachine::getTriple. The result needs to be disposed with LLVMDisposeMessage.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- T (
- Returns:
bytes: (undocumented)
C signature
char * LLVMGetTargetMachineTriple(LLVMTargetMachineRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMGetTargetMachineCPU(T)#
Returns the cpu used creating this target machine.
See llvm::TargetMachine::getCPU. The result needs to be disposed with LLVMDisposeMessage.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- T (
- Returns:
bytes: (undocumented)
C signature
char * LLVMGetTargetMachineCPU(LLVMTargetMachineRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMGetTargetMachineFeatureString(T)#
Returns the feature string used creating this target machine.
See llvm::TargetMachine::getFeatureString. The result needs to be disposed with LLVMDisposeMessage.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- T (
- Returns:
bytes: (undocumented)
C signature
char * LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMCreateTargetDataLayout(T)#
Create a DataLayout based on the targetMachine.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- T (
- Returns:
None: (undocumented)
C signature
LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T)
- rocm.bindings.llvm.c.targetmachine.LLVMSetTargetMachineAsmVerbosity(T, VerboseAsm)#
Set the target machine’s ASM verbosity.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- VerboseAsm (
int): (undocumented)
- T (
C signature
void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T, LLVMBool VerboseAsm)
- rocm.bindings.llvm.c.targetmachine.LLVMSetTargetMachineFastISel(T, Enable)#
Enable fast-path instruction selection.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- Enable (
int): (undocumented)
- T (
C signature
void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable)
- rocm.bindings.llvm.c.targetmachine.LLVMSetTargetMachineGlobalISel(T, Enable)#
Enable global instruction selection.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- Enable (
int): (undocumented)
- T (
C signature
void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable)
- rocm.bindings.llvm.c.targetmachine.LLVMSetTargetMachineGlobalISelAbort(T, Mode)#
Set abort behaviour when global instruction selection fails to lower/select an instruction.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- Mode (
LLVMGlobalISelAbortMode): (undocumented)
- T (
C signature
void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T, LLVMGlobalISelAbortMode Mode)
- rocm.bindings.llvm.c.targetmachine.LLVMSetTargetMachineMachineOutliner(T, Enable)#
Enable the MachineOutliner pass.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- Enable (
int): (undocumented)
- T (
C signature
void LLVMSetTargetMachineMachineOutliner(LLVMTargetMachineRef T, LLVMBool Enable)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineEmitToFile(T, M, Filename, codegen, ErrorMessage)#
Emits an asm or object file for the given module to the filename.
This wraps several c++ only classes (among them a file stream). Returns any error in ErrorMessage. Use LLVMDisposeMessage to dispose the message.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- M (
Pointer/object): (undocumented)
- Filename (
CStr/object): (undocumented)
- codegen (
LLVMCodeGenFileType): (undocumented)
- ErrorMessage (
Pointer/object): (undocumented)
- T (
- Returns:
int: (undocumented)
C signature
LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, const char * Filename, LLVMCodeGenFileType codegen, char ** ErrorMessage)
- rocm.bindings.llvm.c.targetmachine.LLVMTargetMachineEmitToMemoryBuffer(T, M, codegen, ErrorMessage, OutMemBuf)#
Compile the LLVM IR stored in
Mand store the result inOutMemBuf.- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- M (
Pointer/object): (undocumented)
- codegen (
LLVMCodeGenFileType): (undocumented)
- ErrorMessage (
Pointer/object): (undocumented)
- OutMemBuf (
Pointer/object): (undocumented)
- T (
- Returns:
int: (undocumented)
C signature
LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M, LLVMCodeGenFileType codegen, char ** ErrorMessage, LLVMMemoryBufferRef * OutMemBuf)
- rocm.bindings.llvm.c.targetmachine.LLVMGetDefaultTargetTriple()#
Get a triple for the host machine as a string.
The result needs to be disposed with LLVMDisposeMessage.
- Returns:
bytes: (undocumented)
C signature
char * LLVMGetDefaultTargetTriple()
- rocm.bindings.llvm.c.targetmachine.LLVMNormalizeTargetTriple(triple)#
Normalize a target triple.
The result needs to be disposed with LLVMDisposeMessage.
C signature
char * LLVMNormalizeTargetTriple(const char * triple)
- rocm.bindings.llvm.c.targetmachine.LLVMGetHostCPUName()#
Get the host CPU as a string.
The result needs to be disposed with LLVMDisposeMessage.
- Returns:
bytes: (undocumented)
C signature
char * LLVMGetHostCPUName()
- rocm.bindings.llvm.c.targetmachine.LLVMGetHostCPUFeatures()#
Get the host CPU’s features as a string.
The result needs to be disposed with LLVMDisposeMessage.
- Returns:
bytes: (undocumented)
C signature
char * LLVMGetHostCPUFeatures()
- rocm.bindings.llvm.c.targetmachine.LLVMAddAnalysisPasses(T, PM)#
Adds the target-specific analysis passes to the pass manager.
- Args:
- T (
LLVMOpaqueTargetMachine/object): (undocumented)
- PM (
Pointer/object): (undocumented)
- T (
C signature
void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM)