LLVM  8.0.1
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
llvm::TargetMachine Class Reference

Primary interface to the complete machine description for the target machine. More...

#include "llvm/Target/TargetMachine.h"

Inheritance diagram for llvm::TargetMachine:
Inheritance graph
[legend]
Collaboration diagram for llvm::TargetMachine:
Collaboration graph
[legend]

Public Types

enum  CodeGenFileType { CGFT_AssemblyFile, CGFT_ObjectFile, CGFT_Null }
 These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit, and returned by it to indicate what type of file could actually be made. More...
 

Public Member Functions

 TargetMachine (const TargetMachine &)=delete
 
void operator= (const TargetMachine &)=delete
 
virtual ~TargetMachine ()
 
const TargetgetTarget () const
 
const TriplegetTargetTriple () const
 
StringRef getTargetCPU () const
 
StringRef getTargetFeatureString () const
 
virtual const TargetSubtargetInfogetSubtargetImpl (const Function &) const
 Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInfo-derived member variable. More...
 
virtual TargetLoweringObjectFilegetObjFileLowering () const
 
template<typename STC >
const STC & getSubtarget (const Function &F) const
 This method returns a pointer to the specified type of TargetSubtargetInfo. More...
 
const DataLayout createDataLayout () const
 Create a DataLayout. More...
 
bool isCompatibleDataLayout (const DataLayout &Candidate) const
 Test if a DataLayout if compatible with the CodeGen for this target. More...
 
unsigned getPointerSize (unsigned AS) const
 Get the pointer size for this target. More...
 
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. More...
 
const MCAsmInfogetMCAsmInfo () const
 Return target specific asm information. More...
 
const MCRegisterInfogetMCRegisterInfo () const
 
const MCInstrInfogetMCInstrInfo () const
 
const MCSubtargetInfogetMCSubtargetInfo () const
 
virtual const TargetIntrinsicInfogetIntrinsicInfo () const
 If intrinsic information is available, return it. If not, return null. More...
 
bool requiresStructuredCFG () const
 
void setRequiresStructuredCFG (bool Value)
 
Reloc::Model getRelocationModel () const
 Returns the code generation relocation model. More...
 
CodeModel::Model getCodeModel () const
 Returns the code model. More...
 
bool isPositionIndependent () const
 
bool shouldAssumeDSOLocal (const Module &M, const GlobalValue *GV) const
 
bool useEmulatedTLS () const
 Returns true if this target uses emulated TLS. More...
 
TLSModel::Model getTLSModel (const GlobalValue *GV) const
 Returns the TLS model which should be used for the given global variable. More...
 
CodeGenOpt::Level getOptLevel () const
 Returns the optimization level: None, Less, Default, or Aggressive. More...
 
void setOptLevel (CodeGenOpt::Level Level)
 Overrides the optimization level. More...
 
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)
 
bool shouldPrintMachineCode () const
 
bool getUniqueSectionNames () const
 
bool getDataSections () const
 Return true if data objects should be emitted into their own section, corresponds to -fdata-sections. More...
 
bool getFunctionSections () const
 Return true if functions should be emitted into their own section, corresponding to -ffunction-sections. More...
 
TargetIRAnalysis getTargetIRAnalysis ()
 Get a TargetIRAnalysis appropriate for the target. More...
 
virtual TargetTransformInfo getTargetTransformInfo (const Function &F)
 Return a TargetTransformInfo for a given function. More...
 
virtual void adjustPassManager (PassManagerBuilder &)
 Allow the target to modify the pass manager, e.g. More...
 
virtual bool addPassesToEmitFile (PassManagerBase &, raw_pwrite_stream &, raw_pwrite_stream *, CodeGenFileType, bool=true, MachineModuleInfo *MMI=nullptr)
 Add passes to the specified pass manager to get the specified file emitted. More...
 
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. More...
 
virtual bool targetSchedulesPostRAScheduling () const
 True if subtarget inserts the final scheduling pass on its own. More...
 
void getNameWithPrefix (SmallVectorImpl< char > &Name, const GlobalValue *GV, Mangler &Mang, bool MayAlwaysUsePrivate=false) const
 
MCSymbolgetSymbol (const GlobalValue *GV) const
 

Public Attributes

const TargetOptions DefaultOptions
 
TargetOptions Options
 

Protected Member Functions

 TargetMachine (const Target &T, StringRef DataLayoutString, const Triple &TargetTriple, StringRef CPU, StringRef FS, const TargetOptions &Options)
 

Protected Attributes

const TargetTheTarget
 The Target that this machine was created for. More...
 
const DataLayout DL
 DataLayout for the target: keep ABI type size and alignment. More...
 
Triple TargetTriple
 Triple string, CPU name, and target feature strings the TargetMachine instance is created with. More...
 
std::string TargetCPU
 
std::string TargetFS
 
Reloc::Model RM = Reloc::Static
 
CodeModel::Model CMModel = CodeModel::Small
 
CodeGenOpt::Level OptLevel = CodeGenOpt::Default
 
std::unique_ptr< const MCAsmInfoAsmInfo
 Contains target specific asm information. More...
 
std::unique_ptr< const MCRegisterInfoMRI
 
std::unique_ptr< const MCInstrInfoMII
 
std::unique_ptr< const MCSubtargetInfoSTI
 
unsigned RequireStructuredCFG: 1
 
unsigned O0WantsFastISel: 1
 

Detailed Description

Primary interface to the complete machine description for the target machine.

All target-specific information should be accessible through this interface.

Definition at line 59 of file TargetMachine.h.

Member Enumeration Documentation

◆ CodeGenFileType

These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit, and returned by it to indicate what type of file could actually be made.

Enumerator
CGFT_AssemblyFile 
CGFT_ObjectFile 
CGFT_Null 

Definition at line 250 of file TargetMachine.h.

Constructor & Destructor Documentation

◆ TargetMachine() [1/2]

TargetMachine::TargetMachine ( const Target T,
StringRef  DataLayoutString,
const Triple TargetTriple,
StringRef  CPU,
StringRef  FS,
const TargetOptions Options 
)
protected

Definition at line 35 of file TargetMachine.cpp.

References ~TargetMachine().

◆ TargetMachine() [2/2]

llvm::TargetMachine::TargetMachine ( const TargetMachine )
delete

◆ ~TargetMachine()

TargetMachine::~TargetMachine ( )
virtualdefault

Referenced by TargetMachine().

Member Function Documentation

◆ addPassesToEmitFile()

virtual bool llvm::TargetMachine::addPassesToEmitFile ( PassManagerBase ,
raw_pwrite_stream ,
raw_pwrite_stream ,
CodeGenFileType  ,
bool  = true,
MachineModuleInfo MMI = nullptr 
)
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. MMI is an optional parameter that, if set to non-nullptr, will be used to set the MachineModuloInfo for this PM.

Reimplemented in llvm::LLVMTargetMachine.

Definition at line 262 of file TargetMachine.h.

Referenced by LLVMTargetMachineEmit().

◆ addPassesToEmitMC()

virtual bool llvm::TargetMachine::addPassesToEmitMC ( PassManagerBase ,
MCContext *&  ,
raw_pwrite_stream ,
bool  = true 
)
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::LLVMTargetMachine, and llvm::NVPTXTargetMachine.

Definition at line 274 of file TargetMachine.h.

Referenced by llvm::orc::SimpleCompiler::operator()().

◆ adjustPassManager()

virtual void llvm::TargetMachine::adjustPassManager ( PassManagerBuilder )
inlinevirtual

Allow the target to modify the pass manager, e.g.

by calling PassManagerBuilder::addExtension.

Reimplemented in llvm::NVPTXTargetMachine, llvm::AMDGPUTargetMachine, and llvm::HexagonTargetMachine.

Definition at line 245 of file TargetMachine.h.

◆ createDataLayout()

const DataLayout llvm::TargetMachine::createDataLayout ( ) const
inline

Create a DataLayout.

Definition at line 126 of file TargetMachine.h.

Referenced by llvm::ComputeSignatureVTs(), and LLVMTargetMachineEmit().

◆ getAllocaPointerSize()

unsigned llvm::TargetMachine::getAllocaPointerSize ( ) const
inline

◆ getCodeModel()

CodeModel::Model TargetMachine::getCodeModel ( ) const

Returns the code model.

The choices are small, kernel, medium, large, and target default.

Definition at line 87 of file TargetMachine.cpp.

References CMModel.

Referenced by llvm::AArch64TargetLowering::AArch64TargetLowering(), llvm::X86FrameLowering::adjustForSegmentedStacks(), callsShareTOCBase(), llvm::AArch64Subtarget::classifyGlobalFunctionReference(), llvm::PPCSubtarget::classifyGlobalReference(), llvm::AArch64Subtarget::ClassifyGlobalReference(), llvm::X86Subtarget::classifyGlobalReference(), llvm::X86Subtarget::classifyLocalReference(), emitPostSt(), llvm::ARMFrameLowering::emitPrologue(), llvm::X86TargetLowering::findRepresentativeClass(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::X86InstrInfo::getGlobalBaseReg(), getMOVL(), llvm::PPCTargetLowering::getPICJumpTableRelocBase(), llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), getRetpolineSymbol(), llvm::X86InstrInfo::getSerializableDirectMachineOperandTargetFlags(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::TargetLoweringObjectFile::Initialize(), llvm::X86FrameLowering::inlineStackProbe(), llvm::PPCTargetLowering::isAccessedAsGotIndirect(), isEFLAGSLive(), llvm::LanaiTargetObjectFile::isGlobalInSmallSection(), llvm::X86TargetLowering::isLegalAddressingMode(), IsSmallObject(), llvm::LanaiTargetLowering::LowerConstantPool(), LowerEXTRACT_SUBVECTOR(), llvm::LanaiTargetLowering::LowerJumpTable(), llvm::SparcTargetLowering::makeAddress(), mayTailCallThisCC(), mayUseP9Setb(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), trySequenceOfOnes(), and llvm::AArch64Subtarget::useSmallAddressing().

◆ getDataSections()

bool llvm::TargetMachine::getDataSections ( ) const
inline

◆ getFunctionSections()

bool llvm::TargetMachine::getFunctionSections ( ) const
inline

◆ getIntrinsicInfo()

virtual const TargetIntrinsicInfo* llvm::TargetMachine::getIntrinsicInfo ( ) const
inlinevirtual

If intrinsic information is available, return it. If not, return null.

Reimplemented in llvm::GCNTargetMachine.

Definition at line 169 of file TargetMachine.h.

Referenced by llvm::SDNode::getOperationName(), llvm::SelectionDAGISel::isOrEquivalentToAdd(), and llvm::MIPrinter::print().

◆ getMCAsmInfo()

const MCAsmInfo* llvm::TargetMachine::getMCAsmInfo ( ) const
inline

◆ getMCInstrInfo()

const MCInstrInfo* llvm::TargetMachine::getMCInstrInfo ( ) const
inline

◆ getMCRegisterInfo()

const MCRegisterInfo* llvm::TargetMachine::getMCRegisterInfo ( ) const
inline

◆ getMCSubtargetInfo()

const MCSubtargetInfo* llvm::TargetMachine::getMCSubtargetInfo ( ) const
inline

◆ getNameWithPrefix()

void TargetMachine::getNameWithPrefix ( SmallVectorImpl< char > &  Name,
const GlobalValue GV,
Mangler Mang,
bool  MayAlwaysUsePrivate = false 
) const

◆ getO0WantsFastISel()

bool llvm::TargetMachine::getO0WantsFastISel ( )
inline

◆ getObjFileLowering()

virtual TargetLoweringObjectFile* llvm::TargetMachine::getObjFileLowering ( ) const
inlinevirtual

◆ getOptLevel()

CodeGenOpt::Level TargetMachine::getOptLevel ( ) const

Returns the optimization level: None, Less, Default, or Aggressive.

Definition at line 239 of file TargetMachine.cpp.

References OptLevel.

Referenced by llvm::AArch64beTargetMachine::AArch64beTargetMachine(), llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::TargetPassConfig::addCoreISelPasses(), llvm::AMDGPUTargetMachine::adjustPassManager(), llvm::ARMBETargetMachine::ARMBETargetMachine(), llvm::ARMTargetLowering::ARMTargetLowering(), AssignProtectedObjSet(), llvm::CodeViewDebug::beginFunctionImpl(), llvm::BPFTargetMachine::createPassConfig(), llvm::WebAssemblyTargetMachine::createPassConfig(), llvm::MSP430TargetMachine::createPassConfig(), llvm::HexagonTargetMachine::createPassConfig(), llvm::ARCTargetMachine::createPassConfig(), llvm::XCoreTargetMachine::createPassConfig(), llvm::AArch64TargetMachine::createPassConfig(), llvm::PPCTargetMachine::createPassConfig(), llvm::X86TargetMachine::createPassConfig(), llvm::ARMBaseTargetMachine::createPassConfig(), llvm::MipsTargetMachine::createPassConfig(), llvm::R600TargetMachine::createPassConfig(), emitBasicBlockLoopComments(), llvm::HexagonFrameLowering::getAlignaInstr(), llvm::HexagonFrameLowering::getFrameIndexReference(), llvm::PPCInstrInfo::getMachineCombinerPatterns(), llvm::TargetPassConfig::getOptLevel(), llvm::AVRTargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::NVPTXTargetMachine::getTargetTransformInfo(), llvm::GCNTargetMachine::getTargetTransformInfo(), llvm::HexagonFrameLowering::hasFP(), hoistAndMergeSGPRInits(), isOptNone(), mayUseP9Setb(), PerformSETCCCombine(), reservePrivateMemoryRegs(), llvm::ARMAsmPrinter::runOnMachineFunction(), selectI64Imm(), llvm::AArch64TargetLowering::shouldExpandAtomicCmpXchgInIR(), llvm::SystemZTargetMachine::SystemZTargetMachine(), and llvm::X86TargetLowering::X86TargetLowering().

◆ getPointerSize()

unsigned llvm::TargetMachine::getPointerSize ( unsigned  AS) const
inline

Get the pointer size for this target.

This is the only time the DataLayout in the TargetMachine is used.

Definition at line 140 of file TargetMachine.h.

References llvm::DataLayout::getPointerSize().

Referenced by llvm::AsmPrinter::getPointerSize(), llvm::SparcTargetLowering::SparcTargetLowering(), and llvm::SystemZTargetLowering::SystemZTargetLowering().

◆ getPointerSizeInBits()

unsigned llvm::TargetMachine::getPointerSizeInBits ( unsigned  AS) const
inline

◆ getProgramPointerSize()

unsigned llvm::TargetMachine::getProgramPointerSize ( ) const
inline

◆ getRelocationModel()

Reloc::Model TargetMachine::getRelocationModel ( ) const

◆ getSubtarget()

template<typename STC >
const STC& llvm::TargetMachine::getSubtarget ( const Function F) const
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 121 of file TargetMachine.h.

Referenced by llvm::ComputeLegalValueVTs(), llvm::AMDGPUSubtarget::get(), getMulHu(), getNarrowIntrinsic(), getOpenCLAlignment(), isExecuteOnlyFunction(), llvm::PhysicalRegisterUsageInfo::print(), and VisitGlobalVariableForEmission().

◆ getSubtargetImpl()

virtual const TargetSubtargetInfo* llvm::TargetMachine::getSubtargetImpl ( const Function ) const
inlinevirtual

◆ getSymbol()

MCSymbol * TargetMachine::getSymbol ( const GlobalValue GV) const

◆ getTarget()

const Target& llvm::TargetMachine::getTarget ( ) const
inline

◆ getTargetCPU()

StringRef llvm::TargetMachine::getTargetCPU ( ) const
inline

◆ getTargetFeatureString()

StringRef llvm::TargetMachine::getTargetFeatureString ( ) const
inline

◆ getTargetIRAnalysis()

TargetIRAnalysis TargetMachine::getTargetIRAnalysis ( )

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 267 of file TargetMachine.cpp.

References F(), and getTargetTransformInfo().

Referenced by llvm::TargetPassConfig::addISelPasses().

◆ getTargetTransformInfo()

TargetTransformInfo TargetMachine::getTargetTransformInfo ( const Function F)
virtual

◆ getTargetTriple()

const Triple& llvm::TargetMachine::getTargetTriple ( ) const
inline

Definition at line 105 of file TargetMachine.h.

Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), llvm::LLVMTargetMachine::addPassesToEmitMC(), llvm::ARMBETargetMachine::ARMBETargetMachine(), checkFunctionsAttributeConsistency(), createPPCAsmPrinterPass(), llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), llvm::ARMAsmPrinter::EmitEndOfAsmFile(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::AMDGPUAsmPrinter::EmitEndOfAsmFile(), llvm::X86FrameLowering::emitEpilogue(), llvm::AsmPrinter::EmitFunctionBody(), llvm::AMDGPUAsmPrinter::EmitFunctionBodyEnd(), llvm::AMDGPUAsmPrinter::EmitFunctionEntryLabel(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), llvm::AMDGPUAsmPrinter::EmitStartOfAsmFile(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), findUser(), llvm::AMDGPUSubtarget::get(), getCOFFSectionFlags(), llvm::AArch64MCInstLower::GetGlobalAddressSymbol(), llvm::ARMAsmPrinter::getISAEncoding(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::GCNTargetMachine::getTargetTransformInfo(), getUnderlyingArgReg(), llvm::LLVMTargetMachine::initAsmInfo(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::TargetLoweringObjectFile::Initialize(), llvm::TargetLoweringObjectFileCOFF::Initialize(), llvm::MipsSubtarget::initializeSubtargetDependencies(), llvm::PPCTargetMachine::isPPC64(), LLVMOrcCreateInstance(), llvm::TargetLoweringObjectFileCOFF::lowerRelativeReference(), llvm::AArch64MCInstLower::LowerSymbolOperand(), MatchingStackOffset(), mayTailCallThisCC(), llvm::StackProtector::runOnFunction(), llvm::AMDGPUTargetObjectFile::SelectSectionForGlobal(), shouldAssumeDSOLocal(), shouldLowerMemFuncForSize(), llvm::TargetLoweringBase::TargetLoweringBase(), trySequenceOfOnes(), llvm::OrcCBindingsStack::UnregisterJITEventListener(), llvm::DwarfCompileUnit::updateSubprogramScopeDIE(), useEmulatedTLS(), and llvm::WinException::WinException().

◆ getTLSModel()

TLSModel::Model TargetMachine::getTLSModel ( const GlobalValue GV) const

◆ getUniqueSectionNames()

bool llvm::TargetMachine::getUniqueSectionNames ( ) const
inline

◆ isCompatibleDataLayout()

bool llvm::TargetMachine::isCompatibleDataLayout ( const DataLayout Candidate) const
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 133 of file TargetMachine.h.

◆ isPositionIndependent()

bool TargetMachine::isPositionIndependent ( ) const

◆ operator=()

void llvm::TargetMachine::operator= ( const TargetMachine )
delete

◆ requiresStructuredCFG()

bool llvm::TargetMachine::requiresStructuredCFG ( ) const
inline

◆ resetTargetOptions()

void TargetMachine::resetTargetOptions ( const Function F) const

◆ setFastISel()

void llvm::TargetMachine::setFastISel ( bool  Enable)
inline

◆ setGlobalISel()

void llvm::TargetMachine::setGlobalISel ( bool  Enable)
inline

◆ setGlobalISelAbort()

void llvm::TargetMachine::setGlobalISelAbort ( GlobalISelAbortMode  Mode)
inline

◆ setMachineOutliner()

void llvm::TargetMachine::setMachineOutliner ( bool  Enable)
inline

◆ setO0WantsFastISel()

void llvm::TargetMachine::setO0WantsFastISel ( bool  Enable)
inline

Definition at line 202 of file TargetMachine.h.

Referenced by llvm::TargetPassConfig::addCoreISelPasses().

◆ setOptLevel()

void TargetMachine::setOptLevel ( CodeGenOpt::Level  Level)

Overrides the optimization level.

Definition at line 241 of file TargetMachine.cpp.

References OptLevel.

Referenced by llvm::OptLevelChanger::OptLevelChanger(), and llvm::OptLevelChanger::~OptLevelChanger().

◆ setRequiresStructuredCFG()

void llvm::TargetMachine::setRequiresStructuredCFG ( bool  Value)
inline

◆ setSupportsDefaultOutlining()

void llvm::TargetMachine::setSupportsDefaultOutlining ( bool  Enable)
inline

◆ shouldAssumeDSOLocal()

bool TargetMachine::shouldAssumeDSOLocal ( const Module M,
const GlobalValue GV 
) const

Definition at line 107 of file TargetMachine.cpp.

References assert(), llvm::PIELevel::Default, llvm::Reloc::DynamicNoPIC, F(), llvm::Triple::getArch(), llvm::Module::getPIELevel(), getRelocationModel(), llvm::Module::getRtLibUseGOT(), getTargetTriple(), llvm::GlobalValue::hasDefaultVisibility(), llvm::GlobalValue::hasDLLImportStorageClass(), llvm::GlobalValue::hasExternalWeakLinkage(), llvm::Function::hasFnAttribute(), llvm::GlobalValue::isDeclarationForLinker(), llvm::GlobalValue::isDSOLocal(), llvm::Triple::isOSBinFormatCOFF(), llvm::Triple::isOSBinFormatELF(), llvm::Triple::isOSBinFormatMachO(), llvm::Triple::isOSWindows(), isPositionIndependent(), llvm::GlobalValue::isStrongDefinitionForLinker(), llvm::GlobalValue::isThreadLocal(), llvm::Triple::isWindowsGNUEnvironment(), llvm::TargetOptions::MCOptions, llvm::MCTargetOptions::MCPIECopyRelocations, llvm::Attribute::NonLazyBind, Options, llvm::Triple::ppc, llvm::Triple::ppc64, llvm::Triple::ppc64le, RM, and llvm::Reloc::Static.

Referenced by callsShareTOCBase(), llvm::ARMTargetLowering::CCAssignFnForReturn(), llvm::AArch64Subtarget::classifyGlobalFunctionReference(), llvm::X86Subtarget::classifyGlobalFunctionReference(), llvm::PPCSubtarget::classifyGlobalReference(), llvm::AArch64Subtarget::ClassifyGlobalReference(), llvm::X86Subtarget::classifyGlobalReference(), combineADDToADDZE(), findUser(), getTLSModel(), llvm::PPCSubtarget::hasLazyResolverStub(), llvm::ARMSubtarget::isGVIndirectSymbol(), llvm::ARMSubtarget::isGVInGOT(), llvm::TargetLowering::isOffsetFoldingLegal(), llvm::SystemZSubtarget::isPC32DBLSymbol(), llvm::ARMTargetLowering::isReadOnly(), and PrepareCall().

◆ shouldPrintMachineCode()

bool llvm::TargetMachine::shouldPrintMachineCode ( ) const
inline

◆ targetSchedulesPostRAScheduling()

virtual bool llvm::TargetMachine::targetSchedulesPostRAScheduling ( ) const
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::SystemZTargetMachine.

Definition at line 285 of file TargetMachine.h.

References llvm::object::getSymbol(), and Name.

Referenced by llvm::TargetPassConfig::addMachinePasses().

◆ useEmulatedTLS()

bool TargetMachine::useEmulatedTLS ( ) const

Member Data Documentation

◆ AsmInfo

std::unique_ptr<const MCAsmInfo> llvm::TargetMachine::AsmInfo
protected

Contains target specific asm information.

Definition at line 87 of file TargetMachine.h.

Referenced by llvm::BPFTargetMachine::BPFTargetMachine(), and llvm::LLVMTargetMachine::initAsmInfo().

◆ CMModel

CodeModel::Model llvm::TargetMachine::CMModel = CodeModel::Small
protected

Definition at line 83 of file TargetMachine.h.

Referenced by getCodeModel(), and llvm::LLVMTargetMachine::LLVMTargetMachine().

◆ DefaultOptions

const TargetOptions llvm::TargetMachine::DefaultOptions

Definition at line 96 of file TargetMachine.h.

Referenced by resetTargetOptions().

◆ DL

const DataLayout llvm::TargetMachine::DL
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 74 of file TargetMachine.h.

◆ MII

std::unique_ptr<const MCInstrInfo> llvm::TargetMachine::MII
protected

◆ MRI

std::unique_ptr<const MCRegisterInfo> llvm::TargetMachine::MRI
protected

◆ O0WantsFastISel

unsigned llvm::TargetMachine::O0WantsFastISel
protected

Definition at line 93 of file TargetMachine.h.

◆ Options

TargetOptions llvm::TargetMachine::Options
mutable

Definition at line 97 of file TargetMachine.h.

Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), llvm::TargetPassConfig::addCoreISelPasses(), llvm::TargetPassConfig::addMachinePasses(), llvm::LLVMTargetMachine::addPassesToEmitMC(), llvm::AMDGPUTargetMachine::adjustPassManager(), llvm::NVPTXTargetLowering::allowFMA(), llvm::NVPTXTargetLowering::allowUnsafeFPMath(), areCallingConvEligibleForTCO_64SVR4(), llvm::ARMTargetLowering::ARMTargetLowering(), AssignProtectedObjSet(), llvm::DwarfDebug::beginModule(), CallingConvSupported(), llvm::AArch64RegisterInfo::cannotEliminateFrame(), llvm::ARMBaseRegisterInfo::cannotEliminateFrame(), llvm::AArch64TargetLowering::CCAssignFnForReturn(), checkFunctionsAttributeConsistency(), combineFMinFMax(), combineFMinNumFMaxNum(), combineSelect(), llvm::MipsTargetLowering::createFastISel(), CreatePrologue(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineCalleeSaves(), llvm::TargetFrameLowering::determineCalleeSaves(), llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), llvm::PPCFrameLowering::eliminateCallFramePseudoInstr(), llvm::PPCFrameLowering::emitEpilogue(), EmitGCCInlineAsmStr(), llvm::X86AsmPrinter::EmitInstruction(), llvm::AsmPrinter::emitStackSizeSection(), EmitVectorComparison(), EnsureStackAlignment(), foldFPToIntToFP(), FoldIntToFPToInt(), FPCCToARMCC(), getComparePred(), llvm::X86ELFTargetObjectFile::getDebugThreadLocalSymbol(), llvm::NVPTXTargetLowering::getDivF32Level(), getFPTernOp(), llvm::TargetLoweringObjectFile::getKindForGlobal(), getLoadExtOrTrunc(), llvm::PPCInstrInfo::getMachineCombinerPatterns(), getMad64_32(), getMOVL(), GetNegatedExpression(), getOffsetFromIndices(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::MipsFrameLowering::hasFP(), llvm::SparcFrameLowering::hasFP(), llvm::RISCVFrameLowering::hasFP(), llvm::SystemZFrameLowering::hasFP(), llvm::MSP430FrameLowering::hasFP(), llvm::XCoreFrameLowering::hasFP(), llvm::ARMFrameLowering::hasFP(), llvm::ARCFrameLowering::hasFP(), llvm::AArch64FrameLowering::hasFP(), llvm::HexagonFrameLowering::hasFP(), llvm::X86FrameLowering::hasFP(), llvm::LLVMTargetMachine::initAsmInfo(), llvm::HexagonTargetObjectFile::Initialize(), llvm::SparcELFTargetObjectFile::Initialize(), llvm::LanaiTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), llvm::AArch64InstrInfo::isAssociativeAndCommutative(), llvm::X86InstrInfo::isAssociativeAndCommutative(), isClampZeroToOne(), isCombineInstrCandidateFP(), isContractable(), llvm::SITargetLowering::isEligibleForTailCallOptimization(), isFMAddSubOrFMSubAdd(), llvm::TargetPassConfig::isGlobalISelAbortEnabled(), llvm::isInTailCallPosition(), isLegalToCombineMinNumMaxNum(), llvm::AArch64TargetLowering::isProfitableToHoist(), isSortedByValueNo(), llvm::SITargetLowering::LowerCall(), llvm::AMDGPUTargetLowering::LowerFP_TO_FP16(), lowerUINT_TO_FP_vXi32(), MatchingStackOffset(), mayTailCallThisCC(), llvm::PPCFrameLowering::needsFP(), llvm::OptLevelChanger::OptLevelChanger(), llvm::PPCTargetLowering::PPCTargetLowering(), PrepareCall(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), promoteToConstantPool(), llvm::TargetPassConfig::reportDiagnosticWhenGlobalISelFallback(), resetTargetOptions(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::EngineBuilder::selectTarget(), llvm::AsmPrinter::SetupMachineFunction(), shouldAssumeDSOLocal(), shouldGuaranteeTCO(), llvm::ARMSubtarget::splitFramePushPop(), llvm::TargetPassConfig::TargetPassConfig(), llvm::SelectionDAGBuilder::UpdateSplitBlock(), llvm::DwarfCompileUnit::updateSubprogramScopeDIE(), useEmulatedTLS(), llvm::ARMSubtarget::useFastISel(), llvm::NVPTXTargetLowering::usePrecSqrtF32(), widenVec(), and llvm::X86TargetLowering::X86TargetLowering().

◆ OptLevel

CodeGenOpt::Level llvm::TargetMachine::OptLevel = CodeGenOpt::Default
protected

◆ RequireStructuredCFG

unsigned llvm::TargetMachine::RequireStructuredCFG
protected

Definition at line 92 of file TargetMachine.h.

◆ RM

Reloc::Model llvm::TargetMachine::RM = Reloc::Static
protected

◆ STI

std::unique_ptr<const MCSubtargetInfo> llvm::TargetMachine::STI
protected

◆ TargetCPU

std::string llvm::TargetMachine::TargetCPU
protected

◆ TargetFS

std::string llvm::TargetMachine::TargetFS
protected

◆ TargetTriple

Triple llvm::TargetMachine::TargetTriple
protected

◆ TheTarget

const Target& llvm::TargetMachine::TheTarget
protected

The Target that this machine was created for.

Definition at line 66 of file TargetMachine.h.

Referenced by llvm::LLVMTargetMachine::initAsmInfo().


The documentation for this class was generated from the following files: