LLVM
13.0.0git
|
Provides information about what library functions are available for the current target. More...
#include "llvm/Analysis/TargetLibraryInfo.h"
Public Member Functions | |
TargetLibraryInfo (const TargetLibraryInfoImpl &Impl, Optional< const Function * > F=None) | |
TargetLibraryInfo (const TargetLibraryInfo &TLI) | |
TargetLibraryInfo (TargetLibraryInfo &&TLI) | |
TargetLibraryInfo & | operator= (const TargetLibraryInfo &TLI) |
TargetLibraryInfo & | operator= (TargetLibraryInfo &&TLI) |
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. More... | |
bool | getLibFunc (StringRef funcName, LibFunc &F) const |
Searches for a particular function name. More... | |
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. More... | |
void | disableAllFunctions () LLVM_ATTRIBUTE_UNUSED |
Disables all builtins. More... | |
void | setUnavailable (LibFunc F) LLVM_ATTRIBUTE_UNUSED |
Forces a function to be marked as unavailable. More... | |
TargetLibraryInfoImpl::AvailabilityState | getState (LibFunc F) const |
bool | has (LibFunc F) const |
Tests whether a library function is available. More... | |
bool | isFunctionVectorizable (StringRef F, const ElementCount &VF) const |
bool | isFunctionVectorizable (StringRef F) const |
StringRef | getVectorizedFunction (StringRef F, const ElementCount &VF) const |
bool | hasOptimizedCodeGen (LibFunc F) const |
Tests if the function is both available and a candidate for optimized code generation. More... | |
StringRef | getName (LibFunc F) const |
Attribute::AttrKind | getExtAttrForI32Param (bool Signed=true) const |
Returns extension attribute kind to be used for i32 parameters corresponding to C-level int or unsigned int. More... | |
Attribute::AttrKind | getExtAttrForI32Return (bool Signed=true) const |
Returns extension attribute kind to be used for i32 return values corresponding to C-level int or unsigned int. More... | |
unsigned | getWCharSize (const Module &M) const |
Returns the size of the wchar_t type in bytes or 0 if the size is unknown. More... | |
bool | invalidate (Module &, const PreservedAnalyses &, ModuleAnalysisManager::Invalidator &) |
Handle invalidation from the pass manager. More... | |
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. More... | |
bool | isKnownVectorFunctionInLibrary (StringRef F) const |
Check if the function "F" is listed in a library known to LLVM. More... | |
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 207 of file TargetLibraryInfo.h.
|
inlineexplicit |
Definition at line 219 of file TargetLibraryInfo.h.
References disableAllFunctions(), F, getLibFunc(), and setUnavailable().
|
inline |
Definition at line 243 of file TargetLibraryInfo.h.
|
inline |
Definition at line 245 of file TargetLibraryInfo.h.
|
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 262 of file TargetLibraryInfo.h.
References B.
|
inline |
Disables all builtins.
This can be used for options like -fno-builtin.
Definition at line 295 of file TargetLibraryInfo.h.
References llvm::BitVector::set().
Referenced by TargetLibraryInfo().
|
inline |
Returns extension attribute kind to be used for i32 parameters corresponding to C-level int or unsigned int.
May be zeroext, signext, or none.
Definition at line 370 of file TargetLibraryInfo.h.
References llvm::Attribute::None, and Signed.
Referenced by getOrInsertValueProfilingCall().
|
inline |
Returns extension attribute kind to be used for i32 return values corresponding to C-level int or unsigned int.
May be zeroext, signext, or none.
Definition at line 381 of file TargetLibraryInfo.h.
References llvm::Attribute::None, and Signed.
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.
Definition at line 287 of file TargetLibraryInfo.h.
References F, llvm::CallBase::getCalledFunction(), getLibFunc(), and llvm::CallBase::isNoBuiltin().
Definition at line 281 of file TargetLibraryInfo.h.
References F, and llvm::TargetLibraryInfoImpl::getLibFunc().
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 277 of file TargetLibraryInfo.h.
References F, and llvm::TargetLibraryInfoImpl::getLibFunc().
Referenced by llvm::callsGCLeafFunction(), getAllocationDataForFunction(), llvm::MemoryLocation::getForArgument(), llvm::getIntrinsicForCallSite(), getLibFunc(), hasAnalyzableMemoryWrite(), llvm::inferLibFuncAttributes(), llvm::isFreeCall(), isKnownLibFunction(), llvm::isMathLibCallNoop(), isWriteOnlyParam(), llvm::maybeMarkSanitizerLibraryCallNoBuiltin(), llvm::FortifiedLibCallSimplifier::optimizeCall(), optimizeCall(), runPartiallyInlineLibCalls(), and TargetLibraryInfo().
Definition at line 357 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(), emitLibCall(), llvm::emitMalloc(), llvm::emitPutChar(), llvm::emitPutS(), and llvm::getFloatFnName().
|
inline |
Definition at line 304 of file TargetLibraryInfo.h.
References F.
Referenced by getName(), has(), and hasOptimizedCodeGen().
|
inline |
Definition at line 320 of file TargetLibraryInfo.h.
References F, and llvm::TargetLibraryInfoImpl::getVectorizedFunction().
Referenced by addMappingsFromTLI(), and replaceWithCallToVeclib().
Returns the size of the wchar_t type in bytes or 0 if the size is unknown.
This queries the 'wchar_size' metadata.
Definition at line 388 of file TargetLibraryInfo.h.
References llvm::TargetLibraryInfoImpl::getWCharSize(), and M.
|
inline |
Returns the largest vectorization factor used in the list of vector functions.
Definition at line 406 of file TargetLibraryInfo.h.
References llvm::TargetLibraryInfoImpl::getWidestVF().
Referenced by addMappingsFromTLI(), and llvm::isTLIScalarize().
|
inline |
Tests whether a library function is available.
Definition at line 311 of file TargetLibraryInfo.h.
References F, and getState().
Referenced by llvm::callsGCLeafFunction(), llvm::emitCalloc(), llvm::emitFPutC(), llvm::emitFPutS(), llvm::emitFWrite(), emitLibCall(), llvm::emitMalloc(), llvm::emitMemCpyChk(), llvm::emitPutChar(), llvm::emitPutS(), getAllocationDataForFunction(), llvm::MemoryLocation::getForArgument(), hasAnalyzableMemoryWrite(), llvm::hasFloatFn(), llvm::inferLibFuncAttributes(), llvm::isFreeCall(), isWriteOnlyParam(), llvm::MemCpyOptPass::runImpl(), and runPartiallyInlineLibCalls().
|
inline |
Tests if the function is both available and a candidate for optimized code generation.
Definition at line 326 of file TargetLibraryInfo.h.
References F, and getState().
Referenced by llvm::maybeMarkSanitizerLibraryCallNoBuiltin().
|
inline |
Definition at line 400 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 396 of file TargetLibraryInfo.h.
|
inline |
Definition at line 317 of file TargetLibraryInfo.h.
References F, and llvm::TargetLibraryInfoImpl::isFunctionVectorizable().
|
inline |
Definition at line 314 of file TargetLibraryInfo.h.
References F, and llvm::TargetLibraryInfoImpl::isFunctionVectorizable().
Referenced by addMappingsFromTLI(), isKnownVectorFunctionInLibrary(), llvm::isTLIScalarize(), and replaceWithCallToVeclib().
|
inline |
Check if the function "F" is listed in a library known to LLVM.
Definition at line 412 of file TargetLibraryInfo.h.
References isFunctionVectorizable().
Referenced by isKnownLibFunction().
|
inline |
Definition at line 247 of file TargetLibraryInfo.h.
|
inline |
Definition at line 252 of file TargetLibraryInfo.h.
|
inline |
Forces a function to be marked as unavailable.
Definition at line 300 of file TargetLibraryInfo.h.
References F, and llvm::BitVector::set().
Referenced by TargetLibraryInfo().
|
friend |
Definition at line 208 of file TargetLibraryInfo.h.
|
friend |
Definition at line 209 of file TargetLibraryInfo.h.