LLVM 22.0.0git
llvm::codegen Namespace Reference

Classes

struct  RegisterCodeGenFlags
 Create this object with static storage to register codegen-related command line options. More...

Functions

LLVM_ABI std::string getMArch ()
LLVM_ABI std::string getMCPU ()
LLVM_ABI std::vector< std::string > getMAttrs ()
LLVM_ABI Reloc::Model getRelocModel ()
LLVM_ABI std::optional< Reloc::ModelgetExplicitRelocModel ()
LLVM_ABI ThreadModel::Model getThreadModel ()
LLVM_ABI CodeModel::Model getCodeModel ()
LLVM_ABI std::optional< CodeModel::ModelgetExplicitCodeModel ()
LLVM_ABI uint64_t getLargeDataThreshold ()
LLVM_ABI std::optional< uint64_tgetExplicitLargeDataThreshold ()
LLVM_ABI llvm::ExceptionHandling getExceptionModel ()
LLVM_ABI std::optional< CodeGenFileTypegetExplicitFileType ()
LLVM_ABI CodeGenFileType getFileType ()
LLVM_ABI FramePointerKind getFramePointerUsage ()
LLVM_ABI bool getEnableUnsafeFPMath ()
LLVM_ABI bool getEnableNoInfsFPMath ()
LLVM_ABI bool getEnableNoNaNsFPMath ()
LLVM_ABI bool getEnableNoSignedZerosFPMath ()
LLVM_ABI bool getEnableNoTrappingFPMath ()
LLVM_ABI DenormalMode::DenormalModeKind getDenormalFPMath ()
LLVM_ABI DenormalMode::DenormalModeKind getDenormalFP32Math ()
LLVM_ABI bool getEnableHonorSignDependentRoundingFPMath ()
LLVM_ABI llvm::FloatABI::ABIType getFloatABIForCalls ()
LLVM_ABI llvm::FPOpFusion::FPOpFusionMode getFuseFPOps ()
LLVM_ABI SwiftAsyncFramePointerMode getSwiftAsyncFramePointer ()
LLVM_ABI bool getDontPlaceZerosInBSS ()
LLVM_ABI bool getEnableGuaranteedTailCallOpt ()
LLVM_ABI bool getEnableAIXExtendedAltivecABI ()
LLVM_ABI bool getDisableTailCalls ()
LLVM_ABI bool getStackSymbolOrdering ()
LLVM_ABI bool getStackRealign ()
LLVM_ABI std::string getTrapFuncName ()
LLVM_ABI bool getUseCtors ()
LLVM_ABI bool getDisableIntegratedAS ()
LLVM_ABI bool getDataSections ()
LLVM_ABI std::optional< boolgetExplicitDataSections ()
LLVM_ABI bool getFunctionSections ()
LLVM_ABI std::optional< boolgetExplicitFunctionSections ()
LLVM_ABI bool getIgnoreXCOFFVisibility ()
LLVM_ABI bool getXCOFFTracebackTable ()
LLVM_ABI std::string getBBSections ()
LLVM_ABI unsigned getTLSSize ()
LLVM_ABI bool getEmulatedTLS ()
LLVM_ABI std::optional< boolgetExplicitEmulatedTLS ()
LLVM_ABI bool getEnableTLSDESC ()
LLVM_ABI std::optional< boolgetExplicitEnableTLSDESC ()
LLVM_ABI bool getUniqueSectionNames ()
LLVM_ABI bool getUniqueBasicBlockSectionNames ()
LLVM_ABI bool getSeparateNamedSections ()
LLVM_ABI llvm::EABI getEABIVersion ()
LLVM_ABI llvm::DebuggerKind getDebuggerTuningOpt ()
LLVM_ABI bool getEnableStackSizeSection ()
LLVM_ABI bool getEnableAddrsig ()
LLVM_ABI bool getEnableCallGraphSection ()
LLVM_ABI bool getEmitCallSiteInfo ()
LLVM_ABI bool getEnableMachineFunctionSplitter ()
LLVM_ABI bool getEnableStaticDataPartitioning ()
LLVM_ABI bool getEnableDebugEntryValues ()
LLVM_ABI bool getValueTrackingVariableLocations ()
LLVM_ABI std::optional< boolgetExplicitValueTrackingVariableLocations ()
LLVM_ABI bool getForceDwarfFrameSection ()
LLVM_ABI bool getXRayFunctionIndex ()
LLVM_ABI bool getDebugStrictDwarf ()
LLVM_ABI unsigned getAlignLoops ()
LLVM_ABI bool getJMCInstrument ()
LLVM_ABI bool getXCOFFReadOnlyPointers ()
LLVM_ABI bool getEnableBBAddrMap ()
LLVM_ABI llvm::BasicBlockSection getBBSectionsMode (llvm::TargetOptions &Options)
LLVM_ABI TargetOptions InitTargetOptionsFromCodeGenFlags (const llvm::Triple &TheTriple)
 Common utility function tightly tied to the options listed here.
LLVM_ABI std::string getCPUStr ()
LLVM_ABI std::string getFeaturesStr ()
LLVM_ABI std::vector< std::string > getFeatureList ()
LLVM_ABI void renderBoolStringAttr (AttrBuilder &B, StringRef Name, bool Val)
LLVM_ABI void setFunctionAttributes (StringRef CPU, StringRef Features, Function &F)
 Set function attributes of function F based on CPU, Features, and command line flags.
LLVM_ABI void setFunctionAttributes (StringRef CPU, StringRef Features, Module &M)
 Set function attributes of functions in Module M based on CPU, Features, and command line flags.
LLVM_ABI bool getDefaultValueTrackingVariableLocations (const llvm::Triple &T)
 Should value-tracking variable locations / instruction referencing be enabled by default for this triple?
LLVM_ABI Expected< std::unique_ptr< TargetMachine > > createTargetMachineForTriple (StringRef TargetTriple, CodeGenOptLevel OptLevel=CodeGenOptLevel::Default)
 Creates a TargetMachine instance with the options defined on the command line.

Function Documentation

◆ createTargetMachineForTriple()

Expected< std::unique_ptr< TargetMachine > > llvm::codegen::createTargetMachineForTriple ( StringRef TargetTriple,
CodeGenOptLevel OptLevel = CodeGenOptLevel::Default )

◆ getAlignLoops()

LLVM_ABI unsigned llvm::codegen::getAlignLoops ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getBBSections()

LLVM_ABI std::string llvm::codegen::getBBSections ( )

References LLVM_ABI.

Referenced by getBBSectionsMode().

◆ getBBSectionsMode()

◆ getCodeModel()

LLVM_ABI CodeModel::Model llvm::codegen::getCodeModel ( )

References LLVM_ABI.

◆ getCPUStr()

std::string llvm::codegen::getCPUStr ( )

Definition at line 615 of file CommandFlags.cpp.

References getCPUStr(), llvm::sys::getHostCPUName(), and getMCPU().

Referenced by createTargetMachineForTriple(), and getCPUStr().

◆ getDataSections()

LLVM_ABI bool llvm::codegen::getDataSections ( )

References LLVM_ABI.

◆ getDebuggerTuningOpt()

LLVM_ABI llvm::DebuggerKind llvm::codegen::getDebuggerTuningOpt ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getDebugStrictDwarf()

LLVM_ABI bool llvm::codegen::getDebugStrictDwarf ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getDefaultValueTrackingVariableLocations()

LLVM_ABI bool llvm::codegen::getDefaultValueTrackingVariableLocations ( const llvm::Triple & T)

Should value-tracking variable locations / instruction referencing be enabled by default for this triple?

References llvm::Default, LLVM_ABI, and T.

◆ getDenormalFP32Math()

LLVM_ABI DenormalMode::DenormalModeKind llvm::codegen::getDenormalFP32Math ( )

References LLVM_ABI.

Referenced by setFunctionAttributes().

◆ getDenormalFPMath()

LLVM_ABI DenormalMode::DenormalModeKind llvm::codegen::getDenormalFPMath ( )

◆ getDisableIntegratedAS()

LLVM_ABI bool llvm::codegen::getDisableIntegratedAS ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getDisableTailCalls()

LLVM_ABI bool llvm::codegen::getDisableTailCalls ( )

References LLVM_ABI.

Referenced by setFunctionAttributes().

◆ getDontPlaceZerosInBSS()

LLVM_ABI bool llvm::codegen::getDontPlaceZerosInBSS ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEABIVersion()

LLVM_ABI llvm::EABI llvm::codegen::getEABIVersion ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEmitCallSiteInfo()

LLVM_ABI bool llvm::codegen::getEmitCallSiteInfo ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEmulatedTLS()

LLVM_ABI bool llvm::codegen::getEmulatedTLS ( )

References LLVM_ABI.

◆ getEnableAddrsig()

LLVM_ABI bool llvm::codegen::getEnableAddrsig ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableAIXExtendedAltivecABI()

LLVM_ABI bool llvm::codegen::getEnableAIXExtendedAltivecABI ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableBBAddrMap()

LLVM_ABI bool llvm::codegen::getEnableBBAddrMap ( )

References B(), F, LLVM_ABI, and Options.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableCallGraphSection()

LLVM_ABI bool llvm::codegen::getEnableCallGraphSection ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableDebugEntryValues()

LLVM_ABI bool llvm::codegen::getEnableDebugEntryValues ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableGuaranteedTailCallOpt()

LLVM_ABI bool llvm::codegen::getEnableGuaranteedTailCallOpt ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableHonorSignDependentRoundingFPMath()

LLVM_ABI bool llvm::codegen::getEnableHonorSignDependentRoundingFPMath ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableMachineFunctionSplitter()

LLVM_ABI bool llvm::codegen::getEnableMachineFunctionSplitter ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableNoInfsFPMath()

LLVM_ABI bool llvm::codegen::getEnableNoInfsFPMath ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableNoNaNsFPMath()

LLVM_ABI bool llvm::codegen::getEnableNoNaNsFPMath ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableNoSignedZerosFPMath()

LLVM_ABI bool llvm::codegen::getEnableNoSignedZerosFPMath ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableNoTrappingFPMath()

LLVM_ABI bool llvm::codegen::getEnableNoTrappingFPMath ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableStackSizeSection()

LLVM_ABI bool llvm::codegen::getEnableStackSizeSection ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableStaticDataPartitioning()

LLVM_ABI bool llvm::codegen::getEnableStaticDataPartitioning ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getEnableTLSDESC()

LLVM_ABI bool llvm::codegen::getEnableTLSDESC ( )

References LLVM_ABI.

◆ getEnableUnsafeFPMath()

LLVM_ABI bool llvm::codegen::getEnableUnsafeFPMath ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getExceptionModel()

LLVM_ABI llvm::ExceptionHandling llvm::codegen::getExceptionModel ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getExplicitCodeModel()

LLVM_ABI std::optional< CodeModel::Model > llvm::codegen::getExplicitCodeModel ( )

References LLVM_ABI.

Referenced by createTargetMachineForTriple().

◆ getExplicitDataSections()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitDataSections ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getExplicitEmulatedTLS()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitEmulatedTLS ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getExplicitEnableTLSDESC()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitEnableTLSDESC ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getExplicitFileType()

LLVM_ABI std::optional< CodeGenFileType > llvm::codegen::getExplicitFileType ( )

References LLVM_ABI.

◆ getExplicitFunctionSections()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitFunctionSections ( )

References LLVM_ABI.

◆ getExplicitLargeDataThreshold()

LLVM_ABI std::optional< uint64_t > llvm::codegen::getExplicitLargeDataThreshold ( )

References LLVM_ABI.

◆ getExplicitRelocModel()

LLVM_ABI std::optional< Reloc::Model > llvm::codegen::getExplicitRelocModel ( )

References LLVM_ABI.

Referenced by createTargetMachineForTriple().

◆ getExplicitValueTrackingVariableLocations()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitValueTrackingVariableLocations ( )

References LLVM_ABI.

◆ getFeatureList()

std::vector< std::string > llvm::codegen::getFeatureList ( )

◆ getFeaturesStr()

◆ getFileType()

LLVM_ABI CodeGenFileType llvm::codegen::getFileType ( )

References LLVM_ABI.

◆ getFloatABIForCalls()

LLVM_ABI llvm::FloatABI::ABIType llvm::codegen::getFloatABIForCalls ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getForceDwarfFrameSection()

LLVM_ABI bool llvm::codegen::getForceDwarfFrameSection ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getFramePointerUsage()

LLVM_ABI FramePointerKind llvm::codegen::getFramePointerUsage ( )

References LLVM_ABI.

Referenced by setFunctionAttributes().

◆ getFunctionSections()

LLVM_ABI bool llvm::codegen::getFunctionSections ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getFuseFPOps()

LLVM_ABI llvm::FPOpFusion::FPOpFusionMode llvm::codegen::getFuseFPOps ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getIgnoreXCOFFVisibility()

LLVM_ABI bool llvm::codegen::getIgnoreXCOFFVisibility ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getJMCInstrument()

LLVM_ABI bool llvm::codegen::getJMCInstrument ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getLargeDataThreshold()

LLVM_ABI uint64_t llvm::codegen::getLargeDataThreshold ( )

References LLVM_ABI.

◆ getMArch()

LLVM_ABI std::string llvm::codegen::getMArch ( )

References LLVM_ABI.

Referenced by createTargetMachineForTriple().

◆ getMAttrs()

LLVM_ABI std::vector< std::string > llvm::codegen::getMAttrs ( )

References LLVM_ABI.

Referenced by getFeatureList(), and getFeaturesStr().

◆ getMCPU()

LLVM_ABI std::string llvm::codegen::getMCPU ( )

References LLVM_ABI.

Referenced by getCPUStr(), getFeatureList(), and getFeaturesStr().

◆ getRelocModel()

LLVM_ABI Reloc::Model llvm::codegen::getRelocModel ( )

References LLVM_ABI.

◆ getSeparateNamedSections()

LLVM_ABI bool llvm::codegen::getSeparateNamedSections ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getStackRealign()

LLVM_ABI bool llvm::codegen::getStackRealign ( )

References LLVM_ABI.

Referenced by setFunctionAttributes().

◆ getStackSymbolOrdering()

LLVM_ABI bool llvm::codegen::getStackSymbolOrdering ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getSwiftAsyncFramePointer()

LLVM_ABI SwiftAsyncFramePointerMode llvm::codegen::getSwiftAsyncFramePointer ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getThreadModel()

LLVM_ABI ThreadModel::Model llvm::codegen::getThreadModel ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getTLSSize()

LLVM_ABI unsigned llvm::codegen::getTLSSize ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getTrapFuncName()

LLVM_ABI std::string llvm::codegen::getTrapFuncName ( )

References LLVM_ABI.

Referenced by setFunctionAttributes().

◆ getUniqueBasicBlockSectionNames()

LLVM_ABI bool llvm::codegen::getUniqueBasicBlockSectionNames ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getUniqueSectionNames()

LLVM_ABI bool llvm::codegen::getUniqueSectionNames ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getUseCtors()

LLVM_ABI bool llvm::codegen::getUseCtors ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getValueTrackingVariableLocations()

LLVM_ABI bool llvm::codegen::getValueTrackingVariableLocations ( )

References LLVM_ABI.

◆ getXCOFFReadOnlyPointers()

LLVM_ABI bool llvm::codegen::getXCOFFReadOnlyPointers ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getXCOFFTracebackTable()

LLVM_ABI bool llvm::codegen::getXCOFFTracebackTable ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ getXRayFunctionIndex()

LLVM_ABI bool llvm::codegen::getXRayFunctionIndex ( )

References LLVM_ABI.

Referenced by InitTargetOptionsFromCodeGenFlags().

◆ InitTargetOptionsFromCodeGenFlags()

TargetOptions llvm::codegen::InitTargetOptionsFromCodeGenFlags ( const llvm::Triple & TheTriple)

Common utility function tightly tied to the options listed here.

Initializes a TargetOptions object with CodeGen flags and returns it. TheTriple is used to determine the default value for options if options are not explicitly specified. If those triple dependant options value do not have effect for your component, a default Triple() could be passed in.

Definition at line 552 of file CommandFlags.cpp.

References llvm::FloatABI::Default, getAlignLoops(), getBBSectionsMode(), getDebuggerTuningOpt(), getDebugStrictDwarf(), getDenormalFPMath(), getDisableIntegratedAS(), getDontPlaceZerosInBSS(), getEABIVersion(), getEmitCallSiteInfo(), getEnableAddrsig(), getEnableAIXExtendedAltivecABI(), getEnableBBAddrMap(), getEnableCallGraphSection(), getEnableDebugEntryValues(), getEnableGuaranteedTailCallOpt(), getEnableHonorSignDependentRoundingFPMath(), getEnableMachineFunctionSplitter(), getEnableNoInfsFPMath(), getEnableNoNaNsFPMath(), getEnableNoSignedZerosFPMath(), getEnableNoTrappingFPMath(), getEnableStackSizeSection(), getEnableStaticDataPartitioning(), getEnableUnsafeFPMath(), getExceptionModel(), getExplicitDataSections(), getExplicitEmulatedTLS(), getExplicitEnableTLSDESC(), getFloatABIForCalls(), getForceDwarfFrameSection(), getFunctionSections(), getFuseFPOps(), getIgnoreXCOFFVisibility(), getJMCInstrument(), getSeparateNamedSections(), getStackSymbolOrdering(), getSwiftAsyncFramePointer(), getThreadModel(), getTLSSize(), getUniqueBasicBlockSectionNames(), getUniqueSectionNames(), getUseCtors(), getXCOFFReadOnlyPointers(), getXCOFFTracebackTable(), getXRayFunctionIndex(), llvm::Triple::hasDefaultDataSections(), llvm::Triple::hasDefaultEmulatedTLS(), llvm::Triple::hasDefaultTLSDESC(), llvm::mc::InitMCTargetOptionsFromFlags(), InitTargetOptionsFromCodeGenFlags(), and Options.

Referenced by createTargetMachineForTriple(), and InitTargetOptionsFromCodeGenFlags().

◆ renderBoolStringAttr()

void llvm::codegen::renderBoolStringAttr ( AttrBuilder & B,
StringRef Name,
bool Val )

Definition at line 659 of file CommandFlags.cpp.

References B(), and renderBoolStringAttr().

Referenced by renderBoolStringAttr().

◆ setFunctionAttributes() [1/2]

◆ setFunctionAttributes() [2/2]

void llvm::codegen::setFunctionAttributes ( StringRef CPU,
StringRef Features,
Module & M )

Set function attributes of functions in Module M based on CPU, Features, and command line flags.

Definition at line 749 of file CommandFlags.cpp.

References F, and setFunctionAttributes().