LLVM 19.0.0git
Classes | Functions
llvm::codegen Namespace Reference

Classes

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

Functions

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

Creates a TargetMachine instance with the options defined on the command line.

This can be used for tools that do not need further customization of the TargetOptions.

Definition at line 745 of file CommandFlags.cpp.

References llvm::createStringError(), llvm::Target::createTargetMachine(), getCPUStr(), getExplicitCodeModel(), getExplicitRelocModel(), getFeaturesStr(), getMArch(), llvm::Triple::getTriple(), llvm::inconvertibleErrorCode(), InitTargetOptionsFromCodeGenFlags(), and llvm::TargetRegistry::lookupTarget().

◆ getAlignLoops()

unsigned llvm::codegen::getAlignLoops ( )

◆ getBBSections()

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

Referenced by getBBSectionsMode().

◆ getBBSectionsMode()

llvm::BasicBlockSection llvm::codegen::getBBSectionsMode ( llvm::TargetOptions Options)

◆ getCodeModel()

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

◆ getCPUStr()

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

Definition at line 599 of file CommandFlags.cpp.

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

Referenced by createTargetMachineForTriple().

◆ getDataSections()

bool llvm::codegen::getDataSections ( )

◆ getDebuggerTuningOpt()

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

◆ getDebugStrictDwarf()

bool llvm::codegen::getDebugStrictDwarf ( )

◆ getDefaultValueTrackingVariableLocations()

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

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

◆ getDenormalFP32Math()

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

Referenced by setFunctionAttributes().

◆ getDenormalFPMath()

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

◆ getDisableIntegratedAS()

bool llvm::codegen::getDisableIntegratedAS ( )

◆ getDisableTailCalls()

bool llvm::codegen::getDisableTailCalls ( )

Referenced by setFunctionAttributes().

◆ getDontPlaceZerosInBSS()

bool llvm::codegen::getDontPlaceZerosInBSS ( )

◆ getEABIVersion()

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

◆ getEmitCallSiteInfo()

bool llvm::codegen::getEmitCallSiteInfo ( )

◆ getEmulatedTLS()

bool llvm::codegen::getEmulatedTLS ( )

◆ getEnableAddrsig()

bool llvm::codegen::getEnableAddrsig ( )

◆ getEnableAIXExtendedAltivecABI()

bool llvm::codegen::getEnableAIXExtendedAltivecABI ( )

◆ getEnableApproxFuncFPMath()

bool llvm::codegen::getEnableApproxFuncFPMath ( )

◆ getEnableBBAddrMap()

bool llvm::codegen::getEnableBBAddrMap ( )

◆ getEnableDebugEntryValues()

bool llvm::codegen::getEnableDebugEntryValues ( )

◆ getEnableGuaranteedTailCallOpt()

bool llvm::codegen::getEnableGuaranteedTailCallOpt ( )

◆ getEnableHonorSignDependentRoundingFPMath()

bool llvm::codegen::getEnableHonorSignDependentRoundingFPMath ( )

◆ getEnableMachineFunctionSplitter()

bool llvm::codegen::getEnableMachineFunctionSplitter ( )

◆ getEnableNoInfsFPMath()

bool llvm::codegen::getEnableNoInfsFPMath ( )

◆ getEnableNoNaNsFPMath()

bool llvm::codegen::getEnableNoNaNsFPMath ( )

◆ getEnableNoSignedZerosFPMath()

bool llvm::codegen::getEnableNoSignedZerosFPMath ( )

◆ getEnableNoTrappingFPMath()

bool llvm::codegen::getEnableNoTrappingFPMath ( )

◆ getEnableStackSizeSection()

bool llvm::codegen::getEnableStackSizeSection ( )

◆ getEnableTLSDESC()

bool llvm::codegen::getEnableTLSDESC ( )

◆ getEnableUnsafeFPMath()

bool llvm::codegen::getEnableUnsafeFPMath ( )

◆ getExceptionModel()

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

◆ getExplicitCodeModel()

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

◆ getExplicitDataSections()

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

◆ getExplicitEmulatedTLS()

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

◆ getExplicitEnableTLSDESC()

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

◆ getExplicitFileType()

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

◆ getExplicitFunctionSections()

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

◆ getExplicitLargeDataThreshold()

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

◆ getExplicitRelocModel()

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

◆ getExplicitValueTrackingVariableLocations()

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

◆ getFeatureList()

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

◆ getFeaturesStr()

std::string llvm::codegen::getFeaturesStr ( )

◆ getFileType()

CodeGenFileType llvm::codegen::getFileType ( )

◆ getFloatABIForCalls()

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

◆ getForceDwarfFrameSection()

bool llvm::codegen::getForceDwarfFrameSection ( )

◆ getFramePointerUsage()

FramePointerKind llvm::codegen::getFramePointerUsage ( )

Referenced by setFunctionAttributes().

◆ getFunctionSections()

bool llvm::codegen::getFunctionSections ( )

◆ getFuseFPOps()

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

◆ getIgnoreXCOFFVisibility()

bool llvm::codegen::getIgnoreXCOFFVisibility ( )

◆ getJMCInstrument()

bool llvm::codegen::getJMCInstrument ( )

◆ getLargeDataThreshold()

uint64_t llvm::codegen::getLargeDataThreshold ( )

◆ getMArch()

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

◆ getMAttrs()

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

Referenced by getFeatureList(), and getFeaturesStr().

◆ getMCPU()

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

◆ getRelocModel()

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

◆ getStackRealign()

bool llvm::codegen::getStackRealign ( )

Referenced by setFunctionAttributes().

◆ getStackSymbolOrdering()

bool llvm::codegen::getStackSymbolOrdering ( )

◆ getSwiftAsyncFramePointer()

SwiftAsyncFramePointerMode llvm::codegen::getSwiftAsyncFramePointer ( )

◆ getThreadModel()

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

◆ getTLSSize()

unsigned llvm::codegen::getTLSSize ( )

◆ getTrapFuncName()

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

Referenced by setFunctionAttributes().

◆ getUniqueBasicBlockSectionNames()

bool llvm::codegen::getUniqueBasicBlockSectionNames ( )

◆ getUniqueSectionNames()

bool llvm::codegen::getUniqueSectionNames ( )

◆ getUseCtors()

bool llvm::codegen::getUseCtors ( )

◆ getValueTrackingVariableLocations()

bool llvm::codegen::getValueTrackingVariableLocations ( )

◆ getXCOFFReadOnlyPointers()

bool llvm::codegen::getXCOFFReadOnlyPointers ( )

◆ getXCOFFTracebackTable()

bool llvm::codegen::getXCOFFTracebackTable ( )

◆ getXRayFunctionIndex()

bool llvm::codegen::getXRayFunctionIndex ( )

◆ 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 538 of file CommandFlags.cpp.

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

Referenced by createTargetMachineForTriple().

◆ renderBoolStringAttr()

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

Definition at line 649 of file CommandFlags.cpp.

References B, and Name.

◆ setFunctionAttributes() [1/2]

void llvm::codegen::setFunctionAttributes ( StringRef  CPU,
StringRef  Features,
Function F 
)

◆ 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 738 of file CommandFlags.cpp.

References F, and setFunctionAttributes().