|
LLVM
4.0.0
|
Implementation of the target library information. More...
#include <TargetLibraryInfo.h>
Public Types | |
| enum | VectorLibrary { NoLibrary, Accelerate, SVML } |
| List of known vector-functions libraries. More... | |
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::Func &F) const |
| Searches for a particular function name. More... | |
| bool | getLibFunc (const Function &FDecl, LibFunc::Func &F) const |
| Searches for a particular function name, also checking that its type is valid for the library function matching that name. More... | |
| void | setUnavailable (LibFunc::Func F) |
| Forces a function to be marked as unavailable. More... | |
| void | setAvailable (LibFunc::Func F) |
| Forces a function to be marked as available. More... | |
| void | setAvailableWithName (LibFunc::Func F, StringRef Name) |
| Forces a function to be marked as available and provide an alternate name that must be used. More... | |
| void | disableAllFunctions () |
| Disables all builtins. More... | |
| void | addVectorizableFunctions (ArrayRef< VecDesc > Fns) |
| Add a set of scalar -> vector mappings, queryable via getVectorizedFunction and getScalarizedFunction. More... | |
| void | addVectorizableFunctionsFromVecLib (enum VectorLibrary VecLib) |
| Calls addVectorizableFunctions with a known preset of functions for the given vector library. More... | |
| bool | isFunctionVectorizable (StringRef F, unsigned VF) const |
| Return true if the function F has a vector equivalent with vectorization factor VF. More... | |
| bool | isFunctionVectorizable (StringRef F) const |
| Return true if the function F has a vector equivalent with any vectorization factor. More... | |
| StringRef | getVectorizedFunction (StringRef F, unsigned VF) const |
| Return the name of the equivalent of F, vectorized with factor VF. More... | |
| bool | isFunctionScalarizable (StringRef F, unsigned &VF) const |
| Return true if the function F has a scalar equivalent, and set VF to be the vectorization factor. More... | |
| StringRef | getScalarizedFunction (StringRef F, unsigned &VF) const |
| Return the name of the equivalent of F, scalarized. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
Friends | |
| class | TargetLibraryInfo |
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 wrapper below.
Definition at line 48 of file TargetLibraryInfo.h.
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 | |
| SVML | |
Definition at line 88 of file TargetLibraryInfo.h.
| TargetLibraryInfoImpl::TargetLibraryInfoImpl | ( | ) |
Definition at line 438 of file TargetLibraryInfo.cpp.
References initialize().
Definition at line 445 of file TargetLibraryInfo.cpp.
References initialize().
| TargetLibraryInfoImpl::TargetLibraryInfoImpl | ( | const TargetLibraryInfoImpl & | TLI | ) |
Definition at line 452 of file TargetLibraryInfo.cpp.
| TargetLibraryInfoImpl::TargetLibraryInfoImpl | ( | TargetLibraryInfoImpl && | TLI | ) |
Definition at line 461 of file TargetLibraryInfo.cpp.
References llvm::sys::path::begin(), and llvm::sys::path::end().
Add a set of scalar -> vector mappings, queryable via getVectorizedFunction and getScalarizedFunction.
Definition at line 1058 of file TargetLibraryInfo.cpp.
References llvm::ArrayRef< T >::begin(), compareByScalarFnName(), compareByVectorFnName(), and llvm::ArrayRef< T >::end().
Referenced by addVectorizableFunctionsFromVecLib().
| void TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib | ( | enum VectorLibrary | VecLib | ) |
Calls addVectorizableFunctions with a known preset of functions for the given vector library.
Definition at line 1066 of file TargetLibraryInfo.cpp.
References Accelerate, addVectorizableFunctions(), NoLibrary, and SVML.
Referenced by initialize().
| void TargetLibraryInfoImpl::disableAllFunctions | ( | ) |
Disables all builtins.
This can be used for options like -fno-builtin.
Definition at line 1038 of file TargetLibraryInfo.cpp.
Referenced by initialize().
| bool TargetLibraryInfoImpl::getLibFunc | ( | StringRef | funcName, |
| LibFunc::Func & | F | ||
| ) | const |
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 502 of file TargetLibraryInfo.cpp.
References llvm::StringRef::empty(), llvm::WebAssembly::End, I, llvm::LibFunc::NumLibFuncs, and sanitizeFunctionName().
Referenced by getLibFunc(), and llvm::TargetLibraryInfo::getLibFunc().
| bool TargetLibraryInfoImpl::getLibFunc | ( | const Function & | FDecl, |
| LibFunc::Func & | F | ||
| ) | const |
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.
Definition at line 1030 of file TargetLibraryInfo.cpp.
References F, llvm::Module::getDataLayout(), llvm::Function::getFunctionType(), getLibFunc(), llvm::Value::getName(), and llvm::GlobalValue::getParent().
Return the name of the equivalent of F, scalarized.
If no such mapping exists, return the empty string.
Set VF to the vectorization factor.
Definition at line 1211 of file TargetLibraryInfo.cpp.
References compareWithVectorFnName(), llvm::StringRef::empty(), F, I, and sanitizeFunctionName().
Referenced by isFunctionScalarizable().
Return the name of the equivalent of F, vectorized with factor VF.
If no such mapping exists, return the empty string.
Definition at line 1196 of file TargetLibraryInfo.cpp.
References compareWithScalarFnName(), llvm::StringRef::empty(), F, I, and sanitizeFunctionName().
Referenced by llvm::TargetLibraryInfo::getVectorizedFunction(), and isFunctionVectorizable().
|
inline |
Return true if the function F has a scalar equivalent, and set VF to be the vectorization factor.
Definition at line 167 of file TargetLibraryInfo.h.
References llvm::StringRef::empty(), and getScalarizedFunction().
Return true if the function F has a vector equivalent with vectorization factor VF.
Definition at line 153 of file TargetLibraryInfo.h.
References llvm::StringRef::empty(), and getVectorizedFunction().
Referenced by llvm::TargetLibraryInfo::isFunctionVectorizable().
Return true if the function F has a vector equivalent with any vectorization factor.
Definition at line 1185 of file TargetLibraryInfo.cpp.
References compareWithScalarFnName(), llvm::StringRef::empty(), I, and sanitizeFunctionName().
| TargetLibraryInfoImpl & TargetLibraryInfoImpl::operator= | ( | const TargetLibraryInfoImpl & | TLI | ) |
Definition at line 472 of file TargetLibraryInfo.cpp.
| TargetLibraryInfoImpl & TargetLibraryInfoImpl::operator= | ( | TargetLibraryInfoImpl && | TLI | ) |
Definition at line 481 of file TargetLibraryInfo.cpp.
References llvm::sys::path::begin(), and llvm::sys::path::end().
|
inline |
Forces a function to be marked as available.
Definition at line 122 of file TargetLibraryInfo.h.
Referenced by initialize().
|
inline |
Forces a function to be marked as available and provide an alternate name that must be used.
Definition at line 128 of file TargetLibraryInfo.h.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), F, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find().
Referenced by initialize().
|
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 180 of file TargetLibraryInfo.h.
Referenced by initialize().
|
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 187 of file TargetLibraryInfo.h.
Referenced by initialize().
|
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 193 of file TargetLibraryInfo.h.
Referenced by initialize().
|
inline |
Forces a function to be marked as unavailable.
Definition at line 117 of file TargetLibraryInfo.h.
Referenced by initialize().
|
friend |
Definition at line 49 of file TargetLibraryInfo.h.
1.8.6