LLVM: llvm::TargetLibraryInfo Class Reference (original) (raw)
Provides information about what library functions are available for the current target. More...
#include "[llvm/Analysis/TargetLibraryInfo.h](TargetLibraryInfo%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
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. | |
bool | getLibFunc (StringRef funcName, LibFunc &F) const |
Searches for a particular function name. | |
bool | getLibFunc (const Function &FDecl, LibFunc &F) const |
bool | getLibFunc (const CallBase &CB, LibFunc &F) const |
If a callbase does not have the 'nobuiltin' attribute, return if the called function is a known library function and set F to that function. | |
bool | getLibFunc (unsigned int Opcode, Type *Ty, LibFunc &F) const |
Searches for a function name using an Instruction Opcode. | |
void | disableAllFunctions () LLVM_ATTRIBUTE_UNUSED |
Disables all builtins. | |
void | setUnavailable (LibFunc F) LLVM_ATTRIBUTE_UNUSED |
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 or 0 if the size is unknown. | |
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. | |
Static Public Member Functions | |
---|---|
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) |
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 280 of file TargetLibraryInfo.h.
◆ TargetLibraryInfo() [2/3]
◆ TargetLibraryInfo() [3/3]
◆ areInlineCompatible()
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 325 of file TargetLibraryInfo.h.
◆ disableAllFunctions()
void llvm::TargetLibraryInfo::disableAllFunctions ( ) | inline |
---|
◆ getAsSizeT()
◆ getAttrList()
◆ getExtAttrForI32Param() [1/2]
◆ getExtAttrForI32Param() [2/2]
◆ getExtAttrForI32Return() [1/2]
◆ getExtAttrForI32Return() [2/2]
◆ getIntSize()
unsigned llvm::TargetLibraryInfo::getIntSize ( ) const | inline |
---|
◆ getLibFunc() [1/4]
◆ getLibFunc() [2/4]
◆ getLibFunc() [3/4]
Searches for a particular function name.
If it is one of the known library functions, return true and set F to the corresponding value.
Definition at line 345 of file TargetLibraryInfo.h.
References F, and llvm::TargetLibraryInfoImpl::getLibFunc().
Referenced by llvm::callsGCLeafFunction(), llvm::MemoryOpRemark::canHandle(), 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(), llvm::isLibFuncEmittable(), llvm::isMathLibCallNoop(), llvm::maybeMarkSanitizerLibraryCallNoBuiltin(), llvm::FortifiedLibCallSimplifier::optimizeCall(), llvm::LibCallSimplifier::optimizeCall(), optimizeCall(), runPartiallyInlineLibCalls(), llvm::FastISel::selectInstruction(), shouldCheckArgs(), TargetLibraryInfo(), and llvm::InstCombinerImpl::visitFree().
◆ getLibFunc() [4/4]
◆ getName()
Definition at line 450 of file TargetLibraryInfo.h.
References assert(), F, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), 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::getOrInsertLibFunc(), and llvm::isLibFuncEmittable().
◆ getSizeTSize()
◆ getSizeTType()
◆ getState()
TargetLibraryInfoImpl::AvailabilityState llvm::TargetLibraryInfo::getState ( LibFunc F) const | inline |
---|
◆ getVectorizedFunction()
◆ getVectorMappingInfo()
◆ getWCharSize()
◆ getWidestVF()
◆ has()
bool llvm::TargetLibraryInfo::has ( LibFunc F) const | inline |
---|
Tests whether a library function is available.
Definition at line 387 of file TargetLibraryInfo.h.
References F, and getState().
Referenced by llvm::callsGCLeafFunction(), llvm::MemoryOpRemark::canHandle(), getAllocationDataForFunction(), llvm::getAllocationFamily(), llvm::MemoryLocation::getForArgument(), llvm::getFreedOperand(), llvm::getOrInsertLibFunc(), llvm::inferNonMandatoryLibFuncAttrs(), isAllocSiteRemovable(), llvm::isLibFuncEmittable(), runPartiallyInlineLibCalls(), and llvm::InstCombinerImpl::visitFree().
◆ hasOptimizedCodeGen()
bool llvm::TargetLibraryInfo::hasOptimizedCodeGen ( LibFunc F) const | inline |
---|
◆ initExtensionsForTriple()
static void llvm::TargetLibraryInfo::initExtensionsForTriple ( bool & ShouldExtI32Param, bool & ShouldExtI32Return, bool & ShouldSignExtI32Param, bool & ShouldSignExtI32Return, const Triple & T ) | inlinestatic |
---|
◆ invalidate() [1/2]
◆ invalidate() [2/2]
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 589 of file TargetLibraryInfo.h.
◆ isFunctionVectorizable() [1/2]
bool llvm::TargetLibraryInfo::isFunctionVectorizable ( StringRef F) const | inline |
---|
◆ isFunctionVectorizable() [2/2]
◆ isKnownVectorFunctionInLibrary()
bool llvm::TargetLibraryInfo::isKnownVectorFunctionInLibrary ( StringRef F) const | inline |
---|
◆ isValidProtoForLibFunc()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ setUnavailable()
void llvm::TargetLibraryInfo::setUnavailable ( LibFunc F) | inline |
---|
◆ TargetLibraryAnalysis
◆ TargetLibraryInfoWrapperPass
The documentation for this class was generated from the following file:
- include/llvm/Analysis/TargetLibraryInfo.h