LLVM 22.0.0git
|
Primary interface to the complete machine description for the target machine. More...
#include "llvm/Target/TargetMachine.h"
Public Member Functions | |
TargetMachine (const TargetMachine &)=delete | |
void | operator= (const TargetMachine &)=delete |
virtual | ~TargetMachine () |
const Target & | getTarget () const |
const Triple & | getTargetTriple () const |
StringRef | getTargetCPU () const |
StringRef | getTargetFeatureString () const |
void | setTargetFeatureString (StringRef FS) |
virtual const TargetSubtargetInfo * | getSubtargetImpl (const Function &) const |
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInfo-derived member variable. | |
virtual TargetLoweringObjectFile * | getObjFileLowering () const |
virtual MachineFunctionInfo * | createMachineFunctionInfo (BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const |
Create the target's instance of MachineFunctionInfo. | |
virtual ScheduleDAGInstrs * | createMachineScheduler (MachineSchedContext *C) const |
Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this function and target at the current optimization level. | |
virtual ScheduleDAGInstrs * | createPostMachineScheduler (MachineSchedContext *C) const |
Similar to createMachineScheduler but used when postRA machine scheduling is enabled. | |
virtual yaml::MachineFunctionInfo * | createDefaultFuncInfoYAML () const |
Allocate and return a default initialized instance of the YAML representation for the MachineFunctionInfo. | |
virtual yaml::MachineFunctionInfo * | convertFuncInfoToYAML (const MachineFunction &MF) const |
Allocate and initialize an instance of the YAML representation of the MachineFunctionInfo. | |
virtual bool | parseMachineFunctionInfo (const yaml::MachineFunctionInfo &, PerFunctionMIParsingState &PFS, SMDiagnostic &Error, SMRange &SourceRange) const |
Parse out the target's MachineFunctionInfo from the YAML reprsentation. | |
template<typename STC > | |
const STC & | getSubtarget (const Function &F) const |
This method returns a pointer to the specified type of TargetSubtargetInfo. | |
const DataLayout | createDataLayout () const |
Create a DataLayout. | |
bool | isCompatibleDataLayout (const DataLayout &Candidate) const |
Test if a DataLayout if compatible with the CodeGen for this target. | |
unsigned | getPointerSize (unsigned AS) const |
Get the pointer size for this target. | |
unsigned | getPointerSizeInBits (unsigned AS) const |
unsigned | getProgramPointerSize () const |
unsigned | getAllocaPointerSize () const |
void | resetTargetOptions (const Function &F) const |
Reset the target options based on the function's attributes. | |
const MCAsmInfo * | getMCAsmInfo () const |
Return target specific asm information. | |
const MCRegisterInfo * | getMCRegisterInfo () const |
const MCInstrInfo * | getMCInstrInfo () const |
const MCSubtargetInfo * | getMCSubtargetInfo () const |
ExceptionHandling | getExceptionModel () const |
Return the ExceptionHandling to use, considering TargetOptions and the Triple's default. | |
bool | requiresStructuredCFG () const |
void | setRequiresStructuredCFG (bool Value) |
Reloc::Model | getRelocationModel () const |
Returns the code generation relocation model. | |
CodeModel::Model | getCodeModel () const |
Returns the code model. | |
uint64_t | getMaxCodeSize () const |
Returns the maximum code size possible under the code model. | |
void | setCodeModel (CodeModel::Model CM) |
Set the code model. | |
void | setLargeDataThreshold (uint64_t LDT) |
bool | isLargeGlobalValue (const GlobalValue *GV) const |
bool | isPositionIndependent () const |
bool | shouldAssumeDSOLocal (const GlobalValue *GV) const |
bool | useEmulatedTLS () const |
Returns true if this target uses emulated TLS. | |
bool | useTLSDESC () const |
Returns true if this target uses TLS Descriptors. | |
TLSModel::Model | getTLSModel (const GlobalValue *GV) const |
Returns the TLS model which should be used for the given global variable. | |
CodeGenOptLevel | getOptLevel () const |
Returns the optimization level: None, Less, Default, or Aggressive. | |
void | setOptLevel (CodeGenOptLevel Level) |
Overrides the optimization level. | |
void | setFastISel (bool Enable) |
bool | getO0WantsFastISel () |
void | setO0WantsFastISel (bool Enable) |
void | setGlobalISel (bool Enable) |
void | setGlobalISelAbort (GlobalISelAbortMode Mode) |
void | setMachineOutliner (bool Enable) |
void | setSupportsDefaultOutlining (bool Enable) |
void | setSupportsDebugEntryValues (bool Enable) |
void | setCFIFixup (bool Enable) |
bool | getAIXExtendedAltivecABI () const |
bool | getUniqueSectionNames () const |
bool | getUniqueBasicBlockSectionNames () const |
Return true if unique basic block section names must be generated. | |
bool | getSeparateNamedSections () const |
bool | getDataSections () const |
Return true if data objects should be emitted into their own section, corresponds to -fdata-sections. | |
bool | getFunctionSections () const |
Return true if functions should be emitted into their own section, corresponding to -ffunction-sections. | |
bool | getEnableStaticDataPartitioning () const |
bool | getIgnoreXCOFFVisibility () const |
Return true if visibility attribute should not be emitted in XCOFF, corresponding to -mignore-xcoff-visibility. | |
bool | getXCOFFTracebackTable () const |
Return true if XCOFF traceback table should be emitted, corresponding to -xcoff-traceback-table. | |
llvm::BasicBlockSection | getBBSectionsType () const |
If basic blocks should be emitted into their own section, corresponding to -fbasic-block-sections. | |
const MemoryBuffer * | getBBSectionsFuncListBuf () const |
Get the list of functions and basic block ids that need unique sections. | |
virtual bool | isNoopAddrSpaceCast (unsigned SrcAS, unsigned DestAS) const |
Returns true if a cast between SrcAS and DestAS is a noop. | |
void | setPGOOption (std::optional< PGOOptions > PGOOpt) |
const std::optional< PGOOptions > & | getPGOOption () const |
virtual unsigned | getAssumedAddrSpace (const Value *V) const |
If the specified generic pointer could be assumed as a pointer to a specific address space, return that address space. | |
virtual std::pair< const Value *, unsigned > | getPredicatedAddrSpace (const Value *V) const |
If the specified predicate checks whether a generic pointer falls within a specified address space, return that generic pointer and the address space being queried. | |
TargetIRAnalysis | getTargetIRAnalysis () const |
Get a TargetIRAnalysis appropriate for the target. | |
virtual TargetTransformInfo | getTargetTransformInfo (const Function &F) const |
Return a TargetTransformInfo for a given function. | |
virtual void | registerPassBuilderCallbacks (PassBuilder &) |
Allow the target to modify the pass pipeline. | |
virtual void | registerEarlyDefaultAliasAnalyses (AAManager &) |
Allow the target to register early alias analyses (AA before BasicAA) with the AAManager for use with the new pass manager. | |
virtual void | registerDefaultAliasAnalyses (AAManager &) |
Allow the target to register alias analyses with the AAManager for use with the new pass manager. | |
virtual bool | addPassesToEmitFile (PassManagerBase &, raw_pwrite_stream &, raw_pwrite_stream *, CodeGenFileType, bool=true, MachineModuleInfoWrapperPass *MMIWP=nullptr) |
Add passes to the specified pass manager to get the specified file emitted. | |
virtual bool | addPassesToEmitMC (PassManagerBase &, MCContext *&, raw_pwrite_stream &, bool=true) |
Add passes to the specified pass manager to get machine code emitted with the MCJIT. | |
virtual bool | targetSchedulesPostRAScheduling () const |
True if subtarget inserts the final scheduling pass on its own. | |
void | getNameWithPrefix (SmallVectorImpl< char > &Name, const GlobalValue *GV, Mangler &Mang, bool MayAlwaysUsePrivate=false) const |
MCSymbol * | getSymbol (const GlobalValue *GV) const |
virtual unsigned | getSjLjDataSize () const |
virtual unsigned | getAddressSpaceForPseudoSourceKind (unsigned Kind) const |
getAddressSpaceForPseudoSourceKind - Given the kind of memory (e.g. | |
virtual bool | splitModule (Module &M, unsigned NumParts, function_ref< void(std::unique_ptr< Module > MPart)> ModuleCallback) |
Entry point for module splitting. | |
virtual TargetPassConfig * | createPassConfig (PassManagerBase &PM) |
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of CodeGen passes. | |
virtual Error | buildCodeGenPipeline (ModulePassManager &, raw_pwrite_stream &, raw_pwrite_stream *, CodeGenFileType, const CGPassBuilderOption &, PassInstrumentationCallbacks *) |
virtual bool | isMachineVerifierClean () const |
Returns true if the target is expected to pass all machine verifier checks. | |
virtual bool | addAsmPrinter (PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Context) |
Adds an AsmPrinter pass to the pipeline that prints assembly or machine code from the MI representation. | |
virtual Expected< std::unique_ptr< MCStreamer > > | createMCStreamer (raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Ctx) |
virtual bool | usesPhysRegsForValues () const |
True if the target uses physical regs (as nearly all targets do). | |
virtual bool | useIPRA () const |
True if the target wants to use interprocedural register allocation by default. | |
virtual int | unqualifiedInlineAsmVariant () const |
The default variant to use in unqualified asm instructions. | |
virtual void | registerMachineRegisterInfoCallback (MachineFunction &MF) const |
virtual size_t | clearLinkerOptimizationHints (const SmallPtrSetImpl< MachineInstr * > &MIs) const |
Remove all Linker Optimization Hints (LOH) associated with instructions in MIs and. | |
Static Public Member Functions | |
static std::pair< int, int > | parseBinutilsVersion (StringRef Version) |
Public Attributes | |
TargetOptions | Options |
Static Public Attributes | |
static constexpr unsigned | DefaultSjLjDataSize = 32 |
The integer bit size to use for SjLj based exception handling. | |
Protected Member Functions | |
TargetMachine (const Target &T, StringRef DataLayoutString, const Triple &TargetTriple, StringRef CPU, StringRef FS, const TargetOptions &Options) | |
Protected Attributes | |
const Target & | TheTarget |
The Target that this machine was created for. | |
const DataLayout | DL |
DataLayout for the target: keep ABI type size and alignment. | |
Triple | TargetTriple |
Triple string, CPU name, and target feature strings the TargetMachine instance is created with. | |
std::string | TargetCPU |
std::string | TargetFS |
Reloc::Model | RM = Reloc::Static |
CodeModel::Model | CMModel = CodeModel::Small |
uint64_t | LargeDataThreshold = 0 |
CodeGenOptLevel | OptLevel = CodeGenOptLevel::Default |
std::unique_ptr< const MCAsmInfo > | AsmInfo |
Contains target specific asm information. | |
std::unique_ptr< const MCRegisterInfo > | MRI |
std::unique_ptr< const MCInstrInfo > | MII |
std::unique_ptr< const MCSubtargetInfo > | STI |
unsigned | RequireStructuredCFG: 1 |
unsigned | O0WantsFastISel: 1 |
std::optional< PGOOptions > | PGOOption |
Primary interface to the complete machine description for the target machine.
All target-specific information should be accessible through this interface.
Definition at line 83 of file TargetMachine.h.
|
protected |
Definition at line 39 of file TargetMachine.cpp.
References string.
|
delete |
|
virtualdefault |
|
inlinevirtual |
Adds an AsmPrinter pass to the pipeline that prints assembly or machine code from the MI representation.
Reimplemented in llvm::CodeGenTargetMachineImpl.
Definition at line 504 of file TargetMachine.h.
|
inlinevirtual |
Add passes to the specified pass manager to get the specified file emitted.
Typically this will involve several steps of code generation. This method should return true if emission of this file type is not supported, or false on success. MMIWP
is an optional parameter that, if set to non-nullptr, will be used to set the MachineModuloInfo for this PM.
Reimplemented in llvm::DirectXTargetMachine, and llvm::CodeGenTargetMachineImpl.
Definition at line 426 of file TargetMachine.h.
|
inlinevirtual |
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
This method returns true if machine code is not supported. It fills the MCContext Ctx pointer which can be used to build custom MCStreamer.
Reimplemented in llvm::NVPTXTargetMachine, llvm::DirectXTargetMachine, and llvm::CodeGenTargetMachineImpl.
Definition at line 438 of file TargetMachine.h.
Referenced by llvm::orc::SimpleCompiler::operator()().
|
inlinevirtual |
Reimplemented in llvm::X86TargetMachine, llvm::R600TargetMachine, and llvm::GCNTargetMachine.
Definition at line 488 of file TargetMachine.h.
References llvm::inconvertibleErrorCode().
|
inlinevirtual |
Remove all Linker Optimization Hints (LOH) associated with instructions in MIs
and.
Reimplemented in llvm::AArch64TargetMachine.
Definition at line 537 of file TargetMachine.h.
|
inlinevirtual |
Allocate and initialize an instance of the YAML representation of the MachineFunctionInfo.
Reimplemented in llvm::AArch64TargetMachine, llvm::GCNTargetMachine, llvm::ARMBaseTargetMachine, llvm::RISCVTargetMachine, llvm::WebAssemblyTargetMachine, and llvm::X86TargetMachine.
Definition at line 184 of file TargetMachine.h.
|
inline |
Create a DataLayout.
Definition at line 204 of file TargetMachine.h.
References DL.
Referenced by llvm::orc::SimpleCompiler::operator()().
|
inlinevirtual |
Allocate and return a default initialized instance of the YAML representation for the MachineFunctionInfo.
Reimplemented in llvm::AArch64TargetMachine, llvm::GCNTargetMachine, llvm::ARMBaseTargetMachine, llvm::RISCVTargetMachine, llvm::WebAssemblyTargetMachine, and llvm::X86TargetMachine.
Definition at line 177 of file TargetMachine.h.
|
inlinevirtual |
Create the target's instance of MachineFunctionInfo.
Reimplemented in llvm::AArch64TargetMachine, llvm::GCNTargetMachine, llvm::R600TargetMachine, llvm::ARCTargetMachine, llvm::ARMBaseTargetMachine, llvm::AVRTargetMachine, llvm::CSKYTargetMachine, llvm::HexagonTargetMachine, llvm::LanaiTargetMachine, llvm::LoongArchTargetMachine, llvm::M68kTargetMachine, llvm::MipsTargetMachine, llvm::MSP430TargetMachine, llvm::NVPTXTargetMachine, llvm::PPCTargetMachine, llvm::RISCVTargetMachine, llvm::SparcTargetMachine, llvm::SystemZTargetMachine, llvm::VETargetMachine, llvm::WebAssemblyTargetMachine, llvm::X86TargetMachine, llvm::XCoreTargetMachine, and llvm::XtensaTargetMachine.
Definition at line 148 of file TargetMachine.h.
|
inlinevirtual |
Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this function and target at the current optimization level.
This can also be used to plug a new MachineSchedStrategy into an instance of the standard ScheduleDAGMI: return new ScheduleDAGMI(C, std::make_unique<MyStrategy>(C), /*RemoveKillFlags=*/false)
Return NULL to select the default (generic) machine scheduler.
Reimplemented in llvm::AArch64TargetMachine, llvm::AMDGPUTargetMachine, llvm::GCNTargetMachine, llvm::R600TargetMachine, llvm::ARMBaseTargetMachine, llvm::HexagonTargetMachine, llvm::PPCTargetMachine, llvm::RISCVTargetMachine, and llvm::X86TargetMachine.
Definition at line 164 of file TargetMachine.h.
Referenced by llvm::WindowScheduler::createMachineScheduler().
|
virtual |
Reimplemented in llvm::CodeGenTargetMachineImpl.
Definition at line 50 of file TargetMachine.cpp.
|
inlinevirtual |
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of CodeGen passes.
Reimplemented in llvm::LanaiTargetMachine, llvm::CodeGenTargetMachineImpl, llvm::AArch64TargetMachine, llvm::GCNTargetMachine, llvm::R600TargetMachine, llvm::ARCTargetMachine, llvm::ARMBaseTargetMachine, llvm::AVRTargetMachine, llvm::BPFTargetMachine, llvm::CSKYTargetMachine, llvm::DirectXTargetMachine, llvm::HexagonTargetMachine, llvm::LoongArchTargetMachine, llvm::M68kTargetMachine, llvm::MipsTargetMachine, llvm::MSP430TargetMachine, llvm::NVPTXTargetMachine, llvm::PPCTargetMachine, llvm::RISCVTargetMachine, llvm::SparcTargetMachine, llvm::SPIRVTargetMachine, llvm::SystemZTargetMachine, llvm::VETargetMachine, llvm::WebAssemblyTargetMachine, llvm::X86TargetMachine, llvm::XCoreTargetMachine, and llvm::XtensaTargetMachine.
Definition at line 484 of file TargetMachine.h.
|
inlinevirtual |
Similar to createMachineScheduler but used when postRA machine scheduling is enabled.
Reimplemented in llvm::AArch64TargetMachine, llvm::GCNTargetMachine, llvm::ARMBaseTargetMachine, llvm::PPCTargetMachine, llvm::RISCVTargetMachine, llvm::SystemZTargetMachine, and llvm::X86TargetMachine.
Definition at line 171 of file TargetMachine.h.
|
inlinevirtual |
getAddressSpaceForPseudoSourceKind - Given the kind of memory (e.g.
stack) the target returns the corresponding address space.
Reimplemented in llvm::AMDGPUTargetMachine.
Definition at line 463 of file TargetMachine.h.
|
inline |
Definition at line 313 of file TargetMachine.h.
References Options.
Referenced by llvm::PPCRegisterInfo::getCalleeSavedRegs(), llvm::PPCRegisterInfo::getCallPreservedMask(), llvm::PPCRegisterInfo::getRegPressureLimit(), and llvm::PPCRegisterInfo::getReservedRegs().
|
inline |
Definition at line 230 of file TargetMachine.h.
References DL.
If the specified generic pointer could be assumed as a pointer to a specific address space, return that address space.
Under offloading programming, the offloading target may be passed with values only prepared on the host side and could assume certain properties.
Reimplemented in llvm::AMDGPUTargetMachine.
Definition at line 379 of file TargetMachine.h.
Referenced by llvm::BasicTTIImplBase< T >::getAssumedAddrSpace().
|
inline |
Get the list of functions and basic block ids that need unique sections.
Definition at line 361 of file TargetMachine.h.
References Options.
Referenced by llvm::TargetPassConfig::addMachinePasses(), and llvm::BasicBlockSectionsProfileReaderAnalysis::run().
|
inline |
If basic blocks should be emitted into their own section, corresponding to -fbasic-block-sections.
Definition at line 356 of file TargetMachine.h.
References Options.
Referenced by llvm::TargetPassConfig::addMachinePasses(), and assignSections().
|
inline |
Returns the code model.
The choices are small, kernel, medium, large, and target default.
Definition at line 264 of file TargetMachine.h.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::X86InstrInfo::canMakeTailCallConditional(), llvm::M68kSubtarget::classifyBlockAddressReference(), llvm::M68kSubtarget::classifyGlobalReference(), llvm::X86Subtarget::classifyGlobalReference(), llvm::M68kSubtarget::classifyLocalReference(), llvm::X86Subtarget::classifyLocalReference(), llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::AsmPrinter::emitPCSections(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::PPCSubtarget::getCodeModel(), llvm::M68kSubtarget::getJumpTableEncoding(), getMaxCodeSize(), llvm::TargetLoweringObjectFileXCOFF::getSectionForTOCEntry(), llvm::TargetLoweringObjectFile::Initialize(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::PPCTargetLowering::isAccessedAsGotIndirect(), llvm::LanaiTargetObjectFile::isGlobalInSmallSection(), llvm::PPCSubtarget::isGVIndirectSymbol(), isLargeGlobalValue(), llvm::X86TargetLowering::isLegalAddressingMode(), IsSmallObject(), llvm::PPCSubtarget::isUsingPCRelativeCalls(), llvm::LoongArchTargetLowering::LowerCall(), llvm::LanaiTargetLowering::LowerConstantPool(), needsPrologueENDBR(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), llvm::PPCInstrInfo::shouldReduceRegisterPressure(), and llvm::AArch64Subtarget::useSmallAddressing().
|
inline |
Return true if data objects should be emitted into their own section, corresponds to -fdata-sections.
Definition at line 330 of file TargetMachine.h.
References Options.
Referenced by llvm::TargetLoweringObjectFileXCOFF::getTargetSymbol(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileWasm::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileXCOFF::SelectSectionForGlobal(), and llvm::RISCVELFTargetObjectFile::SelectSectionForGlobal().
|
inline |
Definition at line 340 of file TargetMachine.h.
References Options.
Referenced by llvm::TargetLoweringObjectFileELF::getSectionForJumpTable().
|
inline |
Return the ExceptionHandling to use, considering TargetOptions and the Triple's default.
Definition at line 248 of file TargetMachine.h.
References llvm::Triple::getDefaultExceptionHandling(), and Options.
Referenced by llvm::ARMTargetLowering::getExceptionPointerRegister(), and llvm::ARMTargetLowering::getExceptionSelectorRegister().
|
inline |
Return true if functions should be emitted into their own section, corresponding to -ffunction-sections.
Definition at line 336 of file TargetMachine.h.
References Options.
Referenced by llvm::TargetLoweringObjectFile::emitPseudoProbeDescMetadata(), llvm::TargetLoweringObjectFileXCOFF::getFunctionEntryPointSymbol(), llvm::TargetLoweringObjectFileXCOFF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileELF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileELF::getSectionForLSDA(), llvm::TargetLoweringObjectFileXCOFF::getSectionForLSDA(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileWasm::SelectSectionForGlobal(), and llvm::TargetLoweringObjectFileXCOFF::SelectSectionForGlobal().
|
inline |
Return true if visibility attribute should not be emitted in XCOFF, corresponding to -mignore-xcoff-visibility.
Definition at line 346 of file TargetMachine.h.
References Options.
uint64_t TargetMachine::getMaxCodeSize | ( | ) | const |
Returns the maximum code size possible under the code model.
Definition at line 171 of file TargetMachine.cpp.
References getCodeModel(), llvm::CodeModel::Kernel, llvm::CodeModel::Large, llvm_unreachable, llvm::maxUIntN(), llvm::CodeModel::Medium, llvm::CodeModel::Small, and llvm::CodeModel::Tiny.
Return target specific asm information.
Definition at line 240 of file TargetMachine.h.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::TargetPassConfig::addPassesToHandleExceptions(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::canUseLEAForSPInEpilogue(), llvm::CodeGenTargetMachineImpl::createMCStreamer(), llvm::AsmPrinter::doInitialization(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::emitEpilogue(), llvm::AMDGPUAsmPrinter::emitInstruction(), llvm::TargetFrameLowering::enableCFIFixup(), ExpandMOVImmSExti8(), llvm::X86FrameLowering::getFrameIndexReference(), llvm::AArch64InstrInfo::getInstSizeInBytes(), llvm::SIInstrInfo::getInstSizeInBytes(), llvm::ARCInstrInfo::getInstSizeInBytes(), llvm::ARMBaseInstrInfo::getInstSizeInBytes(), llvm::CSKYInstrInfo::getInstSizeInBytes(), llvm::LoongArchInstrInfo::getInstSizeInBytes(), llvm::MipsInstrInfo::getInstSizeInBytes(), llvm::MSP430InstrInfo::getInstSizeInBytes(), llvm::PPCInstrInfo::getInstSizeInBytes(), llvm::RISCVInstrInfo::getInstSizeInBytes(), llvm::SparcInstrInfo::getInstSizeInBytes(), llvm::SystemZInstrInfo::getInstSizeInBytes(), llvm::XtensaInstrInfo::getInstSizeInBytes(), llvm::TargetLoweringObjectFileMachO::getNameWithPrefix(), llvm::ARMSubtarget::getPushPopSplitVariation(), llvm::HexagonInstrInfo::getSize(), llvm::ARMElfTargetObjectFile::getTTypeGlobalReference(), llvm::X86::isExtendedSwiftAsyncFrameSupported(), llvm::AArch64InstrInfo::isFunctionSafeToOutlineFrom(), llvm::AArch64FunctionInfo::needsDwarfUnwindInfo(), llvm::WebAssemblyFrameLowering::needsPrologForEH(), needsWinCFI(), llvm::X86FrameLowering::processFunctionBeforeFrameFinalized(), and shouldSignReturnAddressEverywhere().
|
inline |
Definition at line 243 of file TargetMachine.h.
References llvm::MCInstrInfo::get().
Referenced by llvm::CodeGenTargetMachineImpl::addPassesToEmitMC(), and llvm::CodeGenTargetMachineImpl::createMCStreamer().
|
inline |
Definition at line 242 of file TargetMachine.h.
References MRI.
Referenced by llvm::DwarfCompileUnit::addLocationAttribute(), llvm::CodeGenTargetMachineImpl::addPassesToEmitMC(), llvm::CodeGenTargetMachineImpl::createMCStreamer(), and llvm::SystemZAsmPrinter::PrintAsmOperand().
|
inline |
Definition at line 244 of file TargetMachine.h.
Referenced by llvm::CodeGenTargetMachineImpl::addPassesToEmitMC(), llvm::AMDGPUTargetMachine::AMDGPUTargetMachine(), llvm::CodeGenTargetMachineImpl::createMCStreamer(), llvm::AsmPrinter::doInitialization(), llvm::AsmPrinter::emitAlignment(), llvm::AsmPrinter::emitFunctionBody(), llvm::AMDGPUAsmPrinter::getGlobalSTI(), llvm::ARMElfTargetObjectFile::Initialize(), llvm::AMDGPUResourceUsageAnalysis::run(), and llvm::CSKYAsmPrinter::runOnMachineFunction().
void TargetMachine::getNameWithPrefix | ( | SmallVectorImpl< char > & | Name, |
const GlobalValue * | GV, | ||
Mangler & | Mang, | ||
bool | MayAlwaysUsePrivate = false |
||
) | const |
Definition at line 295 of file TargetMachine.cpp.
References llvm::Mangler::getNameWithPrefix(), llvm::TargetLoweringObjectFile::getNameWithPrefix(), getObjFileLowering(), llvm::GlobalValue::hasPrivateLinkage(), and Name.
Referenced by llvm::AArch64MCInstLower::GetGlobalValueSymbol(), llvm::AsmPrinter::getNameWithPrefix(), getSymbol(), and llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase().
|
inline |
Definition at line 295 of file TargetMachine.h.
Referenced by llvm::TargetPassConfig::addCoreISelPasses(), and llvm::OptLevelChanger::OptLevelChanger().
|
inlinevirtual |
Reimplemented in llvm::AArch64TargetMachine, llvm::AMDGPUTargetMachine, llvm::ARCTargetMachine, llvm::ARMBaseTargetMachine, llvm::AVRTargetMachine, llvm::BPFTargetMachine, llvm::CSKYTargetMachine, llvm::DirectXTargetMachine, llvm::HexagonTargetMachine, llvm::LanaiTargetMachine, llvm::LoongArchTargetMachine, llvm::M68kTargetMachine, llvm::MipsTargetMachine, llvm::MSP430TargetMachine, llvm::NVPTXTargetMachine, llvm::PPCTargetMachine, llvm::RISCVTargetMachine, llvm::SparcTargetMachine, llvm::SPIRVTargetMachine, llvm::SystemZTargetMachine, llvm::VETargetMachine, llvm::WebAssemblyTargetMachine, llvm::X86TargetMachine, llvm::XCoreTargetMachine, and llvm::XtensaTargetMachine.
Definition at line 142 of file TargetMachine.h.
Referenced by getNameWithPrefix(), llvm::AsmPrinter::getObjFileLowering(), getSymbol(), llvm::LanaiTargetLowering::LowerConstantPool(), llvm::LanaiTargetLowering::LowerGlobalAddress(), and llvm::MachineModuleInfo::MachineModuleInfo().
|
inline |
Returns the optimization level: None, Less, Default, or Aggressive.
Definition at line 289 of file TargetMachine.h.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::AMDGPUPassConfig::addCodeGenPrepare(), llvm::TargetPassConfig::addCoreISelPasses(), llvm::AMDGPUPassConfig::addIRPasses(), llvm::AMDGPUPassConfig::addPreISel(), AlignBlocks(), llvm::CodeViewDebug::beginFunctionImpl(), canOptimizeTLSDFormToXForm(), llvm::GCNTargetMachine::createPostMachineScheduler(), llvm::SwitchCG::SwitchLowering::findJumpTables(), llvm::GISelValueTrackingAnalysisLegacy::get(), llvm::AMDGPUPassConfig::getCSEConfig(), llvm::HexagonFrameLowering::getFrameIndexReference(), llvm::PPCInstrInfo::getMachineCombinerPatterns(), llvm::TargetPassConfig::getOptLevel(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::HexagonFrameLowering::hasFPImpl(), isOptNone(), llvm::AMDGPUPassConfig::isPassEnabled(), llvm::ARMAsmPrinter::runOnMachineFunction(), llvm::InstructionSelect::runOnMachineFunction(), llvm::RISCVDAGToDAGISel::Select(), and llvm::AArch64TargetLowering::shouldExpandAtomicRMWInIR().
|
inline |
Definition at line 371 of file TargetMachine.h.
Get the pointer size for this target.
This is the only time the DataLayout in the TargetMachine is used.
Definition at line 218 of file TargetMachine.h.
References DL.
Referenced by llvm::SystemZFrameLowering::create(), llvm::AsmPrinter::getPointerSize(), llvm::AArch64TargetMachine::isNoopAddrSpaceCast(), llvm::AVRTargetMachine::isNoopAddrSpaceCast(), llvm::X86TargetMachine::isNoopAddrSpaceCast(), and LowerADDRSPACECAST().
Definition at line 222 of file TargetMachine.h.
References DL.
Referenced by LiveDebugValues::MLocTracker::emitLoc().
|
inlinevirtual |
If the specified predicate checks whether a generic pointer falls within a specified address space, return that generic pointer and the address space being queried.
Such predicates could be specified in @llvm.assume intrinsics for the optimizer to assume that the given generic pointer always falls within the address space based on that predicate.
Reimplemented in llvm::AMDGPUTargetMachine, and llvm::NVPTXTargetMachine.
Definition at line 389 of file TargetMachine.h.
Referenced by llvm::BasicTTIImplBase< T >::getPredicatedAddrSpace().
|
inline |
Definition at line 226 of file TargetMachine.h.
References DL.
Referenced by llvm::AsmPrinter::emitCallGraphSection(), and llvm::AsmPrinter::emitStackSizeSection().
Reloc::Model TargetMachine::getRelocationModel | ( | ) | const |
Returns the code generation relocation model.
The choices are static, PIC, and dynamic-no-pic, and target default.
The choices are static, PIC, and dynamic-no-pic.
Definition at line 169 of file TargetMachine.cpp.
References RM.
Referenced by llvm::DwarfCompileUnit::addLocationAttribute(), llvm::X86Subtarget::classifyGlobalFunctionReference(), llvm::X86Subtarget::classifyGlobalReference(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::MipsSubtarget::getRelocationModel(), llvm::AsmPrinter::getSymbolPreferLocal(), getTLSModel(), llvm::TargetLoweringObjectFileMachO::Initialize(), llvm::X86Subtarget::isLegalToCallImmediateAddr(), llvm::HexagonTargetLowering::isOffsetFoldingLegal(), isPositionIndependent(), llvm::ARMSubtarget::isROPI(), llvm::ARMSubtarget::isRWPI(), llvm::HexagonTargetLowering::LowerBlockAddress(), llvm::HexagonTargetLowering::LowerGLOBALADDRESS(), shouldAssumeDSOLocal(), and transformCallee().
|
inline |
Definition at line 324 of file TargetMachine.h.
References Options.
|
inlinevirtual |
Reimplemented in llvm::VETargetMachine.
Definition at line 457 of file TargetMachine.h.
|
inline |
This method returns a pointer to the specified type of TargetSubtargetInfo.
In debug builds, it verifies that the object being returned is of the correct type.
Definition at line 199 of file TargetMachine.h.
References F.
Referenced by llvm::PhysicalRegisterUsageInfo::print(), llvm::AMDGPULateCodeGenPreparePass::run(), llvm::AMDGPUAtomicOptimizerPass::run(), and llvm::SIAnnotateControlFlowPass::run().
|
inlinevirtual |
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInfo-derived member variable.
Reimplemented in llvm::GCNTargetMachine, llvm::R600TargetMachine, llvm::ARCTargetMachine, llvm::AVRTargetMachine, llvm::BPFTargetMachine, llvm::DirectXTargetMachine, llvm::NVPTXTargetMachine, llvm::SPIRVTargetMachine, llvm::SystemZTargetMachine, llvm::VETargetMachine, llvm::XCoreTargetMachine, llvm::AMDGPUTargetMachine, llvm::AArch64TargetMachine, llvm::ARMBaseTargetMachine, llvm::CSKYTargetMachine, llvm::HexagonTargetMachine, llvm::LoongArchTargetMachine, llvm::M68kTargetMachine, llvm::MipsTargetMachine, llvm::MSP430TargetMachine, llvm::PPCTargetMachine, llvm::RISCVTargetMachine, llvm::SparcTargetMachine, llvm::WebAssemblyTargetMachine, llvm::X86TargetMachine, llvm::XtensaTargetMachine, and llvm::LanaiTargetMachine.
Definition at line 139 of file TargetMachine.h.
Referenced by llvm::MachineModuleInfo::getOrCreateMachineFunction(), llvm::ExpandFpPass::run(), llvm::ExpandLargeDivRemPass::run(), llvm::ExpandMemCmpPass::run(), llvm::IndirectBrExpandPass::run(), llvm::InterleavedAccessPass::run(), and llvm::MachineFunctionAnalysis::run().
MCSymbol * TargetMachine::getSymbol | ( | const GlobalValue * | GV | ) | const |
Definition at line 308 of file TargetMachine.cpp.
References llvm::MCObjectFileInfo::getContext(), llvm::TargetLoweringObjectFile::getMangler(), getNameWithPrefix(), getObjFileLowering(), llvm::MCContext::getOrCreateSymbol(), and llvm::TargetLoweringObjectFile::getTargetSymbol().
Referenced by llvm::TargetLoweringObjectFile::emitCGProfileMetadata(), llvm::AIXException::endFunction(), llvm::TargetLoweringObjectFile::getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFileELF::getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(), llvm::AArch64_MachoTargetObjectFile::getCFIPersonalitySymbol(), llvm::X86_64MachoTargetObjectFile::getCFIPersonalitySymbol(), llvm::NVPTXTargetLowering::getParamName(), llvm::AsmPrinter::getSymbol(), llvm::AsmPrinter::getSymbolPreferLocal(), llvm::TargetLoweringObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::ARMElfTargetObjectFile::getTTypeGlobalReference(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), and llvm::TargetLoweringObjectFileGOFF::SelectSectionForGlobal().
Definition at line 130 of file TargetMachine.h.
Referenced by llvm::CodeGenTargetMachineImpl::addAsmPrinter(), llvm::CodeGenTargetMachineImpl::addPassesToEmitMC(), llvm::CodeGenTargetMachineImpl::createMCStreamer(), and llvm::X86AsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 133 of file TargetMachine.h.
Referenced by llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::AMDGPUTargetMachine::getGPUName(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), and llvm::CodeGenTargetMachineImpl::initAsmInfo().
|
inline |
Definition at line 134 of file TargetMachine.h.
Referenced by llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::AMDGPUTargetMachine::getFeatureString(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), and llvm::CodeGenTargetMachineImpl::initAsmInfo().
TargetIRAnalysis TargetMachine::getTargetIRAnalysis | ( | ) | const |
Get a TargetIRAnalysis
appropriate for the target.
This is used to construct the new pass manager's target IR analysis pass, set up appropriately for this target machine. Even the old pass manager uses this to answer queries about the IR.
Definition at line 319 of file TargetMachine.cpp.
References F, and getTargetTransformInfo().
Referenced by llvm::TargetPassConfig::addISelPasses().
|
virtual |
Return a TargetTransformInfo for a given function.
The returned TargetTransformInfo is specialized to the subtarget corresponding to F
.
Reimplemented in llvm::CodeGenTargetMachineImpl, llvm::AArch64TargetMachine, llvm::GCNTargetMachine, llvm::R600TargetMachine, llvm::ARCTargetMachine, llvm::ARMBaseTargetMachine, llvm::AVRTargetMachine, llvm::BPFTargetMachine, llvm::DirectXTargetMachine, llvm::HexagonTargetMachine, llvm::LanaiTargetMachine, llvm::LoongArchTargetMachine, llvm::MipsTargetMachine, llvm::NVPTXTargetMachine, llvm::PPCTargetMachine, llvm::RISCVTargetMachine, llvm::SPIRVTargetMachine, llvm::SystemZTargetMachine, llvm::VETargetMachine, llvm::WebAssemblyTargetMachine, llvm::X86TargetMachine, and llvm::XCoreTargetMachine.
Definition at line 291 of file TargetMachine.cpp.
References F.
Referenced by getTargetIRAnalysis(), and llvm::SelectionDAGBuilder::shouldKeepJumpConditionsTogether().
Definition at line 132 of file TargetMachine.h.
Referenced by llvm::AMDGPUPassConfig::addCodeGenPrepare(), llvm::TargetPassConfig::addIRPasses(), llvm::AMDGPUPassConfig::addIRPasses(), llvm::DwarfCompileUnit::addLocationAttribute(), llvm::CodeGenTargetMachineImpl::addPassesToEmitMC(), llvm::CodeGenTargetMachineImpl::createMCStreamer(), createPPCAsmPrinterPass(), llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::doInitialization(), llvm::AMDGPUAsmPrinter::doInitialization(), llvm::TargetInstrInfo::duplicate(), llvm::DwarfDebug::DwarfDebug(), llvm::AsmPrinter::emitCOFFFeatureSymbol(), llvm::AsmPrinter::emitCOFFReplaceableFunctionData(), llvm::DwarfDebug::emitDebugLocValue(), llvm::AMDGPUAsmPrinter::emitEndOfAsmFile(), llvm::ARMAsmPrinter::emitEndOfAsmFile(), llvm::CSKYAsmPrinter::emitEndOfAsmFile(), llvm::HexagonAsmPrinter::emitEndOfAsmFile(), llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::X86FrameLowering::emitEpilogue(), llvm::AsmPrinter::emitFunctionBody(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::SystemZAsmPrinter::emitFunctionBodyEnd(), llvm::AsmPrinter::emitFunctionEntryLabel(), llvm::AMDGPUAsmPrinter::emitFunctionEntryLabel(), llvm::AsmPrinter::emitGlobalAlias(), emitGlobalConstantImpl(), llvm::AsmPrinter::emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::LoongArchAsmPrinter::emitJumpTableInfo(), llvm::X86AsmPrinter::emitKCFITypeId(), llvm::AsmPrinter::emitPatchableFunctionEntries(), llvm::ARMAsmPrinter::emitStartOfAsmFile(), llvm::CSKYAsmPrinter::emitStartOfAsmFile(), llvm::HexagonAsmPrinter::emitStartOfAsmFile(), llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::SystemZAsmPrinter::emitStartOfAsmFile(), llvm::X86AsmPrinter::emitStartOfAsmFile(), llvm::AsmPrinter::emitXRayTable(), llvm::TargetLowering::expandIndirectJTBranch(), llvm::RISCVTargetLowering::expandIndirectJTBranch(), llvm::X86TargetLowering::expandIndirectJTBranch(), llvm::AMDGPUSubtarget::get(), llvm::AsmPrinter::GetCPISymbol(), llvm::AArch64MCInstLower::GetGlobalValueSymbol(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::M68kMCInstLower::GetSymbolFromOperand(), llvm::AsmPrinter::getSymbolPreferLocal(), llvm::TargetLoweringObjectFileELF::getUniqueSectionForFunction(), llvm::CodeGenTargetMachineImpl::initAsmInfo(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::TargetLoweringObjectFileXCOFF::Initialize(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), isLargeGlobalValue(), llvm::PPCTargetMachine::isPPC64(), llvm::AsmPrinter::lowerConstant(), llvm::AArch64MCInstLower::LowerSymbolOperand(), llvm::AsmPrinter::preprocessXXStructorList(), llvm::AArch64TargetMachine::registerPassBuilderCallbacks(), llvm::FastISel::selectOperator(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::AMDGPUTargetObjectFile::SelectSectionForGlobal(), llvm::FastISel::selectXRayCustomEvent(), llvm::FastISel::selectXRayTypedEvent(), llvm::AsmPrinter::SetupMachineFunction(), shouldAssumeDSOLocal(), llvm::SITargetLowering::shouldEmitFixup(), shouldLowerMemFuncForSize(), llvm::TargetLoweringObjectFileCOFF::shouldPutJumpTableInFunctionSection(), llvm::TailDuplicator::shouldTailDuplicate(), llvm::SITargetLowering::shouldUseLDSConstAddress(), and llvm::WinException::WinException().
TLSModel::Model TargetMachine::getTLSModel | ( | const GlobalValue * | GV | ) | const |
Returns the TLS model which should be used for the given global variable.
Definition at line 263 of file TargetMachine.cpp.
References llvm::PIELevel::Default, llvm::TLSModel::GeneralDynamic, llvm::GlobalValue::getParent(), llvm::Module::getPIELevel(), getRelocationModel(), getSelectedTLSModel(), llvm::TLSModel::InitialExec, llvm::TLSModel::LocalDynamic, llvm::TLSModel::LocalExec, llvm::Reloc::PIC_, RM, and shouldAssumeDSOLocal().
Referenced by isEligibleToFoldADDIForFasterLocalAccesses(), llvm::HexagonTargetLowering::LowerGlobalTLSAddress(), llvm::SparcTargetLowering::LowerGlobalTLSAddress(), and llvm::AArch64MCInstLower::lowerSymbolOperandELF().
|
inline |
Return true if unique basic block section names must be generated.
Definition at line 320 of file TargetMachine.h.
References Options.
Referenced by llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock().
|
inline |
Definition at line 317 of file TargetMachine.h.
References Options.
Referenced by llvm::TargetLoweringObjectFileELF::getSectionForLSDA().
|
inline |
Return true if XCOFF traceback table should be emitted, corresponding to -xcoff-traceback-table.
Definition at line 352 of file TargetMachine.h.
References Options.
|
inline |
Test if a DataLayout if compatible with the CodeGen for this target.
The LLVM Module owns a DataLayout that is used for the target independent optimizations and code generation. This hook provides a target specific check on the validity of this DataLayout.
Definition at line 211 of file TargetMachine.h.
References DL.
bool TargetMachine::isLargeGlobalValue | ( | const GlobalValue * | GV | ) | const |
Definition at line 56 of file TargetMachine.cpp.
References DL, llvm::GlobalValue::getAliaseeObject(), getCodeModel(), llvm::TargetLoweringObjectFile::getKindForGlobal(), getTargetTriple(), llvm::DataLayout::getTypeAllocSize(), llvm::SectionKind::isReadOnlyWithRel(), llvm::CodeModel::Large, LargeDataThreshold, llvm::CodeModel::Medium, Name, Size, llvm::CodeModel::Small, and llvm::Triple::x86_64.
Referenced by llvm::X86Subtarget::classifyLocalReference().
|
inlinevirtual |
Returns true if the target is expected to pass all machine verifier checks.
This is a stopgap measure to fix targets one by one. We will remove this at some point and always enable the verifier when EXPENSIVE_CHECKS is enabled.
Reimplemented in llvm::R600TargetMachine, llvm::LanaiTargetMachine, llvm::NVPTXTargetMachine, and llvm::VETargetMachine.
Definition at line 500 of file TargetMachine.h.
Referenced by llvm::TargetPassConfig::addVerifyPass().
|
inlinevirtual |
Returns true if a cast between SrcAS and DestAS is a noop.
Reimplemented in llvm::AArch64TargetMachine, llvm::AMDGPUTargetMachine, llvm::ARMBaseTargetMachine, llvm::AVRTargetMachine, llvm::HexagonTargetMachine, llvm::LoongArchTargetMachine, llvm::MipsTargetMachine, llvm::PPCTargetMachine, llvm::X86TargetMachine, and llvm::RISCVTargetMachine.
Definition at line 366 of file TargetMachine.h.
Referenced by checkAddrSpaceIsValidForLibcall(), llvm::TargetLoweringBase::isFreeAddrSpaceCast(), llvm::BasicTTIImplBase< T >::isNoopAddrSpaceCast(), and llvm::AsmPrinter::lowerConstant().
bool TargetMachine::isPositionIndependent | ( | ) | const |
Definition at line 143 of file TargetMachine.cpp.
References getRelocationModel(), and llvm::Reloc::PIC_.
Referenced by computeBasePointerSaveOffset(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::PPCRegisterInfo::getBaseRegister(), llvm::PPCRegisterInfo::getCalleeSavedRegs(), llvm::PPCRegisterInfo::getCallPreservedMask(), llvm::PPCRegisterInfo::getReservedRegs(), llvm::MipsFunctionInfo::initGlobalBaseReg(), llvm::TargetLoweringObjectFile::Initialize(), llvm::ARMSubtarget::isGVIndirectSymbol(), llvm::ARMSubtarget::isGVInGOT(), llvm::TargetLoweringBase::isJumpTableRelative(), llvm::MipsTargetLowering::isJumpTableRelative(), llvm::AsmPrinter::isPositionIndependent(), llvm::TargetLowering::isPositionIndependent(), llvm::M68kSubtarget::isPositionIndependent(), llvm::MipsSubtarget::isPositionIndependent(), llvm::X86Subtarget::isPositionIndependent(), llvm::HexagonTargetObjectFile::isSmallDataEnabled(), and llvm::M68kCallLowering::lowerCall().
|
delete |
|
static |
Definition at line 326 of file TargetMachine.cpp.
References llvm::Version.
|
inlinevirtual |
Parse out the target's MachineFunctionInfo from the YAML reprsentation.
Reimplemented in llvm::AArch64TargetMachine, llvm::GCNTargetMachine, llvm::ARMBaseTargetMachine, llvm::RISCVTargetMachine, llvm::WebAssemblyTargetMachine, and llvm::X86TargetMachine.
Definition at line 189 of file TargetMachine.h.
|
inlinevirtual |
Allow the target to register alias analyses with the AAManager for use with the new pass manager.
Only affects the "default" AAManager.
Reimplemented in llvm::AMDGPUTargetMachine.
Definition at line 417 of file TargetMachine.h.
Referenced by llvm::PassBuilder::buildDefaultAAPipeline().
|
inlinevirtual |
Allow the target to register early alias analyses (AA before BasicAA) with the AAManager for use with the new pass manager.
Only affects the "default" AAManager.
Reimplemented in llvm::NVPTXTargetMachine.
Definition at line 413 of file TargetMachine.h.
Referenced by llvm::PassBuilder::buildDefaultAAPipeline().
|
inlinevirtual |
Reimplemented in llvm::GCNTargetMachine.
Definition at line 531 of file TargetMachine.h.
Referenced by llvm::MachineModuleInfo::getOrCreateMachineFunction(), and llvm::MachineFunctionAnalysis::run().
|
inlinevirtual |
Allow the target to modify the pass pipeline.
Reimplemented in llvm::AArch64TargetMachine, llvm::AMDGPUTargetMachine, llvm::BPFTargetMachine, llvm::DirectXTargetMachine, llvm::HexagonTargetMachine, llvm::NVPTXTargetMachine, llvm::RISCVTargetMachine, llvm::SPIRVTargetMachine, and llvm::X86TargetMachine.
Definition at line 408 of file TargetMachine.h.
|
inline |
Definition at line 255 of file TargetMachine.h.
Referenced by llvm::TargetPassConfig::addMachineLateOptimization(), and llvm::MachineBasicBlock::canSplitCriticalEdge().
Reset the target options based on the function's attributes.
setFunctionAttributes should have made the raw attribute value consistent with the command line flag if used.
Definition at line 155 of file TargetMachine.cpp.
References RESET_OPTION.
Referenced by llvm::GCNTargetMachine::getSubtargetImpl(), llvm::R600TargetMachine::getSubtargetImpl(), llvm::SystemZTargetMachine::getSubtargetImpl(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::CSKYTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::LoongArchTargetMachine::getSubtargetImpl(), llvm::M68kTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), and llvm::XtensaTargetMachine::getSubtargetImpl().
|
inline |
Definition at line 311 of file TargetMachine.h.
References Enable, and Options.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), and llvm::RISCVTargetMachine::RISCVTargetMachine().
|
inline |
Set the code model.
Definition at line 270 of file TargetMachine.h.
|
inline |
Definition at line 294 of file TargetMachine.h.
References Enable, and Options.
Referenced by llvm::TargetPassConfig::addCoreISelPasses(), llvm::OptLevelChanger::OptLevelChanger(), llvm::SPIRVTargetMachine::SPIRVTargetMachine(), and llvm::OptLevelChanger::~OptLevelChanger().
|
inline |
Definition at line 297 of file TargetMachine.h.
References Enable, and Options.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::TargetPassConfig::addCoreISelPasses(), and llvm::SPIRVTargetMachine::SPIRVTargetMachine().
|
inline |
Definition at line 298 of file TargetMachine.h.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine().
|
inline |
Definition at line 272 of file TargetMachine.h.
|
inline |
Definition at line 301 of file TargetMachine.h.
References Enable, and Options.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), llvm::RISCVTargetMachine::RISCVTargetMachine(), and llvm::X86TargetMachine::X86TargetMachine().
|
inline |
Definition at line 296 of file TargetMachine.h.
References Enable.
Referenced by llvm::TargetPassConfig::addCoreISelPasses(), and llvm::SPIRVTargetMachine::SPIRVTargetMachine().
|
inline |
Overrides the optimization level.
Definition at line 292 of file TargetMachine.h.
Referenced by llvm::OptLevelChanger::OptLevelChanger(), and llvm::OptLevelChanger::~OptLevelChanger().
|
inline |
Definition at line 370 of file TargetMachine.h.
|
inline |
Definition at line 256 of file TargetMachine.h.
Referenced by llvm::NVPTXTargetMachine::NVPTXTargetMachine(), llvm::R600TargetMachine::R600TargetMachine(), and llvm::SPIRVTargetMachine::SPIRVTargetMachine().
|
inline |
Definition at line 307 of file TargetMachine.h.
References Enable, and Options.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), llvm::MipsTargetMachine::MipsTargetMachine(), and llvm::X86TargetMachine::X86TargetMachine().
|
inline |
Definition at line 304 of file TargetMachine.h.
References Enable, and Options.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), and llvm::RISCVTargetMachine::RISCVTargetMachine().
|
inline |
Definition at line 135 of file TargetMachine.h.
bool TargetMachine::shouldAssumeDSOLocal | ( | const GlobalValue * | GV | ) | const |
Definition at line 203 of file TargetMachine.cpp.
References assert(), getRelocationModel(), getTargetTriple(), llvm::GlobalValue::hasDLLImportStorageClass(), llvm::GlobalValue::hasExternalWeakLinkage(), llvm::GlobalValue::isDeclarationForLinker(), llvm::GlobalValue::isDSOLocal(), llvm::GlobalValue::isStrongDefinitionForLinker(), RM, and llvm::Reloc::Static.
Referenced by llvm::M68kSubtarget::classifyExternalReference(), llvm::M68kSubtarget::classifyGlobalFunctionReference(), llvm::X86Subtarget::classifyGlobalFunctionReference(), llvm::M68kSubtarget::classifyGlobalReference(), llvm::X86Subtarget::classifyGlobalReference(), getTLSModel(), llvm::ARMSubtarget::isGVIndirectSymbol(), llvm::PPCSubtarget::isGVIndirectSymbol(), llvm::SystemZSubtarget::isPC32DBLSymbol(), llvm::LoongArchTargetLowering::LowerCall(), llvm::HexagonTargetLowering::LowerGLOBALADDRESS(), llvm::SITargetLowering::shouldEmitGOTReloc(), and transformCallee().
|
inlinevirtual |
Entry point for module splitting.
Targets can implement custom module splitting logic, mainly used by LTO for –lto-partitions.
On success, this guarantees that between 1 and NumParts
modules were created and passed to ModuleCallBack
.
true
if the module was split, false
otherwise. When false
is returned, it is assumed that ModuleCallback
has never been called and M
has not been modified. Reimplemented in llvm::AMDGPUTargetMachine.
Definition at line 476 of file TargetMachine.h.
|
inlinevirtual |
True if subtarget inserts the final scheduling pass on its own.
Branch relaxation, which must happen after block placement, can on some targets (e.g. SystemZ) expose additional post-RA scheduling opportunities.
Reimplemented in llvm::ARMBaseTargetMachine, and llvm::SystemZTargetMachine.
Definition at line 449 of file TargetMachine.h.
Referenced by llvm::TargetPassConfig::addMachinePasses().
|
inlinevirtual |
The default variant to use in unqualified asm
instructions.
If this returns 0, asm "$(foo$|bar$)"
will evaluate to asm "foo"
.
Reimplemented in llvm::PPCTargetMachine.
Definition at line 528 of file TargetMachine.h.
Referenced by EmitInlineAsmStr().
bool TargetMachine::useEmulatedTLS | ( | ) | const |
Returns true if this target uses emulated TLS.
Definition at line 260 of file TargetMachine.cpp.
References llvm::TargetOptions::EmulatedTLS, and Options.
Referenced by llvm::TargetPassConfig::addISelPasses(), llvm::DwarfCompileUnit::addLocationAttribute(), llvm::AsmPrinter::emitGlobalVariable(), and llvm::SparcTargetLowering::LowerGlobalTLSAddress().
|
inlinevirtual |
True if the target wants to use interprocedural register allocation by default.
The -enable-ipra flag can be used to override this.
Reimplemented in llvm::GCNTargetMachine.
Definition at line 524 of file TargetMachine.h.
Referenced by llvm::TargetPassConfig::TargetPassConfig().
|
inlinevirtual |
True if the target uses physical regs (as nearly all targets do).
False for stack machines such as WebAssembly and other virtual-register machines. If true, all vregs must be allocated before PEI. If false, then callee-save register spilling and scavenging are not needed or used. If false, implicitly defined registers will still be assumed to be physical registers, except that variadic defs will be allocated vregs.
Reimplemented in llvm::SPIRVTargetMachine, and llvm::WebAssemblyTargetMachine.
Definition at line 520 of file TargetMachine.h.
bool TargetMachine::useTLSDESC | ( | ) | const |
Returns true if this target uses TLS Descriptors.
Definition at line 261 of file TargetMachine.cpp.
References llvm::TargetOptions::EnableTLSDESC, and Options.
Referenced by GetTLSADDR().
Contains target specific asm information.
Definition at line 112 of file TargetMachine.h.
Referenced by llvm::BPFTargetMachine::BPFTargetMachine(), and llvm::CodeGenTargetMachineImpl::initAsmInfo().
|
protected |
Definition at line 107 of file TargetMachine.h.
Referenced by llvm::CodeGenTargetMachineImpl::CodeGenTargetMachineImpl().
|
staticconstexpr |
The integer bit size to use for SjLj based exception handling.
Definition at line 456 of file TargetMachine.h.
|
protected |
DataLayout for the target: keep ABI type size and alignment.
The DataLayout is created based on the string representation provided during construction. It is kept here only to avoid reparsing the string but should not really be used during compilation, because it has an internal cache that is context specific.
Definition at line 98 of file TargetMachine.h.
Referenced by isLargeGlobalValue().
|
protected |
Definition at line 108 of file TargetMachine.h.
Referenced by isLargeGlobalValue().
|
protected |
Definition at line 114 of file TargetMachine.h.
Referenced by llvm::CodeGenTargetMachineImpl::createMCStreamer(), and llvm::CodeGenTargetMachineImpl::initAsmInfo().
|
protected |
Definition at line 113 of file TargetMachine.h.
Referenced by llvm::CodeGenTargetMachineImpl::addPassesToEmitMC(), llvm::AMDGPUTargetMachine::AMDGPUTargetMachine(), llvm::CodeGenTargetMachineImpl::createMCStreamer(), and llvm::CodeGenTargetMachineImpl::initAsmInfo().
|
protected |
Definition at line 118 of file TargetMachine.h.
|
mutable |
Definition at line 124 of file TargetMachine.h.
Referenced by llvm::DwarfUnit::addAttribute(), llvm::TargetPassConfig::addCoreISelPasses(), llvm::DwarfDebug::addDwarfTypeUnitType(), llvm::TargetPassConfig::addMachinePasses(), llvm::CodeGenTargetMachineImpl::addPassesToEmitMC(), llvm::NVPTXTargetLowering::allowFMA(), llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), llvm::ARMFrameLowering::assignCalleeSavedSpillSlots(), llvm::DwarfCFIException::beginBasicBlockSection(), llvm::SelectionDAG::canCreateUndefOrPoison(), llvm::AArch64RegisterInfo::cannotEliminateFrame(), llvm::ARMBaseRegisterInfo::cannotEliminateFrame(), combineFaddCFmul(), combineFMinFMax(), combineFMinNumFMaxNum(), combineSelect(), llvm::DwarfUnit::constructTypeDIE(), llvm::CodeGenTargetMachineImpl::createMCStreamer(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::TargetFrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineCalleeSaves(), llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), llvm::PPCFrameLowering::eliminateCallFramePseudoInstr(), llvm::SelectionDAGBuilder::EmitBranchForMergedCondition(), llvm::AsmPrinter::emitCallGraphSection(), llvm::PPCFrameLowering::emitEpilogue(), llvm::AsmPrinter::emitFunctionBody(), llvm::X86AsmPrinter::emitInstruction(), llvm::AsmPrinter::emitJumpTableInfo(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::ScheduleDAGSDNodes::EmitSchedule(), llvm::AsmPrinter::emitStackSizeSection(), llvm::AsmPrinter::emitStackUsage(), llvm::AsmPrinter::emitXRayTable(), llvm::AsmPrinter::emitXXStructorList(), llvm::TargetLowering::expandFMINIMUMNUM_FMAXIMUMNUM(), foldFPToIntToFP(), llvm::GCNTTIImpl::getArithmeticInstrCost(), llvm::AsmPrinter::getConstantSectionSuffix(), llvm::TargetLoweringObjectFileXCOFF::getExplicitSectionGlobal(), llvm::AsmPrinter::getFunctionCFISectionType(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::TargetLowering::getNegatedExpression(), llvm::PPCTargetLowering::getNegatedExpression(), llvm::TargetLoweringBase::getPrefLoopAlignment(), llvm::RISCVMachineFunctionInfo::getPushPopKind(), llvm::ARMSubtarget::getPushPopSplitVariation(), llvm::X86RegisterInfo::getReservedRegs(), llvm::LoongArchTargetMachine::getSubtargetImpl(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::AArch64FrameLowering::hasFPImpl(), llvm::SIFrameLowering::hasFPImpl(), llvm::ARCFrameLowering::hasFPImpl(), llvm::ARMFrameLowering::hasFPImpl(), llvm::CSKYFrameLowering::hasFPImpl(), llvm::LoongArchFrameLowering::hasFPImpl(), llvm::M68kFrameLowering::hasFPImpl(), llvm::MipsFrameLowering::hasFPImpl(), llvm::MSP430FrameLowering::hasFPImpl(), llvm::RISCVFrameLowering::hasFPImpl(), llvm::SparcFrameLowering::hasFPImpl(), llvm::SystemZELFFrameLowering::hasFPImpl(), llvm::VEFrameLowering::hasFPImpl(), llvm::X86FrameLowering::hasFPImpl(), llvm::XCoreFrameLowering::hasFPImpl(), llvm::XtensaFrameLowering::hasFPImpl(), llvm::CodeGenTargetMachineImpl::initAsmInfo(), llvm::TargetLoweringObjectFileELF::Initialize(), isCombineInstrCandidateFP(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), llvm::AMDGPUCallLowering::isEligibleForTailCallOptimization(), llvm::SITargetLowering::isEligibleForTailCallOptimization(), isFMAddSubOrFMSubAdd(), llvm::ARMFrameLowering::isFPReserved(), llvm::TargetPassConfig::isGlobalISelAbortEnabled(), isLegalToCombineMinNumMaxNum(), llvm::AArch64TargetLowering::isProfitableToHoist(), llvm::PPCTargetLowering::isProfitableToHoist(), llvm::BasicTTIImplBase< T >::isSingleThreaded(), llvm::AMDGPULegalizerInfo::legalizeFExp(), llvm::SITargetLowering::LowerCall(), llvm::AArch64CallLowering::lowerCall(), llvm::RISCVTargetLowering::LowerCall(), llvm::SelectionDAGBuilder::LowerDeoptimizingReturn(), llvm::AMDGPUTargetLowering::lowerFEXP(), llvm::AMDGPUTargetLowering::LowerFLOGCommon(), LowerFMINIMUM_FMAXIMUM(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerTailCall(), llvm::PPCFrameLowering::needsFP(), llvm::MachineFunction::needsFrameMoves(), llvm::OptLevelChanger::OptLevelChanger(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), promoteToConstantPool(), llvm::TargetPassConfig::reportDiagnosticWhenGlobalISelFallback(), llvm::FastISel::selectOperator(), llvm::TargetLoweringObjectFileXCOFF::SelectSectionForGlobal(), llvm::AsmPrinter::SetupMachineFunction(), llvm::TargetPassConfig::TargetPassConfig(), llvm::DwarfCompileUnit::updateSubprogramScopeDIE(), useEmulatedTLS(), llvm::ARMSubtarget::useFastISel(), llvm::CSKYSubtarget::useHardFloatABI(), useTLSDESC(), and llvm::SelectionDAGBuilder::visitSPDescriptorFailure().
|
protected |
Definition at line 109 of file TargetMachine.h.
Referenced by llvm::CodeGenTargetMachineImpl::CodeGenTargetMachineImpl().
|
protected |
Definition at line 121 of file TargetMachine.h.
|
protected |
Definition at line 117 of file TargetMachine.h.
|
protected |
Definition at line 106 of file TargetMachine.h.
Referenced by llvm::CodeGenTargetMachineImpl::CodeGenTargetMachineImpl(), getRelocationModel(), getTLSModel(), and shouldAssumeDSOLocal().
|
protected |
Definition at line 115 of file TargetMachine.h.
Referenced by llvm::CodeGenTargetMachineImpl::addPassesToEmitMC(), llvm::AArch64TargetMachine::createMachineFunctionInfo(), llvm::GCNTargetMachine::createMachineFunctionInfo(), llvm::R600TargetMachine::createMachineFunctionInfo(), llvm::ARCTargetMachine::createMachineFunctionInfo(), llvm::ARMBaseTargetMachine::createMachineFunctionInfo(), llvm::AVRTargetMachine::createMachineFunctionInfo(), llvm::CSKYTargetMachine::createMachineFunctionInfo(), llvm::HexagonTargetMachine::createMachineFunctionInfo(), llvm::LanaiTargetMachine::createMachineFunctionInfo(), llvm::LoongArchTargetMachine::createMachineFunctionInfo(), llvm::M68kTargetMachine::createMachineFunctionInfo(), llvm::MipsTargetMachine::createMachineFunctionInfo(), llvm::MSP430TargetMachine::createMachineFunctionInfo(), llvm::NVPTXTargetMachine::createMachineFunctionInfo(), llvm::PPCTargetMachine::createMachineFunctionInfo(), llvm::RISCVTargetMachine::createMachineFunctionInfo(), llvm::SparcTargetMachine::createMachineFunctionInfo(), llvm::SystemZTargetMachine::createMachineFunctionInfo(), llvm::VETargetMachine::createMachineFunctionInfo(), llvm::WebAssemblyTargetMachine::createMachineFunctionInfo(), llvm::X86TargetMachine::createMachineFunctionInfo(), llvm::XCoreTargetMachine::createMachineFunctionInfo(), llvm::XtensaTargetMachine::createMachineFunctionInfo(), llvm::CodeGenTargetMachineImpl::createMCStreamer(), and llvm::CodeGenTargetMachineImpl::initAsmInfo().
|
protected |
Definition at line 103 of file TargetMachine.h.
Referenced by llvm::SystemZTargetMachine::getSubtargetImpl(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::CSKYTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::LoongArchTargetMachine::getSubtargetImpl(), llvm::M68kTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), and llvm::XtensaTargetMachine::getSubtargetImpl().
|
protected |
Definition at line 104 of file TargetMachine.h.
Referenced by llvm::SystemZTargetMachine::getSubtargetImpl(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::CSKYTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::LoongArchTargetMachine::getSubtargetImpl(), llvm::M68kTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), and llvm::XtensaTargetMachine::getSubtargetImpl().
|
protected |
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
Definition at line 102 of file TargetMachine.h.
Referenced by llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), llvm::GCNTargetMachine::getSubtargetImpl(), llvm::R600TargetMachine::getSubtargetImpl(), llvm::SystemZTargetMachine::getSubtargetImpl(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::CSKYTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::LoongArchTargetMachine::getSubtargetImpl(), llvm::M68kTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::XtensaTargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), and llvm::ARMBaseTargetMachine::isTargetHardFloat().
The Target that this machine was created for.
Definition at line 90 of file TargetMachine.h.
Referenced by llvm::CodeGenTargetMachineImpl::initAsmInfo().