LLVM 20.0.0git
|
A utility class for building TargetMachines for JITs. More...
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
Static Public Member Functions | |
static Expected< JITTargetMachineBuilder > | detectHost () |
Create a JITTargetMachineBuilder for the host system. | |
Friends | |
class | JITTargetMachineBuilderPrinter |
A utility class for building TargetMachines for JITs.
Definition at line 34 of file JITTargetMachineBuilder.h.
llvm::orc::JITTargetMachineBuilder::JITTargetMachineBuilder | ( | Triple | TT | ) |
Create a JITTargetMachineBuilder based on the given triple.
Note: TargetOptions is default-constructed, then EmulatedTLS is set to true. If EmulatedTLS is not required, these values should be reset before calling createTargetMachine.
Definition at line 18 of file JITTargetMachineBuilder.cpp.
References llvm::TargetOptions::EmulatedTLS, and llvm::TargetOptions::UseInitArray.
JITTargetMachineBuilder & llvm::orc::JITTargetMachineBuilder::addFeatures | ( | const std::vector< std::string > & | FeatureVec | ) |
Add subtarget features.
Definition at line 60 of file JITTargetMachineBuilder.cpp.
References llvm::SubtargetFeatures::AddFeature(), and F.
Expected< std::unique_ptr< TargetMachine > > llvm::orc::JITTargetMachineBuilder::createTargetMachine | ( | ) |
Create a TargetMachine.
This operation will fail if the requested target is not registered, in which case see llvm/Support/TargetSelect.h. To JIT IR the Target and the target's AsmPrinter must both be registered. To JIT assembly (including inline and module level assembly) the target's AsmParser must also be registered.
Definition at line 39 of file JITTargetMachineBuilder.cpp.
References llvm::SubtargetFeatures::getString(), llvm::Triple::getTriple(), llvm::inconvertibleErrorCode(), and llvm::TargetRegistry::lookupTarget().
Referenced by llvm::orc::LLJIT::createCompileFunction(), getDefaultDataLayoutForTarget(), and llvm::orc::ConcurrentIRCompiler::operator()().
|
static |
Create a JITTargetMachineBuilder for the host system.
Note: TargetOptions is default-constructed, then EmulatedTLS is set to true. If EmulatedTLS is not required, these values should be reset before calling createTargetMachine.
Definition at line 24 of file JITTargetMachineBuilder.cpp.
References llvm::SubtargetFeatures::AddFeature(), getFeatures(), llvm::sys::getHostCPUFeatures(), llvm::sys::getHostCPUName(), llvm::sys::getProcessTriple(), and setCPU().
Referenced by LLVMOrcJITTargetMachineBuilderDetectHost(), and llvm::orc::LLJITBuilderState::prepareForConstruction().
|
inline |
Get the code model.
Definition at line 99 of file JITTargetMachineBuilder.h.
|
inline |
Returns the CPU string.
Definition at line 81 of file JITTargetMachineBuilder.h.
|
inline |
Get the default DataLayout for the target.
Note: This is reasonably expensive, as it creates a temporary TargetMachine instance under the hood. It is only suitable for use during JIT setup.
Definition at line 67 of file JITTargetMachineBuilder.h.
References createTargetMachine().
|
inline |
Access subtarget features.
Definition at line 118 of file JITTargetMachineBuilder.h.
Referenced by detectHost().
|
inline |
Access subtarget features.
Definition at line 121 of file JITTargetMachineBuilder.h.
|
inline |
|
inline |
|
inline |
Get the relocation model.
Definition at line 90 of file JITTargetMachineBuilder.h.
|
inline |
Access Triple.
Definition at line 141 of file JITTargetMachineBuilder.h.
Access Triple.
Definition at line 144 of file JITTargetMachineBuilder.h.
|
inline |
Set the LLVM CodeGen optimization level.
Definition at line 102 of file JITTargetMachineBuilder.h.
|
inline |
Set the code model.
Definition at line 93 of file JITTargetMachineBuilder.h.
|
inline |
Set the CPU string.
Definition at line 75 of file JITTargetMachineBuilder.h.
Referenced by detectHost().
|
inline |
Set subtarget features.
Definition at line 108 of file JITTargetMachineBuilder.h.
|
inline |
Set TargetOptions.
Note: This operation will overwrite any previously configured options, including EmulatedTLS and UseInitArray which the JITTargetMachineBuilder sets by default. Clients are responsible for re-enabling these overwritten options.
Definition at line 129 of file JITTargetMachineBuilder.h.
References Options.
|
inline |
Set the relocation model.
Definition at line 84 of file JITTargetMachineBuilder.h.
|
friend |
Definition at line 36 of file JITTargetMachineBuilder.h.