LLVM  14.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | Static 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 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
 
void setTargetFeatureString (StringRef FS)
 
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
 
virtual yaml::MachineFunctionInfocreateDefaultFuncInfoYAML () const
 Allocate and return a default initialized instance of the YAML representation for the MachineFunctionInfo. More...
 
virtual yaml::MachineFunctionInfoconvertFuncInfoToYAML (const MachineFunction &MF) const
 Allocate and initialize an instance of the YAML representation of the MachineFunctionInfo. More...
 
virtual bool parseMachineFunctionInfo (const yaml::MachineFunctionInfo &, PerFunctionMIParsingState &PFS, SMDiagnostic &Error, SMRange &SourceRange) const
 Parse out the target's MachineFunctionInfo from the YAML reprsentation. More...
 
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)
 
void setSupportsDebugEntryValues (bool Enable)
 
bool getAIXExtendedAltivecABI () const
 
bool getUniqueSectionNames () const
 
bool getUniqueBasicBlockSectionNames () const
 Return true if unique basic block section names must be generated. More...
 
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...
 
bool getIgnoreXCOFFVisibility () const
 Return true if visibility attribute should not be emitted in XCOFF, corresponding to -mignore-xcoff-visibility. More...
 
bool getXCOFFTracebackTable () const
 Return true if XCOFF traceback table should be emitted, corresponding to -xcoff-traceback-table. More...
 
llvm::BasicBlockSection getBBSectionsType () const
 If basic blocks should be emitted into their own section, corresponding to -fbasic-block-sections. More...
 
const MemoryBuffergetBBSectionsFuncListBuf () const
 Get the list of functions and basic block ids that need unique sections. More...
 
virtual bool isNoopAddrSpaceCast (unsigned SrcAS, unsigned DestAS) const
 Returns true if a cast between SrcAS and DestAS is a noop. More...
 
void setPGOOption (Optional< PGOOptions > PGOOpt)
 
const 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. 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 void registerPassBuilderCallbacks (PassBuilder &)
 Allow the target to modify the pass pipeline with New Pass Manager (similar to adjustPassManager for Legacy Pass manager). More...
 
virtual void registerDefaultAliasAnalyses (AAManager &)
 Allow the target to register alias analyses with the AAManager for use with the new pass manager. More...
 
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. 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
 
virtual unsigned getSjLjDataSize () const
 

Static Public Member Functions

static std::pair< int, intparseBinutilsVersion (StringRef Version)
 

Public Attributes

const TargetOptions DefaultOptions
 
TargetOptions Options
 

Static Public Attributes

static constexpr unsigned DefaultSjLjDataSize = 32
 The integer bit size to use for SjLj based exception handling. More...
 

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
 
Optional< PGOOptionsPGOOption = None
 

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

References string.

◆ TargetMachine() [2/2]

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

◆ ~TargetMachine()

TargetMachine::~TargetMachine ( )
virtualdefault

Member Function Documentation

◆ addPassesToEmitFile()

virtual bool llvm::TargetMachine::addPassesToEmitFile ( PassManagerBase ,
raw_pwrite_stream ,
raw_pwrite_stream ,
CodeGenFileType  ,
bool  = true,
MachineModuleInfoWrapperPass MMIWP = 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. MMIWP 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 354 of file TargetMachine.h.

◆ 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 366 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::HexagonTargetMachine, llvm::NVPTXTargetMachine, llvm::AMDGPUTargetMachine, and llvm::BPFTargetMachine.

Definition at line 337 of file TargetMachine.h.

◆ convertFuncInfoToYAML()

virtual yaml::MachineFunctionInfo* llvm::TargetMachine::convertFuncInfoToYAML ( const MachineFunction MF) const
inlinevirtual

Allocate and initialize an instance of the YAML representation of the MachineFunctionInfo.

Reimplemented in llvm::GCNTargetMachine, llvm::WebAssemblyTargetMachine, and llvm::AArch64TargetMachine.

Definition at line 151 of file TargetMachine.h.

◆ createDataLayout()

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

Create a DataLayout.

Definition at line 171 of file TargetMachine.h.

References DL.

◆ createDefaultFuncInfoYAML()

virtual yaml::MachineFunctionInfo* llvm::TargetMachine::createDefaultFuncInfoYAML ( ) const
inlinevirtual

Allocate and return a default initialized instance of the YAML representation for the MachineFunctionInfo.

Reimplemented in llvm::GCNTargetMachine, llvm::WebAssemblyTargetMachine, and llvm::AArch64TargetMachine.

Definition at line 144 of file TargetMachine.h.

◆ getAIXExtendedAltivecABI()

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

◆ getAllocaPointerSize()

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

◆ getAssumedAddrSpace()

virtual unsigned llvm::TargetMachine::getAssumedAddrSpace ( const Value V) const
inlinevirtual

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 320 of file TargetMachine.h.

Referenced by llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getAssumedAddrSpace().

◆ getBBSectionsFuncListBuf()

const MemoryBuffer* llvm::TargetMachine::getBBSectionsFuncListBuf ( ) const
inline

Get the list of functions and basic block ids that need unique sections.

Definition at line 302 of file TargetMachine.h.

References llvm::TargetOptions::BBSectionsFuncListBuf, and Options.

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

◆ getBBSectionsType()

llvm::BasicBlockSection llvm::TargetMachine::getBBSectionsType ( ) const
inline

If basic blocks should be emitted into their own section, corresponding to -fbasic-block-sections.

Definition at line 297 of file TargetMachine.h.

References llvm::TargetOptions::BBSections, and Options.

Referenced by llvm::TargetPassConfig::addMachinePasses(), and llvm::MIRParserImpl::initializeMachineFunction().

◆ getCodeModel()

CodeModel::Model TargetMachine::getCodeModel ( ) const

◆ getDataSections()

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

◆ getFunctionSections()

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

◆ getIgnoreXCOFFVisibility()

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

Return true if visibility attribute should not be emitted in XCOFF, corresponding to -mignore-xcoff-visibility.

Definition at line 287 of file TargetMachine.h.

References llvm::TargetOptions::IgnoreXCOFFVisibility, and Options.

◆ getIntrinsicInfo()

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

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

Definition at line 214 of file TargetMachine.h.

◆ 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

◆ getPGOOption()

const Optional<PGOOptions>& llvm::TargetMachine::getPGOOption ( ) const
inline

Definition at line 312 of file TargetMachine.h.

References PGOOption.

◆ 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 185 of file TargetMachine.h.

References DL, and llvm::DataLayout::getPointerSize().

Referenced by llvm::AsmPrinter::getPointerSize(), and llvm::X86TargetMachine::isNoopAddrSpaceCast().

◆ getPointerSizeInBits()

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

Definition at line 189 of file TargetMachine.h.

References DL, and llvm::DataLayout::getPointerSizeInBits().

◆ getProgramPointerSize()

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

◆ getRelocationModel()

Reloc::Model TargetMachine::getRelocationModel ( ) const

◆ getSjLjDataSize()

virtual unsigned llvm::TargetMachine::getSjLjDataSize ( ) const
inlinevirtual

Reimplemented in llvm::VETargetMachine.

Definition at line 385 of file TargetMachine.h.

References DefaultSjLjDataSize.

◆ 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 166 of file TargetMachine.h.

References F, and getSubtargetImpl().

Referenced by llvm::PhysicalRegisterUsageInfo::print().

◆ 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 220 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 128 of file TargetMachine.h.

References TargetTriple.

Referenced by llvm::AMDGPUPassConfig::addCodeGenPrepare(), llvm::AMDGPUPassConfig::addIRPasses(), llvm::DwarfCompileUnit::addLocationAttribute(), llvm::LLVMTargetMachine::addPassesToEmitMC(), llvm::AMDGPUAsmPrinter::AMDGPUAsmPrinter(), llvm::LLVMTargetMachine::createMCStreamer(), createPPCAsmPrinterPass(), llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), llvm::ARMAsmPrinter::emitEndOfAsmFile(), llvm::AMDGPUAsmPrinter::emitEndOfAsmFile(), llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::X86FrameLowering::emitEpilogue(), llvm::AsmPrinter::emitFunctionBody(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::AMDGPUAsmPrinter::emitFunctionEntryLabel(), llvm::AsmPrinter::emitFunctionEntryLabel(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::AsmPrinter::emitPatchableFunctionEntries(), llvm::ARMAsmPrinter::emitStartOfAsmFile(), llvm::AMDGPUAsmPrinter::emitStartOfAsmFile(), llvm::X86AsmPrinter::emitStartOfAsmFile(), llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::AsmPrinter::emitXRayTable(), llvm::AMDGPUSubtarget::get(), llvm::AArch64MCInstLower::GetGlobalAddressSymbol(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::M68kMCInstLower::GetSymbolFromOperand(), llvm::AsmPrinter::getSymbolPreferLocal(), llvm::LLVMTargetMachine::initAsmInfo(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::TargetLoweringObjectFileXCOFF::Initialize(), llvm::TargetLoweringBase::insertSSPDeclarations(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), llvm::PPCTargetMachine::isPPC64(), llvm::AArch64MCInstLower::LowerSymbolOperand(), llvm::AsmPrinter::preprocessXXStructorList(), llvm::StackProtector::runOnFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::AMDGPUTargetObjectFile::SelectSectionForGlobal(), llvm::AsmPrinter::SetupMachineFunction(), shouldAssumeDSOLocal(), llvm::SITargetLowering::shouldEmitFixup(), shouldLowerMemFuncForSize(), llvm::SITargetLowering::shouldUseLDSConstAddress(), llvm::TargetLoweringBase::TargetLoweringBase(), useEmulatedTLS(), llvm::SelectionDAGBuilder::visitSPDescriptorFailure(), and llvm::WinException::WinException().

◆ getTLSModel()

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

◆ getUniqueBasicBlockSectionNames()

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

Return true if unique basic block section names must be generated.

Definition at line 269 of file TargetMachine.h.

References Options, and llvm::TargetOptions::UniqueBasicBlockSectionNames.

Referenced by llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock().

◆ getUniqueSectionNames()

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

◆ getXCOFFTracebackTable()

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

Return true if XCOFF traceback table should be emitted, corresponding to -xcoff-traceback-table.

Definition at line 293 of file TargetMachine.h.

References Options, and llvm::TargetOptions::XCOFFTracebackTable.

◆ 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 178 of file TargetMachine.h.

References DL.

◆ isNoopAddrSpaceCast()

virtual bool llvm::TargetMachine::isNoopAddrSpaceCast ( unsigned  SrcAS,
unsigned  DestAS 
) const
inlinevirtual

◆ isPositionIndependent()

bool TargetMachine::isPositionIndependent ( ) const

◆ operator=()

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

◆ parseBinutilsVersion()

std::pair< int, int > TargetMachine::parseBinutilsVersion ( StringRef  Version)
static

Definition at line 227 of file TargetMachine.cpp.

References llvm::MipsISD::Ret, and llvm::IndexedInstrProf::Version.

◆ parseMachineFunctionInfo()

virtual bool llvm::TargetMachine::parseMachineFunctionInfo ( const yaml::MachineFunctionInfo ,
PerFunctionMIParsingState PFS,
SMDiagnostic Error,
SMRange SourceRange 
) const
inlinevirtual

Parse out the target's MachineFunctionInfo from the YAML reprsentation.

Reimplemented in llvm::GCNTargetMachine, llvm::WebAssemblyTargetMachine, and llvm::AArch64TargetMachine.

Definition at line 156 of file TargetMachine.h.

◆ registerDefaultAliasAnalyses()

virtual void llvm::TargetMachine::registerDefaultAliasAnalyses ( AAManager )
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 345 of file TargetMachine.h.

Referenced by llvm::PassBuilder::buildDefaultAAPipeline().

◆ registerPassBuilderCallbacks()

virtual void llvm::TargetMachine::registerPassBuilderCallbacks ( PassBuilder )
inlinevirtual

Allow the target to modify the pass pipeline with New Pass Manager (similar to adjustPassManager for Legacy Pass manager).

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

Definition at line 341 of file TargetMachine.h.

◆ 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 247 of file TargetMachine.h.

References Enable, and O0WantsFastISel.

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

◆ setOptLevel()

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

Overrides the optimization level.

Definition at line 190 of file TargetMachine.cpp.

References OptLevel.

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

◆ setPGOOption()

void llvm::TargetMachine::setPGOOption ( Optional< PGOOptions PGOOpt)
inline

Definition at line 311 of file TargetMachine.h.

References PGOOption.

◆ setRequiresStructuredCFG()

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

◆ setSupportsDebugEntryValues()

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

◆ setSupportsDefaultOutlining()

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

◆ setTargetFeatureString()

void llvm::TargetMachine::setTargetFeatureString ( StringRef  FS)
inline

Definition at line 131 of file TargetMachine.h.

References llvm::X86AS::FS, and TargetFS.

◆ shouldAssumeDSOLocal()

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

◆ 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::ARMBaseTargetMachine, and llvm::SystemZTargetMachine.

Definition at line 377 of file TargetMachine.h.

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 107 of file TargetMachine.h.

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

◆ CMModel

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

Definition at line 103 of file TargetMachine.h.

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

◆ DefaultOptions

const TargetOptions llvm::TargetMachine::DefaultOptions

Definition at line 119 of file TargetMachine.h.

◆ DefaultSjLjDataSize

constexpr unsigned llvm::TargetMachine::DefaultSjLjDataSize = 32
staticconstexpr

The integer bit size to use for SjLj based exception handling.

Definition at line 384 of file TargetMachine.h.

Referenced by getSjLjDataSize().

◆ 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 94 of file TargetMachine.h.

Referenced by createDataLayout(), getAllocaPointerSize(), getPointerSize(), getPointerSizeInBits(), getProgramPointerSize(), and isCompatibleDataLayout().

◆ 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 113 of file TargetMachine.h.

Referenced by getO0WantsFastISel(), and setO0WantsFastISel().

◆ Options

TargetOptions llvm::TargetMachine::Options
mutable

Definition at line 120 of file TargetMachine.h.

Referenced by llvm::DwarfUnit::addAttribute(), llvm::TargetPassConfig::addCoreISelPasses(), llvm::TargetPassConfig::addMachinePasses(), llvm::LLVMTargetMachine::addPassesToEmitMC(), llvm::NVPTXTargetLowering::allowFMA(), llvm::NVPTXTargetLowering::allowUnsafeFPMath(), llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), llvm::DwarfCFIException::beginFragment(), llvm::AArch64RegisterInfo::cannotEliminateFrame(), llvm::ARMBaseRegisterInfo::cannotEliminateFrame(), llvm::CodeGenPassBuilder< DerivedT >::CodeGenPassBuilder(), combineFaddCFmul(), combineFMinFMax(), combineFMinNumFMaxNum(), combineSelect(), llvm::DwarfUnit::constructTypeDIE(), llvm::LLVMTargetMachine::createMCStreamer(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineCalleeSaves(), llvm::TargetFrameLowering::determineCalleeSaves(), llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), llvm::PPCFrameLowering::eliminateCallFramePseudoInstr(), llvm::SelectionDAGBuilder::EmitBranchForMergedCondition(), llvm::PPCFrameLowering::emitEpilogue(), llvm::X86AsmPrinter::emitInstruction(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::AsmPrinter::emitStackSizeSection(), llvm::AsmPrinter::emitStackUsage(), llvm::AsmPrinter::emitXRayTable(), llvm::AsmPrinter::emitXXStructorList(), foldFPToIntToFP(), getAIXExtendedAltivecABI(), llvm::GCNTTIImpl::getArithmeticInstrCost(), getBBSectionsFuncListBuf(), getBBSectionsType(), getDataSections(), llvm::AsmPrinter::getFunctionCFISectionType(), getFunctionSections(), getIgnoreXCOFFVisibility(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::PPCTargetLowering::getNegatedExpression(), llvm::TargetLowering::getNegatedExpression(), llvm::TargetLoweringBase::getPrefLoopAlignment(), llvm::RISCVTargetMachine::getSubtargetImpl(), getUniqueBasicBlockSectionNames(), getUniqueSectionNames(), getXCOFFTracebackTable(), llvm::MipsFrameLowering::hasFP(), llvm::SparcFrameLowering::hasFP(), llvm::RISCVFrameLowering::hasFP(), llvm::VEFrameLowering::hasFP(), llvm::MSP430FrameLowering::hasFP(), llvm::ARMFrameLowering::hasFP(), llvm::XCoreFrameLowering::hasFP(), llvm::ARCFrameLowering::hasFP(), llvm::AArch64FrameLowering::hasFP(), llvm::SystemZELFFrameLowering::hasFP(), llvm::SIFrameLowering::hasFP(), llvm::X86FrameLowering::hasFP(), llvm::M68kFrameLowering::hasFP(), llvm::LLVMTargetMachine::initAsmInfo(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::AArch64InstrInfo::isAssociativeAndCommutative(), isCombineInstrCandidateFP(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), llvm::AMDGPUCallLowering::isEligibleForTailCallOptimization(), llvm::SITargetLowering::isEligibleForTailCallOptimization(), isFMAddSubOrFMSubAdd(), llvm::CodeGenPassBuilder< DerivedT >::isGlobalISelAbortEnabled(), llvm::TargetPassConfig::isGlobalISelAbortEnabled(), isLegalToCombineMinNumMaxNum(), llvm::AArch64TargetLowering::isProfitableToHoist(), llvm::PPCTargetLowering::isProfitableToHoist(), llvm::AMDGPULegalizerInfo::legalizeFastUnsafeFDIV(), llvm::AMDGPULegalizerInfo::legalizeFastUnsafeFDIV64(), llvm::AArch64CallLowering::lowerCall(), llvm::SITargetLowering::LowerCall(), llvm::SelectionDAGBuilder::LowerDeoptimizingReturn(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerTailCall(), llvm::PPCFrameLowering::needsFP(), llvm::MachineFunction::needsFrameMoves(), llvm::OptLevelChanger::OptLevelChanger(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), promoteToConstantPool(), llvm::CodeGenPassBuilder< DerivedT >::reportDiagnosticWhenGlobalISelFallback(), llvm::TargetPassConfig::reportDiagnosticWhenGlobalISelFallback(), llvm::SelectionDAGISel::runOnMachineFunction(), setFastISel(), setGlobalISel(), setGlobalISelAbort(), setMachineOutliner(), setSupportsDebugEntryValues(), setSupportsDefaultOutlining(), llvm::AsmPrinter::SetupMachineFunction(), llvm::ARMSubtarget::splitFramePushPop(), llvm::TargetPassConfig::TargetPassConfig(), llvm::DwarfCompileUnit::updateSubprogramScopeDIE(), useEmulatedTLS(), llvm::ARMSubtarget::useFastISel(), and llvm::NVPTXTargetLowering::usePrecSqrtF32().

◆ OptLevel

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

◆ PGOOption

Optional<PGOOptions> llvm::TargetMachine::PGOOption = None
protected

Definition at line 116 of file TargetMachine.h.

Referenced by getPGOOption(), and setPGOOption().

◆ RequireStructuredCFG

unsigned llvm::TargetMachine::RequireStructuredCFG
protected

Definition at line 112 of file TargetMachine.h.

Referenced by requiresStructuredCFG(), and setRequiresStructuredCFG().

◆ 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 86 of file TargetMachine.h.

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


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