|
LLVM 24.0.0git
|
Provides information about what library functions are available for the current target. More...
#include "llvm/Analysis/TargetLibraryInfo.h"
Public Member Functions | |
| TargetLibraryInfo ()=delete | |
| TargetLibraryInfo (const TargetLibraryInfoImpl &Impl, std::optional< const Function * > F=std::nullopt) | |
| TargetLibraryInfo (const TargetLibraryInfo &TLI)=default | |
| TargetLibraryInfo (TargetLibraryInfo &&TLI)=default | |
| TargetLibraryInfo & | operator= (const TargetLibraryInfo &TLI)=default |
| TargetLibraryInfo & | operator= (TargetLibraryInfo &&TLI)=default |
| bool | areInlineCompatible (const TargetLibraryInfo &CalleeTLI, bool AllowCallerSuperset) const |
| Determine whether a callee with the given TLI can be inlined into caller with this TLI, based on 'nobuiltin' attributes. | |
| bool | isValidProtoForLibFunc (const FunctionType &FTy, LibFunc F, const Module &M) const |
| Return true if the function type FTy is valid for the library function F, regardless of whether the function is available. | |
| LibFunc | getLibFunc (StringRef funcName) const |
| Searches for a particular function name. | |
| LibFunc | getLibFunc (const Function &FDecl) const |
| LibFunc | getLibFunc (const CallBase &CB) const |
| If a callbase does not have the 'nobuiltin' attribute, return the library function the callee is, and NotLibFunc otherwise. | |
| LibFunc | getLibFunc (unsigned int Opcode, Type *Ty) const |
Searches for a function name using an Instruction Opcode. | |
| void | disableAllFunctions () |
| Disables all builtins. | |
| void | setUnavailable (LibFunc F) |
| Forces a function to be marked as unavailable. | |
| TargetLibraryInfoImpl::AvailabilityState | getState (LibFunc F) const |
| bool | has (LibFunc F) const |
| Tests whether a library function is available. | |
| bool | isFunctionVectorizable (StringRef F, const ElementCount &VF) const |
| bool | isFunctionVectorizable (StringRef F) const |
| StringRef | getVectorizedFunction (StringRef F, const ElementCount &VF, bool Masked=false) const |
| const VecDesc * | getVectorMappingInfo (StringRef F, const ElementCount &VF, bool Masked) const |
| bool | hasOptimizedCodeGen (LibFunc F) const |
| Tests if the function is both available and a candidate for optimized code generation. | |
| StringRef | getName (LibFunc F) const |
| Attribute::AttrKind | getExtAttrForI32Param (bool Signed=true) const |
| Attribute::AttrKind | getExtAttrForI32Return (bool Signed=true) const |
| AttributeList | getAttrList (LLVMContext *C, ArrayRef< unsigned > ArgNos, bool Signed, bool Ret=false, AttributeList AL=AttributeList()) const |
| unsigned | getWCharSize (const Module &M) const |
| Returns the size of the wchar_t type in bytes. | |
| unsigned | getSizeTSize (const Module &M) const |
| Returns the size of the size_t type in bits. | |
| IntegerType * | getSizeTType (const Module &M) const |
| Returns an IntegerType corresponding to size_t. | |
| ConstantInt * | getAsSizeT (uint64_t V, const Module &M) const |
| Returns a constant materialized as a size_t type. | |
| unsigned | getIntSize () const |
| Get size of a C-level int or unsigned int, in bits. | |
| bool | invalidate (Module &, const PreservedAnalyses &, ModuleAnalysisManager::Invalidator &) |
| Handle invalidation from the pass manager. | |
| bool | invalidate (Function &, const PreservedAnalyses &, FunctionAnalysisManager::Invalidator &) |
| void | getWidestVF (StringRef ScalarF, ElementCount &FixedVF, ElementCount &ScalableVF) const |
| Returns the largest vectorization factor used in the list of vector functions. | |
| bool | isKnownVectorFunctionInLibrary (StringRef F) const |
| Check if the function "F" is listed in a library known to LLVM. | |
| bool | isErrnoFunctionCall () const |
| Returns whether errno is defined as a function call on known environments. | |
Static Public Member Functions | |
| static StringRef | getStandardName (LibFunc F) |
| Return the canonical name for a LibFunc. | |
| static void | initExtensionsForTriple (bool &ShouldExtI32Param, bool &ShouldExtI32Return, bool &ShouldSignExtI32Param, bool &ShouldSignExtI32Return, const Triple &T) |
| static Attribute::AttrKind | getExtAttrForI32Param (const Triple &T, bool Signed=true) |
| static Attribute::AttrKind | getExtAttrForI32Return (const Triple &T, bool Signed=true) |
Friends | |
| class | TargetLibraryAnalysis |
| class | TargetLibraryInfoWrapperPass |
Provides information about what library functions are available for the current target.
This both allows optimizations to handle them specially and frontends to disable such optimizations through -fno-builtin etc.
Definition at line 283 of file TargetLibraryInfo.h.
|
delete |
Referenced by areInlineCompatible(), operator=(), operator=(), TargetLibraryInfo(), and TargetLibraryInfo().
|
inlineexplicit |
Definition at line 297 of file TargetLibraryInfo.h.
References disableAllFunctions(), F, getLibFunc(), and setUnavailable().
|
default |
References TargetLibraryInfo().
|
default |
References TargetLibraryInfo().
|
inline |
Determine whether a callee with the given TLI can be inlined into caller with this TLI, based on 'nobuiltin' attributes.
When requested, allow inlining into a caller with a superset of the callee's nobuiltin attributes, which is conservatively correct.
Definition at line 329 of file TargetLibraryInfo.h.
References TargetLibraryInfo().
|
inline |
Disables all builtins.
This can be used for options like -fno-builtin.
Definition at line 376 of file TargetLibraryInfo.h.
Referenced by TargetLibraryInfo().
|
inline |
Returns a constant materialized as a size_t type.
Definition at line 583 of file TargetLibraryInfo.h.
References getSizeTType(), and uint64_t.
|
inline |
Definition at line 557 of file TargetLibraryInfo.h.
References C(), and llvm::Signed.
|
inline |
Definition at line 519 of file TargetLibraryInfo.h.
References llvm::Signed.
|
inlinestatic |
Definition at line 509 of file TargetLibraryInfo.h.
References initExtensionsForTriple(), llvm::Signed, and T.
|
inline |
Definition at line 549 of file TargetLibraryInfo.h.
References llvm::Signed.
|
inlinestatic |
Definition at line 539 of file TargetLibraryInfo.h.
References initExtensionsForTriple(), llvm::Signed, and T.
|
inline |
Get size of a C-level int or unsigned int, in bits.
Definition at line 588 of file TargetLibraryInfo.h.
Referenced by getIntTy(), and mergeComparisons().
If a callbase does not have the 'nobuiltin' attribute, return the library function the callee is, and NotLibFunc otherwise.
Definition at line 359 of file TargetLibraryInfo.h.
References llvm::CallBase::getCalledFunction(), getLibFunc(), and llvm::CallBase::isNoBuiltin().
Definition at line 353 of file TargetLibraryInfo.h.
|
inline |
Searches for a particular function name.
Returns the corresponding LibFunc if it is one of the known library functions, and NotLibFunc otherwise.
Definition at line 349 of file TargetLibraryInfo.h.
Referenced by llvm::callsGCLeafFunction(), llvm::ConstantFoldCall(), llvm::emitBinaryFloatFnCall(), llvm::emitUnaryFloatFnCall(), foldLibCalls(), getAllocationDataForFunction(), llvm::getAllocationFamily(), llvm::TargetTransformInfo::getArithmeticInstrCost(), llvm::MemoryLocation::getForArgument(), llvm::getFreedOperand(), llvm::getIntrinsicForCallSite(), getIntrinsicFromLibfunc(), getLibFunc(), llvm::inferNonMandatoryLibFuncAttrs(), insertSinCosCall(), isAllocationWithHotColdVariant(), isAllocSiteRemovable(), isIntrinsicOrLFToBeTailCalled(), isKnownLibFunction(), isKnownLibFunction(), llvm::lto::InputFile::Symbol::isLibcall(), llvm::isLibFuncEmittable(), llvm::isMathLibCallNoop(), llvm::maybeMarkSanitizerLibraryCallNoBuiltin(), peephole(), runPartiallyInlineLibCalls(), shouldCheckArgs(), and TargetLibraryInfo().
Searches for a function name using an Instruction Opcode.
Currently, only the frem instruction is supported.
Returns NotLibFunc if there is no matching library function.
Definition at line 369 of file TargetLibraryInfo.h.
|
inline |
Definition at line 455 of file TargetLibraryInfo.h.
References assert(), F, and getState().
Referenced by llvm::emitCalloc(), llvm::emitFPutC(), llvm::emitFPutS(), llvm::emitFWrite(), llvm::emitHotColdNew(), llvm::emitHotColdNewAligned(), llvm::emitHotColdNewAlignedNoThrow(), llvm::emitHotColdNewNoThrow(), llvm::emitHotColdSizeReturningNew(), llvm::emitHotColdSizeReturningNewAligned(), emitLibCall(), llvm::emitMalloc(), llvm::emitPutChar(), llvm::emitPutS(), llvm::TargetTransformInfo::getArithmeticInstrCost(), llvm::getFloatFn(), getIntrinsicFromLibfunc(), llvm::lto::LTO::getLibFuncSymbols(), llvm::getOrInsertLibFunc(), llvm::isLibFuncEmittable(), runNewPMPasses(), and trySplitVectorSinCos().
Returns the size of the size_t type in bits.
Definition at line 575 of file TargetLibraryInfo.h.
Referenced by getSizeTTy(), getSizeTType(), and mergeComparisons().
|
inline |
Returns an IntegerType corresponding to size_t.
Definition at line 578 of file TargetLibraryInfo.h.
References llvm::IntegerType::get(), and getSizeTSize().
Referenced by getAsSizeT().
|
inlinestatic |
Return the canonical name for a LibFunc.
This should not be used for semantic purposes, use getName instead.
Definition at line 449 of file TargetLibraryInfo.h.
References F.
|
inline |
Definition at line 384 of file TargetLibraryInfo.h.
Referenced by getName(), has(), and hasOptimizedCodeGen().
|
inline |
Definition at line 401 of file TargetLibraryInfo.h.
References F, and llvm::Masked.
|
inline |
Definition at line 405 of file TargetLibraryInfo.h.
References F, and llvm::Masked.
Referenced by addMappingsFromTLI(), hasVectorMapping(), and replaceWithCallToVeclib().
Returns the size of the wchar_t type in bytes.
This queries the 'wchar_size' metadata.
Definition at line 570 of file TargetLibraryInfo.h.
|
inline |
Returns the largest vectorization factor used in the list of vector functions.
Definition at line 606 of file TargetLibraryInfo.h.
Referenced by addMappingsFromTLI(), and llvm::isTLIScalarize().
|
inline |
Tests whether a library function is available.
Definition at line 392 of file TargetLibraryInfo.h.
References F, and getState().
Referenced by llvm::callsGCLeafFunction(), getAllocationDataForFunction(), llvm::getAllocationFamily(), llvm::MemoryLocation::getForArgument(), llvm::getFreedOperand(), llvm::lto::LTO::getLibFuncSymbols(), llvm::getOrInsertLibFunc(), llvm::inferNonMandatoryLibFuncAttrs(), isAllocSiteRemovable(), llvm::lto::InputFile::Symbol::isLibcall(), llvm::isLibFuncEmittable(), and runPartiallyInlineLibCalls().
|
inline |
Tests if the function is both available and a candidate for optimized code generation.
Definition at line 412 of file TargetLibraryInfo.h.
References F, and getState().
Referenced by llvm::maybeMarkSanitizerLibraryCallNoBuiltin().
|
inlinestatic |
Definition at line 467 of file TargetLibraryInfo.h.
References llvm::Triple::sparcv9, llvm::Triple::systemz, and T.
Referenced by getExtAttrForI32Param(), getExtAttrForI32Return(), and initializeBase().
|
inline |
Definition at line 600 of file TargetLibraryInfo.h.
|
inline |
Handle invalidation from the pass manager.
If we try to invalidate this info, just return false. It cannot become invalid even if the module or function changes.
Definition at line 596 of file TargetLibraryInfo.h.
|
inline |
Returns whether errno is defined as a function call on known environments.
Definition at line 618 of file TargetLibraryInfo.h.
Definition at line 398 of file TargetLibraryInfo.h.
References F.
|
inline |
Definition at line 395 of file TargetLibraryInfo.h.
References F.
Referenced by addMappingsFromTLI(), llvm::TargetTransformInfo::getArithmeticInstrCost(), isKnownVectorFunctionInLibrary(), and llvm::isTLIScalarize().
Check if the function "F" is listed in a library known to LLVM.
Definition at line 612 of file TargetLibraryInfo.h.
References F, and isFunctionVectorizable().
Referenced by isKnownLibFunction(), and isKnownLibFunction().
|
inline |
Return true if the function type FTy is valid for the library function F, regardless of whether the function is available.
Definition at line 340 of file TargetLibraryInfo.h.
References F.
Referenced by llvm::isLibFuncEmittable().
|
default |
References TargetLibraryInfo().
|
default |
References TargetLibraryInfo().
|
inline |
Forces a function to be marked as unavailable.
Definition at line 379 of file TargetLibraryInfo.h.
Referenced by TargetLibraryInfo().
|
friend |
Definition at line 284 of file TargetLibraryInfo.h.
References TargetLibraryAnalysis.
Referenced by TargetLibraryAnalysis.
|
friend |
Definition at line 285 of file TargetLibraryInfo.h.
References TargetLibraryInfoWrapperPass.
Referenced by TargetLibraryInfoWrapperPass.