class TargetLibraryInfoImpl
Declaration
class TargetLibraryInfoImpl { /* full declaration omitted */ };
Description
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 \c TargetLibraryInfo wrapper below.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:49
Member Variables
- private unsigned char[117] AvailableArray
- private DenseMap<unsigned int, std::string> CustomNames
- private bool ShouldExtI32Param
- private bool ShouldExtI32Return
- private bool ShouldSignExtI32Param
- private unsigned int SizeOfInt
- private std::vector<VecDesc> VectorDescs
- Vectorization descriptors - sorted by ScalarFnName.
- private std::vector<VecDesc> ScalarDescs
- Scalarization descriptors - same content as VectorDescs but sorted based on VectorFnName rather than ScalarFnName.
- private static const llvm::StringLiteral[468] StandardNames
Method Overview
- public TargetLibraryInfoImpl()
- public TargetLibraryInfoImpl(const llvm::Triple & T)
- public TargetLibraryInfoImpl(const llvm::TargetLibraryInfoImpl & TLI)
- public TargetLibraryInfoImpl(llvm::TargetLibraryInfoImpl && TLI)
- public void addVectorizableFunctions(ArrayRef<llvm::VecDesc> Fns)
- public void addVectorizableFunctionsFromVecLib(enum VectorLibrary VecLib)
- public void disableAllFunctions()
- public unsigned int getIntSize() const
- public bool getLibFunc(llvm::StringRef funcName, llvm::LibFunc & F) const
- public bool getLibFunc(const llvm::Function & FDecl, llvm::LibFunc & F) const
- private llvm::TargetLibraryInfoImpl::AvailabilityState getState(llvm::LibFunc F) const
- public llvm::StringRef getVectorizedFunction(llvm::StringRef F, const llvm::ElementCount & VF) const
- public unsigned int getWCharSize(const llvm::Module & M) const
- public void getWidestVF(llvm::StringRef ScalarF, llvm::ElementCount & FixedVF, llvm::ElementCount & Scalable) const
- public static bool isCallingConvCCompatible(llvm::CallBase * CI)
- public static bool isCallingConvCCompatible(llvm::Function * Callee)
- public bool isFunctionVectorizable(llvm::StringRef F, const llvm::ElementCount & VF) const
- public bool isFunctionVectorizable(llvm::StringRef F) const
- private bool isValidProtoForLibFunc(const llvm::FunctionType & FTy, llvm::LibFunc F, const llvm::Module & M) const
- public void setAvailable(llvm::LibFunc F)
- public void setAvailableWithName(llvm::LibFunc F, llvm::StringRef Name)
- public void setIntSize(unsigned int Bits)
- public void setShouldExtI32Param(bool Val)
- public void setShouldExtI32Return(bool Val)
- public void setShouldSignExtI32Param(bool Val)
- private void setState(llvm::LibFunc F, llvm::TargetLibraryInfoImpl::AvailabilityState State)
- public void setUnavailable(llvm::LibFunc F)
Methods
¶TargetLibraryInfoImpl()
TargetLibraryInfoImpl()
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:99
¶TargetLibraryInfoImpl(const llvm::Triple& T)
TargetLibraryInfoImpl(const llvm::Triple& T)
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:100
Parameters
- const llvm::Triple& T
¶TargetLibraryInfoImpl(
const llvm::TargetLibraryInfoImpl& TLI)
TargetLibraryInfoImpl(
const llvm::TargetLibraryInfoImpl& TLI)
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:103
Parameters
- const llvm::TargetLibraryInfoImpl& TLI
¶TargetLibraryInfoImpl(
llvm::TargetLibraryInfoImpl&& TLI)
TargetLibraryInfoImpl(
llvm::TargetLibraryInfoImpl&& TLI)
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:104
Parameters
¶void addVectorizableFunctions(
ArrayRef<llvm::VecDesc> Fns)
void addVectorizableFunctions(
ArrayRef<llvm::VecDesc> Fns)
Description
Add a set of scalar -> vector mappings, queryable via getVectorizedFunction and getScalarizedFunction.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:152
Parameters
- ArrayRef<llvm::VecDesc> Fns
¶void addVectorizableFunctionsFromVecLib(
enum VectorLibrary VecLib)
void addVectorizableFunctionsFromVecLib(
enum VectorLibrary VecLib)
Description
Calls addVectorizableFunctions with a known preset of functions for the given vector library.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:156
Parameters
- enum VectorLibrary VecLib
¶void disableAllFunctions()
void disableAllFunctions()
Description
Disables all builtins. This can be used for options like -fno-builtin.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:148
¶unsigned int getIntSize() const
unsigned int getIntSize() const
Description
Get size of a C-level int or unsigned int, in bits.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:197
¶bool getLibFunc(llvm::StringRef funcName,
llvm::LibFunc& F) const
bool getLibFunc(llvm::StringRef funcName,
llvm::LibFunc& F) const
Description
Searches for a particular function name. If it is one of the known library functions, return true and set F to the corresponding value.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:112
Parameters
- llvm::StringRef funcName
- llvm::LibFunc& F
¶bool getLibFunc(const llvm::Function& FDecl,
llvm::LibFunc& F) const
bool getLibFunc(const llvm::Function& FDecl,
llvm::LibFunc& F) const
Description
Searches for a particular function name, also checking that its type is valid for the library function matching that name. If it is one of the known library functions, return true and set F to the corresponding value. FDecl is assumed to have a parent Module when using this function.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:121
Parameters
- const llvm::Function& FDecl
- llvm::LibFunc& F
¶llvm::TargetLibraryInfoImpl::AvailabilityState
getState(llvm::LibFunc F) const
llvm::TargetLibraryInfoImpl::AvailabilityState
getState(llvm::LibFunc F) const
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:67
Parameters
- llvm::LibFunc F
¶llvm::StringRef getVectorizedFunction(
llvm::StringRef F,
const llvm::ElementCount& VF) const
llvm::StringRef getVectorizedFunction(
llvm::StringRef F,
const llvm::ElementCount& VF) const
Description
Return the name of the equivalent of F, vectorized with factor VF. If no such mapping exists, return the empty string.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:170
Parameters
- llvm::StringRef F
- const llvm::ElementCount& VF
¶unsigned int getWCharSize(
const llvm::Module& M) const
unsigned int getWCharSize(
const llvm::Module& M) const
Description
Returns the size of the wchar_t type in bytes or 0 if the size is unknown. This queries the 'wchar_size' metadata.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:194
Parameters
- const llvm::Module& M
¶void getWidestVF(
llvm::StringRef ScalarF,
llvm::ElementCount& FixedVF,
llvm::ElementCount& Scalable) const
void getWidestVF(
llvm::StringRef ScalarF,
llvm::ElementCount& FixedVF,
llvm::ElementCount& Scalable) const
Description
Returns the largest vectorization factor used in the list of vector functions.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:208
Parameters
- llvm::StringRef ScalarF
- llvm::ElementCount& FixedVF
- llvm::ElementCount& Scalable
¶static bool isCallingConvCCompatible(
llvm::CallBase* CI)
static bool isCallingConvCCompatible(
llvm::CallBase* CI)
Description
Returns true if call site / callee has cdecl-compatible calling conventions.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:213
Parameters
- llvm::CallBase* CI
¶static bool isCallingConvCCompatible(
llvm::Function* Callee)
static bool isCallingConvCCompatible(
llvm::Function* Callee)
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:214
Parameters
- llvm::Function* Callee
¶bool isFunctionVectorizable(
llvm::StringRef F,
const llvm::ElementCount& VF) const
bool isFunctionVectorizable(
llvm::StringRef F,
const llvm::ElementCount& VF) const
Description
Return true if the function F has a vector equivalent with vectorization factor VF.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:160
Parameters
- llvm::StringRef F
- const llvm::ElementCount& VF
¶bool isFunctionVectorizable(
llvm::StringRef F) const
bool isFunctionVectorizable(
llvm::StringRef F) const
Description
Return true if the function F has a vector equivalent with any vectorization factor.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:166
Parameters
¶bool isValidProtoForLibFunc(
const llvm::FunctionType& FTy,
llvm::LibFunc F,
const llvm::Module& M) const
bool isValidProtoForLibFunc(
const llvm::FunctionType& FTy,
llvm::LibFunc F,
const llvm::Module& M) const
Description
Return true if the function type FTy is valid for the library function F, regardless of whether the function is available.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:79
Parameters
- const llvm::FunctionType& FTy
- llvm::LibFunc F
- const llvm::Module& M
¶void setAvailable(llvm::LibFunc F)
void setAvailable(llvm::LibFunc F)
Description
Forces a function to be marked as available.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:129
Parameters
- llvm::LibFunc F
¶void setAvailableWithName(llvm::LibFunc F,
llvm::StringRef Name)
void setAvailableWithName(llvm::LibFunc F,
llvm::StringRef Name)
Description
Forces a function to be marked as available and provide an alternate name that must be used.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:135
Parameters
- llvm::LibFunc F
- llvm::StringRef Name
¶void setIntSize(unsigned int Bits)
void setIntSize(unsigned int Bits)
Description
Initialize the C-level size of an integer.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:202
Parameters
- unsigned int Bits
¶void setShouldExtI32Param(bool Val)
void setShouldExtI32Param(bool Val)
Description
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.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:175
Parameters
- bool Val
¶void setShouldExtI32Return(bool Val)
void setShouldExtI32Return(bool Val)
Description
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.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:182
Parameters
- bool Val
¶void setShouldSignExtI32Param(bool Val)
void setShouldSignExtI32Param(bool Val)
Description
Set to true iff i32 parameters to library functions should have signext attribute if they correspond to C-level int or unsigned int.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:188
Parameters
- bool Val
¶void setState(
llvm::LibFunc F,
llvm::TargetLibraryInfoImpl::AvailabilityState
State)
void setState(
llvm::LibFunc F,
llvm::TargetLibraryInfoImpl::AvailabilityState
State)
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:63
Parameters
- llvm::LibFunc F
- llvm::TargetLibraryInfoImpl::AvailabilityState State
¶void setUnavailable(llvm::LibFunc F)
void setUnavailable(llvm::LibFunc F)
Description
Forces a function to be marked as unavailable.
Declared at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:124
Parameters
- llvm::LibFunc F