LLVM  16.0.0git
Macros | Typedefs | Enumerations | Functions | Variables
TargetLibraryInfo.cpp File Reference
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/ADT/Triple.h"
#include "llvm/IR/Constants.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Analysis/TargetLibraryInfo.def"
#include "llvm/Analysis/VecFuncs.def"
Include dependency graph for TargetLibraryInfo.cpp:

Go to the source code of this file.

Macros

#define TLI_DEFINE_STRING
 
#define TLI_DEFINE_SIG
 
#define TLI_DEFINE_ACCELERATE_VECFUNCS
 
#define TLI_DEFINE_DARWIN_LIBSYSTEM_M_VECFUNCS
 
#define TLI_DEFINE_LIBMVEC_X86_VECFUNCS
 
#define TLI_DEFINE_MASSV_VECFUNCS
 
#define TLI_DEFINE_SVML_VECFUNCS
 

Typedefs

typedef std::array< FuncArgTypeID, 8 > FuncProtoTy
 

Enumerations

enum  FuncArgTypeID : char {
  Void = 0, Bool, Int16, Int32,
  Int, IntPlus, Long, IntX,
  Int64, LLong, SizeT, SSizeT,
  Flt, Dbl, LDbl, Floating,
  Ptr, Struct, Ellip, Same
}
 

Functions

static bool hasSinCosPiStret (const Triple &T)
 
static bool hasBcmp (const Triple &TT)
 
static bool isCallingConvCCompatible (CallingConv::ID CC, StringRef TT, FunctionType *FuncTy)
 
static void initialize (TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringLiteral > StandardNames)
 Initialize the set of available library functions based on the specified target triple. More...
 
static StringRef sanitizeFunctionName (StringRef funcName)
 
static bool matchType (FuncArgTypeID ArgTy, const Type *Ty, unsigned IntBits, unsigned SizeTBits)
 
static bool compareByScalarFnName (const VecDesc &LHS, const VecDesc &RHS)
 
static bool compareByVectorFnName (const VecDesc &LHS, const VecDesc &RHS)
 
static bool compareWithScalarFnName (const VecDesc &LHS, StringRef S)
 

Variables

static cl::opt< TargetLibraryInfoImpl::VectorLibraryClVectorLibrary ("vector-library", cl::Hidden, cl::desc("Vector functions library"), cl::init(TargetLibraryInfoImpl::NoLibrary), cl::values(clEnumValN(TargetLibraryInfoImpl::NoLibrary, "none", "No vector functions library"), clEnumValN(TargetLibraryInfoImpl::Accelerate, "Accelerate", "Accelerate framework"), clEnumValN(TargetLibraryInfoImpl::DarwinLibSystemM, "Darwin_libsystem_m", "Darwin libsystem_m"), clEnumValN(TargetLibraryInfoImpl::LIBMVEC_X86, "LIBMVEC-X86", "GLIBC Vector Math library"), clEnumValN(TargetLibraryInfoImpl::MASSV, "MASSV", "IBM MASS vector library"), clEnumValN(TargetLibraryInfoImpl::SVML, "SVML", "Intel SVML library")))
 
static const FuncProtoTy Signatures []
 

Macro Definition Documentation

◆ TLI_DEFINE_ACCELERATE_VECFUNCS

#define TLI_DEFINE_ACCELERATE_VECFUNCS

◆ TLI_DEFINE_DARWIN_LIBSYSTEM_M_VECFUNCS

#define TLI_DEFINE_DARWIN_LIBSYSTEM_M_VECFUNCS

◆ TLI_DEFINE_LIBMVEC_X86_VECFUNCS

#define TLI_DEFINE_LIBMVEC_X86_VECFUNCS

◆ TLI_DEFINE_MASSV_VECFUNCS

#define TLI_DEFINE_MASSV_VECFUNCS

◆ TLI_DEFINE_SIG

#define TLI_DEFINE_SIG

◆ TLI_DEFINE_STRING

#define TLI_DEFINE_STRING

◆ TLI_DEFINE_SVML_VECFUNCS

#define TLI_DEFINE_SVML_VECFUNCS

Typedef Documentation

◆ FuncProtoTy

typedef std::array<FuncArgTypeID, 8> FuncProtoTy

Definition at line 66 of file TargetLibraryInfo.cpp.

Enumeration Type Documentation

◆ FuncArgTypeID

enum FuncArgTypeID : char
Enumerator
Void 
Bool 
Int16 
Int32 
Int 
IntPlus 
Long 
IntX 
Int64 
LLong 
SizeT 
SSizeT 
Flt 
Dbl 
LDbl 
Floating 
Ptr 
Struct 
Ellip 
Same 

Definition at line 43 of file TargetLibraryInfo.cpp.

Function Documentation

◆ compareByScalarFnName()

static bool compareByScalarFnName ( const VecDesc LHS,
const VecDesc RHS 
)
static

Definition at line 1121 of file TargetLibraryInfo.cpp.

References LHS, and RHS.

Referenced by llvm::TargetLibraryInfoImpl::addVectorizableFunctions().

◆ compareByVectorFnName()

static bool compareByVectorFnName ( const VecDesc LHS,
const VecDesc RHS 
)
static

Definition at line 1125 of file TargetLibraryInfo.cpp.

References LHS, and RHS.

Referenced by llvm::TargetLibraryInfoImpl::addVectorizableFunctions().

◆ compareWithScalarFnName()

static bool compareWithScalarFnName ( const VecDesc LHS,
StringRef  S 
)
static

◆ hasBcmp()

static bool hasBcmp ( const Triple TT)
static

Definition at line 94 of file TargetLibraryInfo.cpp.

Referenced by initialize().

◆ hasSinCosPiStret()

static bool hasSinCosPiStret ( const Triple T)
static

Definition at line 76 of file TargetLibraryInfo.cpp.

References llvm::Triple::x86.

Referenced by initialize().

◆ initialize()

static void initialize ( TargetLibraryInfoImpl TLI,
const Triple T,
ArrayRef< StringLiteral StandardNames 
)
static

Initialize the set of available library functions based on the specified target triple.

This should be carefully written so that a missing target triple gets a sane set of defaults.

Definition at line 150 of file TargetLibraryInfo.cpp.

References llvm::Triple::aarch64, llvm::TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib(), llvm::Triple::arm, assert(), ClVectorLibrary, llvm::Triple::Darwin, llvm::TargetLibraryInfoImpl::disableAllFunctions(), llvm::Triple::Emscripten, llvm::Triple::FreeBSD, hasBcmp(), hasSinCosPiStret(), llvm::Triple::IOS, llvm::is_sorted(), LHS, llvm::Triple::Linux, llvm::Triple::MacOSX, RHS, llvm::TargetLibraryInfoImpl::setAvailable(), llvm::TargetLibraryInfoImpl::setAvailableWithName(), llvm::TargetLibraryInfoImpl::setIntSize(), llvm::TargetLibraryInfoImpl::setShouldExtI32Param(), llvm::TargetLibraryInfoImpl::setShouldExtI32Return(), llvm::TargetLibraryInfoImpl::setShouldSignExtI32Param(), llvm::TargetLibraryInfoImpl::setUnavailable(), llvm::Triple::sparcv9, llvm::Triple::systemz, llvm::Triple::tce, llvm::Triple::TvOS, llvm::IndexedInstrProf::Version, llvm::Triple::WatchOS, llvm::Triple::x86, llvm::Triple::x86_64, and llvm::Triple::xcore.

Referenced by llvm::OProfileWrapper::op_close_agent(), llvm::OProfileWrapper::op_major_version(), llvm::OProfileWrapper::op_minor_version(), llvm::OProfileWrapper::op_open_agent(), llvm::OProfileWrapper::op_unload_native_code(), llvm::OProfileWrapper::op_write_debug_line_info(), llvm::OProfileWrapper::op_write_native_code(), and llvm::TargetLibraryInfoImpl::TargetLibraryInfoImpl().

◆ isCallingConvCCompatible()

static bool isCallingConvCCompatible ( CallingConv::ID  CC,
StringRef  TT,
FunctionType FuncTy 
)
static

◆ matchType()

static bool matchType ( FuncArgTypeID  ArgTy,
const Type Ty,
unsigned  IntBits,
unsigned  SizeTBits 
)
static

◆ sanitizeFunctionName()

static StringRef sanitizeFunctionName ( StringRef  funcName)
static

Variable Documentation

◆ ClVectorLibrary

cl::opt<TargetLibraryInfoImpl::VectorLibrary> ClVectorLibrary("vector-library", cl::Hidden, cl::desc("Vector functions library"), cl::init(TargetLibraryInfoImpl::NoLibrary), cl::values(clEnumValN(TargetLibraryInfoImpl::NoLibrary, "none", "No vector functions library"), clEnumValN(TargetLibraryInfoImpl::Accelerate, "Accelerate", "Accelerate framework"), clEnumValN(TargetLibraryInfoImpl::DarwinLibSystemM, "Darwin_libsystem_m", "Darwin libsystem_m"), clEnumValN(TargetLibraryInfoImpl::LIBMVEC_X86, "LIBMVEC-X86", "GLIBC Vector Math library"), clEnumValN(TargetLibraryInfoImpl::MASSV, "MASSV", "IBM MASS vector library"), clEnumValN(TargetLibraryInfoImpl::SVML, "SVML", "Intel SVML library")))
static

Referenced by initialize().

◆ Signatures

const FuncProtoTy Signatures[]
static
Initial value:
= {
#define TLI_DEFINE_SIG
}

Definition at line 68 of file TargetLibraryInfo.cpp.

Referenced by llvm::WebAssemblyAsmPrinter::addSignature().