LLVM  3.7.0
Public Types | Public Member Functions | Friends | List of all members
llvm::TargetLibraryInfoImpl Class Reference

Implementation of the target library information. More...

#include <TargetLibraryInfo.h>

Public Types

enum  VectorLibrary { NoLibrary, Accelerate }
 List of known vector-functions libraries. More...
 

Public Member Functions

 TargetLibraryInfoImpl ()
 
 TargetLibraryInfoImpl (const Triple &T)
 
 TargetLibraryInfoImpl (const TargetLibraryInfoImpl &TLI)
 
 TargetLibraryInfoImpl (TargetLibraryInfoImpl &&TLI)
 
TargetLibraryInfoImploperator= (const TargetLibraryInfoImpl &TLI)
 
TargetLibraryInfoImploperator= (TargetLibraryInfoImpl &&TLI)
 
bool getLibFunc (StringRef funcName, LibFunc::Func &F) const
 Searches for a particular function 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)
 addVectorizableFunctions - 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
 isFunctionVectorizable - Return true if the function F has a vector equivalent with vectorization factor VF. More...
 
bool isFunctionVectorizable (StringRef F) const
 isFunctionVectorizable - Return true if the function F has a vector equivalent with any vectorization factor. More...
 
StringRef getVectorizedFunction (StringRef F, unsigned VF) const
 getVectorizedFunction - Return the name of the equivalent of F, vectorized with factor VF. More...
 
bool isFunctionScalarizable (StringRef F, unsigned &VF) const
 isFunctionScalarizable - 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
 getScalarizedFunction - Return the name of the equivalent of F, scalarized. More...
 

Friends

class TargetLibraryInfo
 

Detailed 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 typicaly interact with the TargetLibraryInfo wrapper below.

Definition at line 47 of file TargetLibraryInfo.h.

Member Enumeration Documentation

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 

Definition at line 81 of file TargetLibraryInfo.h.

Constructor & Destructor Documentation

TargetLibraryInfoImpl::TargetLibraryInfoImpl ( )

Definition at line 362 of file TargetLibraryInfo.cpp.

References initialize().

TargetLibraryInfoImpl::TargetLibraryInfoImpl ( const Triple T)
explicit

Definition at line 369 of file TargetLibraryInfo.cpp.

References initialize().

TargetLibraryInfoImpl::TargetLibraryInfoImpl ( const TargetLibraryInfoImpl TLI)

Definition at line 376 of file TargetLibraryInfo.cpp.

TargetLibraryInfoImpl::TargetLibraryInfoImpl ( TargetLibraryInfoImpl &&  TLI)

Definition at line 383 of file TargetLibraryInfo.cpp.

References llvm::sys::path::begin(), and llvm::sys::path::end().

Member Function Documentation

void TargetLibraryInfoImpl::addVectorizableFunctions ( ArrayRef< VecDesc Fns)

addVectorizableFunctions - Add a set of scalar -> vector mappings, queryable via getVectorizedFunction and getScalarizedFunction.

Definition at line 457 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 465 of file TargetLibraryInfo.cpp.

References Accelerate, addVectorizableFunctions(), and NoLibrary.

Referenced by initialize().

void TargetLibraryInfoImpl::disableAllFunctions ( )

Disables all builtins.

This can be used for options like -fno-builtin.

Definition at line 435 of file TargetLibraryInfo.cpp.

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

References llvm::StringRef::data(), llvm::StringRef::empty(), I, llvm::LibFunc::NumLibFuncs, sanitizeFunctionName(), and llvm::StringRef::size().

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

StringRef TargetLibraryInfoImpl::getScalarizedFunction ( StringRef  F,
unsigned VF 
) const

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

References compareWithVectorFnName(), llvm::StringRef::empty(), F(), I, and sanitizeFunctionName().

Referenced by isFunctionScalarizable().

StringRef TargetLibraryInfoImpl::getVectorizedFunction ( StringRef  F,
unsigned  VF 
) const

getVectorizedFunction - Return the name of the equivalent of F, vectorized with factor VF.

If no such mapping exists, return the empty string.

Definition at line 526 of file TargetLibraryInfo.cpp.

References compareWithScalarFnName(), llvm::StringRef::empty(), F(), I, and sanitizeFunctionName().

Referenced by llvm::TargetLibraryInfo::getVectorizedFunction(), and isFunctionVectorizable().

bool llvm::TargetLibraryInfoImpl::isFunctionScalarizable ( StringRef  F,
unsigned VF 
) const
inline

isFunctionScalarizable - Return true if the function F has a scalar equivalent, and set VF to be the vectorization factor.

Definition at line 153 of file TargetLibraryInfo.h.

References llvm::StringRef::empty(), and getScalarizedFunction().

bool llvm::TargetLibraryInfoImpl::isFunctionVectorizable ( StringRef  F,
unsigned  VF 
) const
inline

isFunctionVectorizable - Return true if the function F has a vector equivalent with vectorization factor VF.

Definition at line 138 of file TargetLibraryInfo.h.

References llvm::StringRef::empty(), and getVectorizedFunction().

Referenced by llvm::TargetLibraryInfo::isFunctionVectorizable().

bool TargetLibraryInfoImpl::isFunctionVectorizable ( StringRef  F) const

isFunctionVectorizable - Return true if the function F has a vector equivalent with any vectorization factor.

Definition at line 515 of file TargetLibraryInfo.cpp.

References compareWithScalarFnName(), llvm::StringRef::empty(), I, and sanitizeFunctionName().

TargetLibraryInfoImpl & TargetLibraryInfoImpl::operator= ( const TargetLibraryInfoImpl TLI)

Definition at line 391 of file TargetLibraryInfo.cpp.

TargetLibraryInfoImpl & TargetLibraryInfoImpl::operator= ( TargetLibraryInfoImpl &&  TLI)

Definition at line 397 of file TargetLibraryInfo.cpp.

References llvm::sys::path::begin(), and llvm::sys::path::end().

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

Forces a function to be marked as available.

Definition at line 107 of file TargetLibraryInfo.h.

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

Forces a function to be marked as available and provide an alternate name that must be used.

Definition at line 113 of file TargetLibraryInfo.h.

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

Referenced by initialize().

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

Forces a function to be marked as unavailable.

Definition at line 102 of file TargetLibraryInfo.h.

Referenced by initialize().

Friends And Related Function Documentation

friend class TargetLibraryInfo
friend

Definition at line 48 of file TargetLibraryInfo.h.


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