|
LLVM
10.0.0
|
Primary interface to the complete machine description for the target machine. More...
#include "llvm/Target/TargetMachine.h"
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 Target & | TheTarget |
| 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 MCAsmInfo > | AsmInfo |
| Contains target specific asm information. More... | |
| std::unique_ptr< const MCRegisterInfo > | MRI |
| std::unique_ptr< const MCInstrInfo > | MII |
| std::unique_ptr< const MCSubtargetInfo > | STI |
| unsigned | RequireStructuredCFG: 1 |
| unsigned | O0WantsFastISel: 1 |
Primary interface to the complete machine description for the target machine.
All target-specific information should be accessible through this interface.
Definition at line 65 of file TargetMachine.h.
|
protected |
Definition at line 34 of file TargetMachine.cpp.
References ~TargetMachine().
|
delete |
|
virtualdefault |
Referenced by TargetMachine().
|
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 281 of file TargetMachine.h.
Referenced by LLVMTargetMachineEmit().
|
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 293 of file TargetMachine.h.
Referenced by llvm::orc::SimpleCompiler::operator()().
|
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 272 of file TargetMachine.h.
|
inlinevirtual |
Allocate and initialize an instance of the YAML representation of the MachineFunctionInfo.
Reimplemented in llvm::GCNTargetMachine, and llvm::WebAssemblyTargetMachine.
Definition at line 133 of file TargetMachine.h.
Referenced by llvm::MIRPrinter::print(), and llvm::GCNTargetMachine::useIPRA().
|
inline |
Create a DataLayout.
Definition at line 153 of file TargetMachine.h.
Referenced by llvm::computeSignatureVTs(), and LLVMTargetMachineEmit().
|
inlinevirtual |
Allocate and return a default initialized instance of the YAML representation for the MachineFunctionInfo.
Reimplemented in llvm::GCNTargetMachine, and llvm::WebAssemblyTargetMachine.
Definition at line 126 of file TargetMachine.h.
Referenced by llvm::MIRParserImpl::parseMachineFunction(), and llvm::GCNTargetMachine::useIPRA().
|
inline |
Definition at line 179 of file TargetMachine.h.
References F(), llvm::DataLayout::getAllocaAddrSpace(), and llvm::DataLayout::getPointerSize().
Referenced by llvm::TargetFrameLowering::getStackAlignmentSkew().
| CodeModel::Model TargetMachine::getCodeModel | ( | ) | const |
Returns the code model.
The choices are small, kernel, medium, large, and target default.
Definition at line 74 of file TargetMachine.cpp.
References CMModel.
Referenced by llvm::AArch64TargetLowering::AArch64TargetLowering(), llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::X86FrameLowering::adjustForSegmentedStacks(), callsShareTOCBase(), llvm::AArch64Subtarget::classifyGlobalFunctionReference(), llvm::AArch64Subtarget::ClassifyGlobalReference(), llvm::X86Subtarget::classifyGlobalReference(), llvm::X86Subtarget::classifyLocalReference(), emitPostSt(), llvm::ARMFrameLowering::emitPrologue(), llvm::X86TargetLowering::findRepresentativeClass(), llvm::X86InstrInfo::foldMemoryOperandImpl(), for(), llvm::X86InstrInfo::getGlobalBaseReg(), getMOVL(), llvm::PPCTargetLowering::getPICJumpTableRelocBase(), llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), getRetpolineSymbol(), llvm::X86InstrInfo::getSerializableDirectMachineOperandTargetFlags(), getTargetNode(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::TargetLoweringObjectFile::Initialize(), llvm::X86FrameLowering::inlineStackProbe(), llvm::PPCTargetLowering::isAccessedAsGotIndirect(), isEFLAGSLive(), llvm::LanaiTargetObjectFile::isGlobalInSmallSection(), llvm::PPCSubtarget::isGVIndirectSymbol(), llvm::X86TargetLowering::isLegalAddressingMode(), IsSmallObject(), llvm::LanaiTargetLowering::LowerConstantPool(), LowerEXTRACT_SUBVECTOR(), llvm::LanaiTargetLowering::LowerJumpTable(), llvm::SparcTargetLowering::makeAddress(), mayTailCallThisCC(), mayUseP9Setb(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), and llvm::AArch64Subtarget::useSmallAddressing().
|
inline |
Return true if data objects should be emitted into their own section, corresponds to -fdata-sections.
Definition at line 247 of file TargetMachine.h.
References llvm::TargetOptions::DataSections.
Referenced by llvm::TargetLoweringObjectFileCOFF::getNameWithPrefix(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileWasm::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileXCOFF::SelectSectionForGlobal(), and llvm::HexagonTargetObjectFile::shouldPutJumpTableInFunctionSection().
|
inline |
Return true if functions should be emitted into their own section, corresponding to -ffunction-sections.
Definition at line 253 of file TargetMachine.h.
References llvm::TargetOptions::FunctionSections.
Referenced by callsShareTOCBase(), llvm::TargetLoweringObjectFileCOFF::getNameWithPrefix(), llvm::TargetLoweringObjectFileELF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileCOFF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileXCOFF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileWasm::SelectSectionForGlobal(), and llvm::TargetLoweringObjectFileXCOFF::SelectSectionForGlobal().
|
inlinevirtual |
If intrinsic information is available, return it. If not, return null.
Definition at line 196 of file TargetMachine.h.
Referenced by llvm::SDNode::getOperationName(), llvm::SelectionDAGISel::isOrEquivalentToAdd(), and llvm::MIPrinter::print().
Return target specific asm information.
Definition at line 189 of file TargetMachine.h.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::LLVMTargetMachine::addAsmPrinter(), llvm::TargetPassConfig::addPassesToHandleExceptions(), appendEndToFunction(), llvm::X86FrameLowering::canUseLEAForSPInEpilogue(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), eraseDeadBBsAndChildren(), ExpandMOVImmSExti8(), llvm::X86FrameLowering::getFrameIndexReference(), llvm::AArch64InstrInfo::getInstSizeInBytes(), llvm::ARCInstrInfo::getInstSizeInBytes(), llvm::MSP430InstrInfo::getInstSizeInBytes(), llvm::AVRInstrInfo::getInstSizeInBytes(), llvm::MipsInstrInfo::getInstSizeInBytes(), llvm::ARMBaseInstrInfo::getInstSizeInBytes(), llvm::SystemZInstrInfo::getInstSizeInBytes(), llvm::PPCInstrInfo::getInstSizeInBytes(), llvm::SIInstrInfo::getInstSizeInBytes(), llvm::TargetLoweringObjectFileMachO::getNameWithPrefix(), llvm::HexagonInstrInfo::getSize(), llvm::ARMElfTargetObjectFile::getTTypeGlobalReference(), giveUpWithRemarks(), llvm::AArch64InstrInfo::isCandidateToMergeOrPair(), llvm::ARMSubtarget::isXRaySupported(), LowerINTRINSIC_W_CHAIN(), matchPair(), llvm::WebAssemblyFrameLowering::needsPrologForEH(), needsWinCFI(), and srcMgrDiagHandler().
|
inline |
Definition at line 192 of file TargetMachine.h.
References llvm::MCInstrInfo::get().
Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), and llvm::LLVMTargetMachine::addPassesToEmitMC().
|
inline |
Definition at line 191 of file TargetMachine.h.
References llvm::MCRegisterInfo::get().
Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), and llvm::LLVMTargetMachine::addPassesToEmitMC().
|
inline |
Definition at line 193 of file TargetMachine.h.
Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), llvm::LLVMTargetMachine::addPassesToEmitMC(), emitDirectiveRelocJalr(), llvm::AMDGPUAsmPrinter::getGlobalSTI(), and llvm::ARMElfTargetObjectFile::Initialize().
| void TargetMachine::getNameWithPrefix | ( | SmallVectorImpl< char > & | Name, |
| const GlobalValue * | GV, | ||
| Mangler & | Mang, | ||
| bool | MayAlwaysUsePrivate = false |
||
| ) | const |
Definition at line 246 of file TargetMachine.cpp.
References llvm::Mangler::getNameWithPrefix(), llvm::TargetLoweringObjectFile::getNameWithPrefix(), getObjFileLowering(), and llvm::GlobalValue::hasPrivateLinkage().
Referenced by llvm::AArch64MCInstLower::GetGlobalAddressSymbol(), llvm::AsmPrinter::getNameWithPrefix(), getSymbol(), GetSymbolFromOperand(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), selectELFSectionForGlobal(), and selectWasmSectionForGlobal().
|
inline |
Definition at line 228 of file TargetMachine.h.
Referenced by llvm::TargetPassConfig::addCoreISelPasses(), and llvm::OptLevelChanger::OptLevelChanger().
|
inlinevirtual |
Reimplemented in llvm::MipsTargetMachine, llvm::NVPTXTargetMachine, llvm::ARMBaseTargetMachine, llvm::PPCTargetMachine, llvm::AMDGPUTargetMachine, llvm::X86TargetMachine, llvm::LanaiTargetMachine, llvm::AArch64TargetMachine, llvm::SystemZTargetMachine, llvm::XCoreTargetMachine, llvm::VETargetMachine, llvm::WebAssemblyTargetMachine, llvm::ARCTargetMachine, llvm::HexagonTargetMachine, llvm::MSP430TargetMachine, llvm::RISCVTargetMachine, llvm::AVRTargetMachine, llvm::SparcTargetMachine, and llvm::BPFTargetMachine.
Definition at line 120 of file TargetMachine.h.
Referenced by llvm::LLVMTargetMachine::addPassesToEmitFile(), getNameWithPrefix(), llvm::AsmPrinter::getObjFileLowering(), getSymbol(), GetSymbolFromOperand(), llvm::LanaiTargetLowering::LowerConstantPool(), and llvm::LanaiTargetLowering::LowerGlobalAddress().
| CodeGenOpt::Level TargetMachine::getOptLevel | ( | ) | const |
Returns the optimization level: None, Less, Default, or Aggressive.
Definition at line 238 of file TargetMachine.cpp.
References OptLevel.
Referenced by llvm::AArch64beTargetMachine::AArch64beTargetMachine(), llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::TargetPassConfig::addCoreISelPasses(), llvm::AMDGPUTargetMachine::adjustPassManager(), AssignProtectedObjSet(), llvm::CodeViewDebug::beginFunctionImpl(), llvm::BPFTargetMachine::createPassConfig(), llvm::MSP430TargetMachine::createPassConfig(), llvm::ARCTargetMachine::createPassConfig(), llvm::HexagonTargetMachine::createPassConfig(), llvm::WebAssemblyTargetMachine::createPassConfig(), llvm::XCoreTargetMachine::createPassConfig(), llvm::AArch64TargetMachine::createPassConfig(), llvm::PPCTargetMachine::createPassConfig(), llvm::X86TargetMachine::createPassConfig(), llvm::ARMBaseTargetMachine::createPassConfig(), llvm::MipsTargetMachine::createPassConfig(), llvm::R600TargetMachine::createPassConfig(), llvm::HexagonFrameLowering::getAlignaInstr(), getBufferOffsetForMMO(), 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(), PerformSETCCCombine(), reservePrivateMemoryRegs(), llvm::ARMAsmPrinter::runOnMachineFunction(), llvm::IRTranslator::runOnMachineFunction(), selectI64Imm(), llvm::AArch64TargetLowering::shouldExpandAtomicCmpXchgInIR(), llvm::SystemZTargetMachine::SystemZTargetMachine(), and llvm::X86TargetLowering::X86TargetLowering().
Get the pointer size for this target.
This is the only time the DataLayout in the TargetMachine is used.
Definition at line 167 of file TargetMachine.h.
References llvm::DataLayout::getPointerSize().
Referenced by llvm::AsmPrinter::getPointerSize(), llvm::X86TargetLowering::isNoopAddrSpaceCast(), llvm::SparcTargetLowering::SparcTargetLowering(), and llvm::SystemZTargetLowering::SystemZTargetLowering().
Definition at line 171 of file TargetMachine.h.
References llvm::DataLayout::getPointerSizeInBits().
Referenced by llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo(), llvm::X86LegalizerInfo::legalizeIntrinsic(), and llvm::X86TargetLowering::X86TargetLowering().
|
inline |
Definition at line 175 of file TargetMachine.h.
References llvm::DataLayout::getPointerSize(), and llvm::DataLayout::getProgramAddressSpace().
Referenced by 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 70 of file TargetMachine.cpp.
References RM.
Referenced by areCallingConvEligibleForTCO_64SVR4(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::MipsSubtarget::getRelocationModel(), getTLSModel(), llvm::TargetLoweringObjectFileMachO::Initialize(), llvm::X86Subtarget::isLegalToCallImmediateAddr(), llvm::HexagonTargetLowering::isOffsetFoldingLegal(), isPositionIndependent(), llvm::ARMSubtarget::isROPI(), llvm::ARMSubtarget::isRWPI(), shouldAssumeDSOLocal(), and transformCallee().
|
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 148 of file TargetMachine.h.
Referenced by llvm::X86TTIImpl::areFunctionArgsABICompatible(), llvm::computeLegalValueVTs(), llvm::computeSignatureVTs(), llvm::AMDGPUSubtarget::get(), getMulHu(), getOpenCLAlignment(), isExecuteOnlyFunction(), llvm::PhysicalRegisterUsageInfo::print(), and VisitGlobalVariableForEmission().
|
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::MipsTargetMachine, llvm::AMDGPUTargetMachine, llvm::ARMBaseTargetMachine, llvm::NVPTXTargetMachine, llvm::PPCTargetMachine, llvm::X86TargetMachine, llvm::LanaiTargetMachine, llvm::SystemZTargetMachine, llvm::WebAssemblyTargetMachine, llvm::XCoreTargetMachine, llvm::AArch64TargetMachine, llvm::AVRTargetMachine, llvm::VETargetMachine, llvm::MSP430TargetMachine, llvm::ARCTargetMachine, llvm::HexagonTargetMachine, llvm::SparcTargetMachine, llvm::RISCVTargetMachine, and llvm::BPFTargetMachine.
Definition at line 117 of file TargetMachine.h.
Referenced by llvm::AArch64TTIImpl::areInlineCompatible(), llvm::ARMTTIImpl::areInlineCompatible(), llvm::X86TTIImpl::areInlineCompatible(), llvm::GCNTTIImpl::areInlineCompatible(), llvm::createDwarfEHPass(), llvm::ARMTargetLowering::getJumpTableEncoding(), llvm::MachineModuleInfo::getOrCreateMachineFunction(), llvm::isInTailCallPosition(), isPromotedResultSafe(), llvm::StackProtector::runOnFunction(), and llvm::AMDGPUPerfHintAnalysis::runOnSCC().
| MCSymbol * TargetMachine::getSymbol | ( | const GlobalValue * | GV | ) | const |
Definition at line 259 of file TargetMachine.cpp.
References llvm::TargetLoweringObjectFile::getContext(), llvm::TargetLoweringObjectFile::getMangler(), getNameWithPrefix(), getObjFileLowering(), and llvm::MCContext::getOrCreateSymbol().
Referenced by getAssociatedSymbol(), llvm::X86_64MachoTargetObjectFile::getCFIPersonalitySymbol(), llvm::AArch64_MachoTargetObjectFile::getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFileELF::getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFile::getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileCOFF::getSectionForJumpTable(), llvm::AsmPrinter::getSymbol(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), llvm::ARMElfTargetObjectFile::getTTypeGlobalReference(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::lowerRelativeReference(), llvm::TargetLoweringObjectFileCOFF::lowerRelativeReference(), llvm::TargetLoweringObjectFileWasm::lowerRelativeReference(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
Definition at line 109 of file TargetMachine.h.
Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), llvm::LLVMTargetMachine::addPassesToEmitMC(), llvm::EngineBuilder::create(), llvm::AsmPrinter::doInitialization(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), llvm::X86AsmPrinter::runOnMachineFunction(), and srcMgrDiagHandler().
|
inline |
Definition at line 112 of file TargetMachine.h.
Referenced by checkFunctionsAttributeConsistency(), llvm::AsmPrinter::doInitialization(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), llvm::AMDGPUTargetMachine::getGPUName(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), and llvm::LLVMTargetMachine::initAsmInfo().
|
inline |
Definition at line 113 of file TargetMachine.h.
Referenced by checkFunctionsAttributeConsistency(), llvm::AsmPrinter::doInitialization(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), llvm::AMDGPUTargetMachine::getFeatureString(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), and llvm::LLVMTargetMachine::initAsmInfo().
| 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 266 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::LLVMTargetMachine, llvm::GCNTargetMachine, llvm::R600TargetMachine, llvm::NVPTXTargetMachine, llvm::ARMBaseTargetMachine, llvm::VETargetMachine, llvm::PPCTargetMachine, llvm::WebAssemblyTargetMachine, llvm::X86TargetMachine, llvm::AArch64TargetMachine, llvm::MipsTargetMachine, llvm::SystemZTargetMachine, llvm::RISCVTargetMachine, llvm::XCoreTargetMachine, llvm::LanaiTargetMachine, llvm::ARCTargetMachine, and llvm::HexagonTargetMachine.
Definition at line 242 of file TargetMachine.cpp.
References llvm::Module::getDataLayout(), and llvm::GlobalValue::getParent().
Referenced by getTargetIRAnalysis().
Definition at line 111 of file TargetMachine.h.
Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), llvm::DwarfCompileUnit::addLocationAttribute(), llvm::LLVMTargetMachine::addPassesToEmitFile(), llvm::LLVMTargetMachine::addPassesToEmitMC(), buildPCRelGlobalAddress(), checkFunctionsAttributeConsistency(), llvm::DwarfCompileUnit::constructLabelDIE(), createPPCAsmPrinterPass(), llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), llvm::AsmPrinter::EmitConstantPool(), llvm::ARMAsmPrinter::EmitEndOfAsmFile(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::AMDGPUAsmPrinter::EmitEndOfAsmFile(), llvm::X86FrameLowering::emitEpilogue(), llvm::AsmPrinter::EmitFunctionBody(), llvm::AMDGPUAsmPrinter::EmitFunctionBodyEnd(), llvm::AMDGPUAsmPrinter::EmitFunctionEntryLabel(), llvm::AMDGPUAsmPrinter::EmitGlobalVariable(), llvm::AsmPrinter::EmitJumpTableInfo(), llvm::AsmPrinter::emitPatchableFunctionEntries(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), llvm::AMDGPUAsmPrinter::EmitStartOfAsmFile(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), FixedPointIntrinsicToOpcode(), for(), llvm::AMDGPUSubtarget::get(), getCOFFSectionFlags(), llvm::AArch64MCInstLower::GetGlobalAddressSymbol(), llvm::ARMAsmPrinter::getISAEncoding(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::GCNTargetMachine::getTargetTransformInfo(), llvm::LLVMTargetMachine::initAsmInfo(), llvm::TargetLoweringObjectFileELF::Initialize(), llvm::TargetLoweringObjectFile::Initialize(), llvm::TargetLoweringObjectFileCOFF::Initialize(), llvm::MipsSubtarget::initializeSubtargetDependencies(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), llvm::PPCTargetMachine::isPPC64(), LLVMOrcCreateInstance(), llvm::TargetLoweringObjectFileCOFF::lowerRelativeReference(), llvm::AArch64MCInstLower::LowerSymbolOperand(), MatchingStackOffset(), mayTailCallThisCC(), llvm::StackProtector::runOnFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::AMDGPUTargetObjectFile::SelectSectionForGlobal(), llvm::AsmPrinter::SetupMachineFunction(), shouldAssumeDSOLocal(), llvm::SITargetLowering::shouldEmitFixup(), shouldLowerMemFuncForSize(), llvm::TargetLoweringBase::TargetLoweringBase(), llvm::OrcCBindingsStack::UnregisterJITEventListener(), llvm::DwarfCompileUnit::updateSubprogramScopeDIE(), useEmulatedTLS(), 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 210 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 llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::PPCTTIImpl::getUserCost(), llvm::SparcTargetLowering::LowerGlobalTLSAddress(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), LowerToTLSExecModel(), and mayTailCallThisCC().
|
inline |
Definition at line 243 of file TargetMachine.h.
References llvm::TargetOptions::UniqueSectionNames.
Referenced by selectELFSectionForGlobal(), and selectWasmSectionForGlobal().
|
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 160 of file TargetMachine.h.
| bool TargetMachine::isPositionIndependent | ( | ) | const |
Definition at line 44 of file TargetMachine.cpp.
References getRelocationModel(), and llvm::Reloc::PIC_.
Referenced by assureFPCallStub(), computeBasePointerSaveOffset(), llvm::MipsTargetLowering::createFastISel(), createFPFnStub(), llvm::PPCTargetMachine::createPassConfig(), fixupFPReturnAndCall(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::PPCRegisterInfo::getBaseRegister(), llvm::HexagonFrameLowering::getFrameIndexReference(), llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::PPCRegisterInfo::getReservedRegs(), llvm::X86InstrInfo::getSerializableDirectMachineOperandTargetFlags(), GetSymbolRef(), llvm::MipsFunctionInfo::initGlobalBaseReg(), llvm::TargetLoweringObjectFile::Initialize(), llvm::ARMSubtarget::isGVIndirectSymbol(), llvm::ARMSubtarget::isGVInGOT(), llvm::TargetLoweringBase::isJumpTableRelative(), llvm::AsmPrinter::isPositionIndependent(), llvm::MipsSubtarget::isPositionIndependent(), llvm::X86Subtarget::isPositionIndependent(), llvm::TargetLowering::isPositionIndependent(), llvm::HexagonTargetObjectFile::isSmallDataEnabled(), llvm::MipsSEInstrInfo::loadImmediate(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), mayUseP9Setb(), llvm::MipsSubtarget::MipsSubtarget(), and shouldAssumeDSOLocal().
|
delete |
|
inlinevirtual |
Parse out the target's MachineFunctionInfo from the YAML reprsentation.
Reimplemented in llvm::GCNTargetMachine, and llvm::WebAssemblyTargetMachine.
Definition at line 138 of file TargetMachine.h.
Referenced by llvm::MIRParserImpl::initializeMachineFunction(), and llvm::GCNTargetMachine::useIPRA().
|
inline |
Definition at line 200 of file TargetMachine.h.
Referenced by llvm::TargetPassConfig::addMachineLateOptimization(), and llvm::MachineBasicBlock::canSplitCriticalEdge().
Reset the target options based on the function's attributes.
Definition at line 53 of file TargetMachine.cpp.
References RESET_OPTION.
Referenced by llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::R600TargetMachine::getSubtargetImpl(), llvm::GCNTargetMachine::getSubtargetImpl(), and llvm::SelectionDAGISel::runOnMachineFunction().
|
inline |
Definition at line 227 of file TargetMachine.h.
References llvm::TargetOptions::EnableFastISel.
Referenced by llvm::TargetPassConfig::addCoreISelPasses(), llvm::OptLevelChanger::OptLevelChanger(), and llvm::OptLevelChanger::~OptLevelChanger().
|
inline |
Definition at line 230 of file TargetMachine.h.
References llvm::TargetOptions::EnableGlobalISel.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), and llvm::TargetPassConfig::addCoreISelPasses().
|
inline |
Definition at line 231 of file TargetMachine.h.
References llvm::TargetOptions::GlobalISelAbort, and Mode.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine().
|
inline |
Definition at line 234 of file TargetMachine.h.
References llvm::TargetOptions::EnableMachineOutliner.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine(), llvm::RISCVTargetMachine::RISCVTargetMachine(), and llvm::X86TargetMachine::X86TargetMachine().
|
inline |
Definition at line 229 of file TargetMachine.h.
Referenced by llvm::TargetPassConfig::addCoreISelPasses().
| void TargetMachine::setOptLevel | ( | CodeGenOpt::Level | Level | ) |
Overrides the optimization level.
Definition at line 240 of file TargetMachine.cpp.
References OptLevel.
Referenced by llvm::OptLevelChanger::OptLevelChanger(), and llvm::OptLevelChanger::~OptLevelChanger().
|
inline |
Definition at line 201 of file TargetMachine.h.
Referenced by llvm::NVPTXTargetMachine::NVPTXTargetMachine(), and llvm::R600TargetMachine::R600TargetMachine().
|
inline |
Definition at line 237 of file TargetMachine.h.
References llvm::TargetOptions::SupportsDefaultOutlining.
Referenced by llvm::AArch64TargetMachine::AArch64TargetMachine().
| bool TargetMachine::shouldAssumeDSOLocal | ( | const Module & | M, |
| const GlobalValue * | GV | ||
| ) | const |
Definition at line 94 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::isOSBinFormatWasm(), llvm::Triple::isOSBinFormatXCOFF(), llvm::Triple::isOSWindows(), isPositionIndependent(), llvm::Triple::isPPC64(), llvm::GlobalValue::isStrongDefinitionForLinker(), llvm::GlobalValue::isThreadLocal(), llvm::Triple::isWindowsGNUEnvironment(), llvm::Triple::ppc, RM, llvm::Reloc::Static, and llvm::TT.
Referenced by callsShareTOCBase(), llvm::ARMTargetLowering::CCAssignFnForReturn(), llvm::AArch64Subtarget::classifyGlobalFunctionReference(), llvm::X86Subtarget::classifyGlobalFunctionReference(), llvm::AArch64Subtarget::ClassifyGlobalReference(), llvm::X86Subtarget::classifyGlobalReference(), combineADDToADDZE(), getTargetNode(), getTLSModel(), llvm::PPCSubtarget::hasLazyResolverStub(), llvm::PPCSubtarget::isGVIndirectSymbol(), llvm::ARMSubtarget::isGVIndirectSymbol(), llvm::ARMSubtarget::isGVInGOT(), llvm::TargetLowering::isOffsetFoldingLegal(), llvm::SystemZSubtarget::isPC32DBLSymbol(), llvm::ARMTargetLowering::isReadOnly(), llvm::SITargetLowering::shouldEmitGOTReloc(), and transformCallee().
|
inline |
Definition at line 241 of file TargetMachine.h.
References llvm::TargetOptions::PrintMachineCode.
Referenced by llvm::TargetPassConfig::addPrintPass().
|
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 304 of file TargetMachine.h.
References Name.
Referenced by llvm::TargetPassConfig::addMachinePasses().
| bool TargetMachine::useEmulatedTLS | ( | ) | const |
Returns true if this target uses emulated TLS.
Definition at line 202 of file TargetMachine.cpp.
References llvm::TargetOptions::EmulatedTLS, llvm::TargetOptions::ExplicitEmulatedTLS, getTargetTriple(), llvm::Triple::hasDefaultEmulatedTLS(), and Options.
Referenced by llvm::TargetPassConfig::addISelPasses(), llvm::DwarfCompileUnit::addLocationAttribute(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::SparcTargetLowering::LowerGlobalTLSAddress(), LowerToTLSExecModel(), and mayTailCallThisCC().
Contains target specific asm information.
Definition at line 93 of file TargetMachine.h.
Referenced by llvm::BPFTargetMachine::BPFTargetMachine(), and llvm::LLVMTargetMachine::initAsmInfo().
|
protected |
Definition at line 89 of file TargetMachine.h.
Referenced by getCodeModel(), and llvm::LLVMTargetMachine::LLVMTargetMachine().
| const TargetOptions llvm::TargetMachine::DefaultOptions |
Definition at line 102 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 80 of file TargetMachine.h.
|
protected |
Definition at line 95 of file TargetMachine.h.
Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), and llvm::LLVMTargetMachine::initAsmInfo().
|
protected |
Definition at line 94 of file TargetMachine.h.
Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), llvm::LLVMTargetMachine::addPassesToEmitMC(), and llvm::LLVMTargetMachine::initAsmInfo().
|
protected |
Definition at line 99 of file TargetMachine.h.
|
mutable |
Definition at line 103 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::DwarfCFIException::beginFragment(), llvm::DwarfDebug::beginModule(), buildCallOperands(), llvm::AArch64RegisterInfo::cannotEliminateFrame(), llvm::ARMBaseRegisterInfo::cannotEliminateFrame(), llvm::AArch64TargetLowering::CCAssignFnForReturn(), llvm::ARMTargetLowering::CCAssignFnForReturn(), checkFunctionsAttributeConsistency(), collectCallSiteParameters(), combineFMinFMax(), combineFMinNumFMaxNum(), 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::ScheduleDAGSDNodes::EmitSchedule(), llvm::AsmPrinter::emitStackSizeSection(), EmitVectorComparison(), EnsureStackAlignment(), foldFPToIntToFP(), FoldIntToFPToInt(), FPCCToARMCC(), getCallOpcode(), getComparePred(), llvm::X86ELFTargetObjectFile::getDebugThreadLocalSymbol(), llvm::NVPTXTargetLowering::getDivF32Level(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::PPCInstrInfo::getMachineCombinerPatterns(), getMOVL(), llvm::TargetLowering::getNegatedExpression(), getOffsetFromIndices(), getSPDenormModeValue(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::MipsFrameLowering::hasFP(), llvm::SparcFrameLowering::hasFP(), llvm::RISCVFrameLowering::hasFP(), llvm::VEFrameLowering::hasFP(), llvm::MSP430FrameLowering::hasFP(), llvm::SystemZFrameLowering::hasFP(), llvm::XCoreFrameLowering::hasFP(), llvm::ARMFrameLowering::hasFP(), llvm::ARCFrameLowering::hasFP(), llvm::AArch64FrameLowering::hasFP(), llvm::SIFrameLowering::hasFP(), llvm::HexagonFrameLowering::hasFP(), llvm::X86FrameLowering::hasFP(), llvm::LLVMTargetMachine::initAsmInfo(), llvm::HexagonTargetObjectFile::Initialize(), llvm::RISCVELFTargetObjectFile::Initialize(), llvm::SparcELFTargetObjectFile::Initialize(), llvm::LanaiTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), llvm::MIRParserImpl::initializeCallSiteInfo(), llvm::AArch64InstrInfo::isAssociativeAndCommutative(), llvm::X86InstrInfo::isAssociativeAndCommutative(), isClampZeroToOne(), isCombineInstrCandidateFP(), isContractable(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), llvm::SITargetLowering::isEligibleForTailCallOptimization(), isFMAddSubOrFMSubAdd(), llvm::TargetPassConfig::isGlobalISelAbortEnabled(), llvm::isInTailCallPosition(), isLegalToCombineMinNumMaxNum(), llvm::TargetLowering::isNegatibleForFree(), llvm::AArch64TargetLowering::isProfitableToHoist(), isSortedByValueNo(), llvm::AMDGPULegalizerInfo::legalizeFastUnsafeFDIV(), llvm::AArch64CallLowering::lowerCall(), llvm::SITargetLowering::LowerCall(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::AMDGPUTargetLowering::LowerFP_TO_FP16(), MatchingStackOffset(), mayTailCallThisCC(), llvm::MipsTargetLowering::MipsTargetLowering(), llvm::AsmPrinter::needsCFIMoves(), llvm::PPCFrameLowering::needsFP(), llvm::MachineFunction::needsFrameMoves(), llvm::OptLevelChanger::OptLevelChanger(), llvm::PPCTargetLowering::PPCTargetLowering(), processDbgDeclares(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), promoteToConstantPool(), llvm::TargetPassConfig::reportDiagnosticWhenGlobalISelFallback(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::AMDGPUInstructionSelector::select(), llvm::EngineBuilder::selectTarget(), llvm::AsmPrinter::SetupMachineFunction(), shouldGuaranteeTCO(), llvm::ARMSubtarget::splitFramePushPop(), llvm::TargetPassConfig::TargetPassConfig(), truncateScalarIntegerArg(), llvm::SelectionDAGBuilder::UpdateSplitBlock(), llvm::DwarfCompileUnit::updateSubprogramScopeDIE(), useEmulatedTLS(), llvm::ARMSubtarget::useFastISel(), llvm::NVPTXTargetLowering::usePrecSqrtF32(), widenVec(), and llvm::X86TargetLowering::X86TargetLowering().
|
protected |
Definition at line 90 of file TargetMachine.h.
Referenced by getOptLevel(), llvm::LLVMTargetMachine::LLVMTargetMachine(), and setOptLevel().
|
protected |
Definition at line 98 of file TargetMachine.h.
|
protected |
Definition at line 88 of file TargetMachine.h.
Referenced by getRelocationModel(), getTLSModel(), llvm::LLVMTargetMachine::LLVMTargetMachine(), and shouldAssumeDSOLocal().
|
protected |
Definition at line 96 of file TargetMachine.h.
Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), llvm::LLVMTargetMachine::addPassesToEmitMC(), and llvm::LLVMTargetMachine::initAsmInfo().
|
protected |
Definition at line 85 of file TargetMachine.h.
Referenced by llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), and llvm::MipsTargetMachine::getSubtargetImpl().
|
protected |
Definition at line 86 of file TargetMachine.h.
Referenced by llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), and llvm::MipsTargetMachine::getSubtargetImpl().
|
protected |
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
Definition at line 84 of file TargetMachine.h.
Referenced by llvm::ARMBaseTargetMachine::ARMBaseTargetMachine(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::R600TargetMachine::getSubtargetImpl(), llvm::GCNTargetMachine::getSubtargetImpl(), and llvm::ARMBaseTargetMachine::isTargetHardFloat().
The Target that this machine was created for.
Definition at line 72 of file TargetMachine.h.
Referenced by llvm::LLVMTargetMachine::initAsmInfo().
1.8.13