LLVM: llvm::TargetLibraryInfoImpl Class Reference (original) (raw)

Implementation of the target library information. More...

#include "[llvm/Analysis/TargetLibraryInfo.h](TargetLibraryInfo%5F8h%5Fsource.html)"

Public Member Functions
TargetLibraryInfoImpl ()
TargetLibraryInfoImpl (const Triple &T)
TargetLibraryInfoImpl (const TargetLibraryInfoImpl &TLI)
TargetLibraryInfoImpl (TargetLibraryInfoImpl &&TLI)
TargetLibraryInfoImpl & operator= (const TargetLibraryInfoImpl &TLI)
TargetLibraryInfoImpl & operator= (TargetLibraryInfoImpl &&TLI)
bool getLibFunc (StringRef funcName, LibFunc &F) const
Searches for a particular function name.
bool getLibFunc (const Function &FDecl, LibFunc &F) const
Searches for a particular function name, also checking that its type is valid for the library function matching that name.
bool getLibFunc (unsigned int Opcode, Type *Ty, LibFunc &F) const
Searches for a function name using an Instruction Opcode.
void setUnavailable (LibFunc F)
Forces a function to be marked as unavailable.
void setAvailable (LibFunc F)
Forces a function to be marked as available.
void setAvailableWithName (LibFunc F, StringRef Name)
Forces a function to be marked as available and provide an alternate name that must be used.
void disableAllFunctions ()
Disables all builtins.
void addVectorizableFunctions (ArrayRef< VecDesc > Fns)
Add a set of scalar -> vector mappings, queryable via getVectorizedFunction and getScalarizedFunction.
void addVectorizableFunctionsFromVecLib (enum VectorLibrary VecLib, const llvm::Triple &TargetTriple)
Calls addVectorizableFunctions with a known preset of functions for the given vector library.
bool isFunctionVectorizable (StringRef F, const ElementCount &VF) const
Return true if the function F has a vector equivalent with vectorization factor VF.
bool isFunctionVectorizable (StringRef F) const
Return true if the function F has a vector equivalent with any vectorization factor.
StringRef getVectorizedFunction (StringRef F, const ElementCount &VF, bool Masked) const
Return the name of the equivalent of F, vectorized with factor VF.
const VecDesc * getVectorMappingInfo (StringRef F, const ElementCount &VF, bool Masked) const
Return a pointer to a VecDesc object holding all info for scalar to vector mappings in TLI for the equivalent of F, vectorized with factor VF.
void setShouldExtI32Param (bool Val)
Set to true iff i32 parameters to library functions should have signext or zeroext attributes if they correspond to C-level int or unsigned int, respectively.
void setShouldExtI32Return (bool Val)
Set to true iff i32 results from library functions should have signext or zeroext attributes if they correspond to C-level int or unsigned int, respectively.
void setShouldSignExtI32Param (bool Val)
Set to true iff i32 parameters to library functions should have signext attribute if they correspond to C-level int or unsigned int.
void setShouldSignExtI32Return (bool Val)
Set to true iff i32 results from library functions should have signext attribute if they correspond to C-level int or unsigned int.
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.
unsigned getIntSize () const
Get size of a C-level int or unsigned int, in bits.
void setIntSize (unsigned Bits)
Initialize the C-level size of an integer.
void getWidestVF (StringRef ScalarF, ElementCount &FixedVF, ElementCount &Scalable) const
Returns the largest vectorization factor used in the list of vector functions.
Static Public Member Functions
static bool isCallingConvCCompatible (CallBase *CI)
Returns true if call site / callee has cdecl-compatible calling conventions.
static bool isCallingConvCCompatible (Function *Callee)

Implementation of the target library information.

This class constructs tables that hold the target library information and make it available. However, it is somewhat expensive to compute and only depends on the triple. So users typically interact with the [TargetLibraryInfo](classllvm%5F1%5F1TargetLibraryInfo.html "Provides information about what library functions are available for the current target.") wrapper below.

Definition at line 82 of file TargetLibraryInfo.h.

VectorLibrary

List of known vector-functions libraries.

The vector-functions library defines, which functions are vectorizable and with which factor. The library can be specified by either frontend, or a commandline option, and then used by addVectorizableFunctionsFromVecLib for filling up the tables of vectorizable functions.

Enumerator
NoLibrary
Accelerate
DarwinLibSystemM
LIBMVEC_X86
MASSV
SVML
SLEEFGNUABI
ArmPL
AMDLIBM

Definition at line 123 of file TargetLibraryInfo.h.

TargetLibraryInfoImpl::TargetLibraryInfoImpl ( )

TargetLibraryInfoImpl() [2/4]

TargetLibraryInfoImpl::TargetLibraryInfoImpl ( const Triple & T) explicit

TargetLibraryInfoImpl() [3/4]

TargetLibraryInfoImpl() [4/4]

addVectorizableFunctions()

void TargetLibraryInfoImpl::addVectorizableFunctions ( ArrayRef< VecDesc > Fns )

addVectorizableFunctionsFromVecLib()

Calls addVectorizableFunctions with a known preset of functions for the given vector library.

Definition at line 1352 of file TargetLibraryInfo.cpp.

References llvm::Triple::aarch64, llvm::Triple::aarch64_be, Accelerate, addVectorizableFunctions(), AMDLIBM, ArmPL, DarwinLibSystemM, llvm::Triple::getArch(), LIBMVEC_X86, MASSV, NoLibrary, llvm::Triple::riscv64, SLEEFGNUABI, SVML, VecFuncs_Accelerate, VecFuncs_AMDLIBM, VecFuncs_ArmPL, VecFuncs_DarwinLibSystemM, VecFuncs_LIBMVEC_X86, VecFuncs_MASSV, VecFuncs_SLEEFGNUABI_VF2, VecFuncs_SLEEFGNUABI_VF4, VecFuncs_SLEEFGNUABI_VFScalable, VecFuncs_SLEEFGNUABI_VFScalableRISCV, and VecFuncs_SVML.

Referenced by llvm::driver::createTLII(), and initializeLibCalls().

disableAllFunctions()

void TargetLibraryInfoImpl::disableAllFunctions ( )

getIntSize()

unsigned llvm::TargetLibraryInfoImpl::getIntSize ( ) const inline

getLibFunc() [1/3]

getLibFunc() [2/3]

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 1004 of file TargetLibraryInfo.cpp.

References buildIndexMap(), llvm::StringRef::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), F, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and sanitizeFunctionName().

Referenced by getLibFunc(), and llvm::TargetLibraryInfo::getLibFunc().

getLibFunc() [3/3]

getSizeTSize()

getVectorizedFunction()

getVectorMappingInfo()

getWCharSize()

getWidestVF()

isCallingConvCCompatible() [1/2]

bool TargetLibraryInfoImpl::isCallingConvCCompatible ( CallBase * CI) static

isCallingConvCCompatible() [2/2]

bool TargetLibraryInfoImpl::isCallingConvCCompatible ( Function * Callee) static

isFunctionVectorizable() [1/2]

bool TargetLibraryInfoImpl::isFunctionVectorizable ( StringRef F ) const

isFunctionVectorizable() [2/2]

operator=() [1/2]

operator=() [2/2]

setAvailable()

void llvm::TargetLibraryInfoImpl::setAvailable ( LibFunc F) inline

setAvailableWithName()

void llvm::TargetLibraryInfoImpl::setAvailableWithName ( LibFunc F, StringRef Name ) inline

setIntSize()

void llvm::TargetLibraryInfoImpl::setIntSize ( unsigned Bits) inline

setShouldExtI32Param()

void llvm::TargetLibraryInfoImpl::setShouldExtI32Param ( bool Val) inline

Set to true iff i32 parameters to library functions should have signext or zeroext attributes if they correspond to C-level int or unsigned int, respectively.

Definition at line 224 of file TargetLibraryInfo.h.

Referenced by initializeBase().

setShouldExtI32Return()

void llvm::TargetLibraryInfoImpl::setShouldExtI32Return ( bool Val) inline

Set to true iff i32 results from library functions should have signext or zeroext attributes if they correspond to C-level int or unsigned int, respectively.

Definition at line 231 of file TargetLibraryInfo.h.

Referenced by initializeBase().

setShouldSignExtI32Param()

void llvm::TargetLibraryInfoImpl::setShouldSignExtI32Param ( bool Val) inline

Set to true iff i32 parameters to library functions should have signext attribute if they correspond to C-level int or unsigned int.

Definition at line 237 of file TargetLibraryInfo.h.

Referenced by initializeBase().

setShouldSignExtI32Return()

void llvm::TargetLibraryInfoImpl::setShouldSignExtI32Return ( bool Val) inline

Set to true iff i32 results from library functions should have signext attribute if they correspond to C-level int or unsigned int.

Definition at line 243 of file TargetLibraryInfo.h.

Referenced by initializeBase().

setUnavailable()

void llvm::TargetLibraryInfoImpl::setUnavailable ( LibFunc F) inline

TargetLibraryInfo


The documentation for this class was generated from the following files: