LLVM: llvm::codegen Namespace Reference (original) (raw)

Classes
struct RegisterCodeGenFlags
Create this object with static storage to register codegen-related command line options. More...
struct RegisterSaveStatsFlag
Tools that support stats saving should create this object with static storage to register the –save-stats command line option. More...
Enumerations
enum SaveStatsMode { None, Cwd, Obj }
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::Model > getExplicitRelocModel ()
LLVM_ABI ThreadModel::Model getThreadModel ()
LLVM_ABI CodeModel::Model getCodeModel ()
LLVM_ABI std::optional< CodeModel::Model > getExplicitCodeModel ()
LLVM_ABI uint64_t getLargeDataThreshold ()
LLVM_ABI std::optional< uint64_t > getExplicitLargeDataThreshold ()
LLVM_ABI llvm::ExceptionHandling getExceptionModel ()
LLVM_ABI std::optional< CodeGenFileType > getExplicitFileType ()
LLVM_ABI CodeGenFileType getFileType ()
LLVM_ABI FramePointerKind getFramePointerUsage ()
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< bool > getExplicitDataSections ()
LLVM_ABI bool getFunctionSections ()
LLVM_ABI std::optional< bool > getExplicitFunctionSections ()
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< bool > getExplicitEmulatedTLS ()
LLVM_ABI bool getEnableTLSDESC ()
LLVM_ABI std::optional< bool > getExplicitEnableTLSDESC ()
LLVM_ABI bool getUniqueSectionNames ()
LLVM_ABI bool getUniqueBasicBlockSectionNames ()
LLVM_ABI bool getSeparateNamedSections ()
LLVM_ABI llvm::EABI getEABIVersion ()
LLVM_ABI llvm::DebuggerKind getDebuggerTuningOpt ()
LLVM_ABI llvm::VectorLibrary getVectorLibrary ()
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< bool > getExplicitValueTrackingVariableLocations ()
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 SaveStatsMode getSaveStats ()
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.
LLVM_ABI void MaybeEnableStatistics ()
Conditionally enables the collection of LLVM statistics during the tool run, based on the value of the flag.
LLVM_ABI int MaybeSaveStatistics (StringRef OutputFilename, StringRef ToolName)
Conditionally saves the collected LLVM statistics to the received output file, based on the value of the flag.

SaveStatsMode

createTargetMachineForTriple()

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

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

Referenced by createTargetMachineForTriple().

getAlignLoops()

getBBSections()

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

getBBSectionsMode()

getCodeModel()

getCPUStr()

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

getDataSections()

getDebuggerTuningOpt()

getDebugStrictDwarf()

getDefaultValueTrackingVariableLocations()

getDenormalFP32Math()

getDenormalFPMath()

getDisableIntegratedAS()

getDisableTailCalls()

getDontPlaceZerosInBSS()

getEABIVersion()

getEmitCallSiteInfo()

getEmulatedTLS()

getEnableAddrsig()

getEnableAIXExtendedAltivecABI()

LLVM_ABI bool llvm::codegen::getEnableAIXExtendedAltivecABI ( )

getEnableBBAddrMap()

getEnableCallGraphSection()

getEnableDebugEntryValues()

getEnableGuaranteedTailCallOpt()

LLVM_ABI bool llvm::codegen::getEnableGuaranteedTailCallOpt ( )

getEnableHonorSignDependentRoundingFPMath()

LLVM_ABI bool llvm::codegen::getEnableHonorSignDependentRoundingFPMath ( )

getEnableMachineFunctionSplitter()

LLVM_ABI bool llvm::codegen::getEnableMachineFunctionSplitter ( )

getEnableNoInfsFPMath()

getEnableNoNaNsFPMath()

getEnableNoSignedZerosFPMath()

LLVM_ABI bool llvm::codegen::getEnableNoSignedZerosFPMath ( )

getEnableNoTrappingFPMath()

getEnableStackSizeSection()

getEnableStaticDataPartitioning()

LLVM_ABI bool llvm::codegen::getEnableStaticDataPartitioning ( )

getEnableTLSDESC()

getExceptionModel()

getExplicitCodeModel()

getExplicitDataSections()

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

getExplicitEmulatedTLS()

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

getExplicitEnableTLSDESC()

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

getExplicitFileType()

getExplicitFunctionSections()

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

getExplicitLargeDataThreshold()

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

getExplicitRelocModel()

getExplicitValueTrackingVariableLocations()

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

getFeatureList()

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

getFeaturesStr()

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

getFileType()

getFloatABIForCalls()

getForceDwarfFrameSection()

getFramePointerUsage()

getFunctionSections()

getFuseFPOps()

getIgnoreXCOFFVisibility()

getJMCInstrument()

getLargeDataThreshold()

getMArch()

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

getMAttrs()

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

getMCPU()

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

getRelocModel()

getSaveStats()

getSeparateNamedSections()

getStackRealign()

getStackSymbolOrdering()

getSwiftAsyncFramePointer()

getThreadModel()

getTLSSize()

getTrapFuncName()

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

getUniqueBasicBlockSectionNames()

LLVM_ABI bool llvm::codegen::getUniqueBasicBlockSectionNames ( )

getUniqueSectionNames()

getUseCtors()

getValueTrackingVariableLocations()

LLVM_ABI bool llvm::codegen::getValueTrackingVariableLocations ( )

getVectorLibrary()

getXCOFFReadOnlyPointers()

getXCOFFTracebackTable()

getXRayFunctionIndex()

InitTargetOptionsFromCodeGenFlags()

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 596 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(), getExceptionModel(), getExplicitDataSections(), getExplicitEmulatedTLS(), getExplicitEnableTLSDESC(), getFloatABIForCalls(), getForceDwarfFrameSection(), getFunctionSections(), getFuseFPOps(), getIgnoreXCOFFVisibility(), getJMCInstrument(), getSeparateNamedSections(), getStackSymbolOrdering(), getSwiftAsyncFramePointer(), getThreadModel(), getTLSSize(), getUniqueBasicBlockSectionNames(), getUniqueSectionNames(), getUseCtors(), getVectorLibrary(), getXCOFFReadOnlyPointers(), getXCOFFTracebackTable(), getXRayFunctionIndex(), llvm::Triple::hasDefaultDataSections(), llvm::Triple::hasDefaultEmulatedTLS(), llvm::Triple::hasDefaultTLSDESC(), llvm::mc::InitMCTargetOptionsFromFlags(), InitTargetOptionsFromCodeGenFlags(), and Options.

Referenced by createTargetMachineForTriple(), and InitTargetOptionsFromCodeGenFlags().

MaybeEnableStatistics()

void llvm::codegen::MaybeEnableStatistics ( )

MaybeSaveStatistics()

Conditionally saves the collected LLVM statistics to the received output file, based on the value of the flag.

Should be called after the tool run, and must follow a call to MaybeEnableStatistics() to actually have data to write.

Definition at line 828 of file CommandFlags.cpp.

References llvm::sys::path::append(), assert(), Cwd, llvm::WithColor::error(), llvm::errs(), llvm::sys::path::filename(), getSaveStats(), MaybeSaveStatistics(), None, Obj, llvm::sys::fs::OF_TextWithCRLF, OutputFilename, llvm::PrintStatisticsJSON(), llvm::sys::path::remove_filename(), and llvm::sys::path::replace_extension().

Referenced by MaybeSaveStatistics().

renderBoolStringAttr()

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

setFunctionAttributes() [1/2]

Set function attributes of function F based on CPU, Features, and command line flags.

Definition at line 715 of file CommandFlags.cpp.

References llvm::All, llvm::SmallString< InternalLen >::append(), B(), Call, llvm::dyn_cast(), llvm::StringRef::empty(), F, llvm::Attribute::get(), getDenormalFP32Math(), getDenormalFPMath(), getDisableTailCalls(), getFramePointerUsage(), getStackRealign(), getTrapFuncName(), HANDLE_BOOL_ATTR, I, llvm::None, llvm::NonLeaf, llvm::NonLeafNoReserve, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Reserved, setFunctionAttributes(), and llvm::toStringRef().

Referenced by setFunctionAttributes(), and setFunctionAttributes().

setFunctionAttributes() [2/2]