27 "No vector functions library"),
29 "Accelerate framework"),
31 "Darwin_libsystem_m",
"Darwin libsystem_m"),
33 "GLIBC Vector Math library"),
35 "IBM MASS vector library"),
37 "Intel SVML library"),
39 "SIMD Library for Evaluating Elementary Functions"),
41 "Arm Performance Libraries"),
43 "AMD vector math library")));
45StringLiteral const TargetLibraryInfoImpl::StandardNames[LibFunc::NumLibFuncs] =
47#define TLI_DEFINE_STRING
48#include "llvm/Analysis/TargetLibraryInfo.def"
52 assert(!VectorFnName.
empty() &&
"Vector function name must not be empty.");
55 Out << VABIPrefix <<
"_" << ScalarFnName <<
"(" << VectorFnName <<
")";
56 return std::string(Out.
str());
87#include "llvm/Analysis/TargetLibraryInfo.def"
91 "Missing library function signatures");
102 if (
T.isMacOSX() &&
T.isMacOSXVersionLT(10, 9))
105 if (
T.isiOS() &&
T.isOSVersionLT(7, 0))
115 return TT.isGNUEnvironment() || TT.isMusl();
118 return TT.isOSFreeBSD() || TT.isOSSolaris();
137 if (!FuncTy->getReturnType()->isPointerTy() &&
138 !FuncTy->getReturnType()->isIntegerTy() &&
139 !FuncTy->getReturnType()->isVoidTy())
142 for (
auto *Param : FuncTy->params()) {
143 if (!Param->isPointerTy() && !Param->isIntegerTy())
159 return ::isCallingConvCCompatible(
F->getCallingConv(),
160 F->getParent()->getTargetTriple(),
161 F->getFunctionType());
165 bool ShouldExtI32Param, ShouldExtI32Return;
166 bool ShouldSignExtI32Param, ShouldSignExtI32Return;
168 ShouldExtI32Param, ShouldExtI32Return, ShouldSignExtI32Param,
169 ShouldSignExtI32Return,
T);
226 if (
T.isMacOSXVersionLT(10, 5)) {
231 }
else if (
T.isiOS()) {
232 if (
T.isOSVersionLT(3, 0)) {
237 }
else if (!
T.isWatchOS()) {
256 !
T.isMacOSXVersionLT(10, 7)) {
281 if (
T.isOSWindows() && !
T.isOSCygMing()) {
287 bool hasPartialC99 =
true;
288 if (
T.isKnownWindowsMSVCEnvironment()) {
290 hasPartialC99 = (
Version.getMajor() == 0 ||
Version.getMajor() >= 19);
296 bool hasPartialFloat = (isARM ||
300 if (!hasPartialFloat) {
359 if (!hasPartialC99) {
454 if (
T.isOSWindows() && !
T.isWindowsCygwinEnvironment()) {
496 if (
T.isOSMSVCRT()) {
534 TLI.
setUnavailable(LibFunc_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t);
537 TLI.
setUnavailable(LibFunc_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t);
572 if (
T.isMacOSXVersionLT(10, 9)) {
585 if (!
T.isWatchOS() &&
586 (
T.isOSVersionLT(7, 0) || (
T.isOSVersionLT(9, 0) &&
T.isX86()))) {
648 if (!
T.isOSFreeBSD()) {
656 if (!
T.isOSLinux() || !
T.isGNUEnvironment()) {
664 if (!
T.isAndroid() && !
T.isMusl())
728 if ((
T.isOSLinux() &&
T.isGNUEnvironment()) ||
729 (
T.isAndroid() && !
T.isAndroidVersionLT(28))) {
743 if (
T.isAndroid() &&
T.isAndroidVersionLT(21)) {
878 if (
T.isOSFreeBSD()) {
962 memset(AvailableArray, -1,
sizeof(AvailableArray));
968 : CustomNames(TLI.CustomNames), ShouldExtI32Param(TLI.ShouldExtI32Param),
969 ShouldExtI32Return(TLI.ShouldExtI32Return),
970 ShouldSignExtI32Param(TLI.ShouldSignExtI32Param),
971 ShouldSignExtI32Return(TLI.ShouldSignExtI32Return),
972 SizeOfInt(TLI.SizeOfInt) {
973 memcpy(AvailableArray, TLI.AvailableArray,
sizeof(AvailableArray));
974 VectorDescs = TLI.VectorDescs;
975 ScalarDescs = TLI.ScalarDescs;
979 : CustomNames(
std::
move(TLI.CustomNames)),
980 ShouldExtI32Param(TLI.ShouldExtI32Param),
981 ShouldExtI32Return(TLI.ShouldExtI32Return),
982 ShouldSignExtI32Param(TLI.ShouldSignExtI32Param),
983 ShouldSignExtI32Return(TLI.ShouldSignExtI32Return),
984 SizeOfInt(TLI.SizeOfInt) {
985 std::move(std::begin(TLI.AvailableArray), std::end(TLI.AvailableArray),
987 VectorDescs = TLI.VectorDescs;
988 ScalarDescs = TLI.ScalarDescs;
992 CustomNames = TLI.CustomNames;
993 ShouldExtI32Param = TLI.ShouldExtI32Param;
994 ShouldExtI32Return = TLI.ShouldExtI32Return;
995 ShouldSignExtI32Param = TLI.ShouldSignExtI32Param;
996 ShouldSignExtI32Return = TLI.ShouldSignExtI32Return;
997 SizeOfInt = TLI.SizeOfInt;
998 memcpy(AvailableArray, TLI.AvailableArray,
sizeof(AvailableArray));
1003 CustomNames = std::move(TLI.CustomNames);
1004 ShouldExtI32Param = TLI.ShouldExtI32Param;
1005 ShouldExtI32Return = TLI.ShouldExtI32Return;
1006 ShouldSignExtI32Param = TLI.ShouldSignExtI32Param;
1007 ShouldSignExtI32Return = TLI.ShouldSignExtI32Return;
1008 SizeOfInt = TLI.SizeOfInt;
1009 std::move(std::begin(TLI.AvailableArray), std::end(TLI.AvailableArray),
1030 for (
const auto &Func : StandardNames)
1037 if (funcName.
empty())
1043 if (
auto Loc = Indices.
find(funcName); Loc != Indices.
end()) {
1053 unsigned SizeTBits) {
1101 int SizeTSizeBits) {
1103 case LibFunc_size_returning_new: {
1104 if (FTy.getNumParams() != 1 ||
1105 !FTy.getParamType(0)->isIntegerTy(SizeTSizeBits)) {
1109 case LibFunc_size_returning_new_hot_cold: {
1110 if (FTy.getNumParams() != 2 ||
1111 !FTy.getParamType(0)->isIntegerTy(SizeTSizeBits) ||
1112 !FTy.getParamType(1)->isIntegerTy(8)) {
1116 case LibFunc_size_returning_new_aligned: {
1117 if (FTy.getNumParams() != 2 ||
1118 !FTy.getParamType(0)->isIntegerTy(SizeTSizeBits) ||
1119 !FTy.getParamType(1)->isIntegerTy(SizeTSizeBits)) {
1123 case LibFunc_size_returning_new_aligned_hot_cold:
1124 if (FTy.getNumParams() != 3 ||
1125 !FTy.getParamType(0)->isIntegerTy(SizeTSizeBits) ||
1126 !FTy.getParamType(1)->isIntegerTy(SizeTSizeBits) ||
1127 !FTy.getParamType(2)->isIntegerTy(8)) {
1135 auto &
Context = M.getContext();
1139 return FTy.getReturnType() == SizedPtrTy;
1142bool TargetLibraryInfoImpl::isValidProtoForLibFunc(
const FunctionType &FTy,
1145 unsigned NumParams = FTy.getNumParams();
1151 case LibFunc_cabsl: {
1153 if (!
RetTy->isFloatingPointTy() || NumParams == 0)
1156 Type *ParamTy = FTy.getParamType(0);
1163 else if (NumParams == 2)
1164 return ParamTy ==
RetTy && FTy.getParamType(1) ==
RetTy;
1170 case LibFunc_sincospi_stret:
1171 case LibFunc_sincospif_stret: {
1176 Type *ParamTy = FTy.getParamType(0);
1177 if (
auto *Ty = dyn_cast<StructType>(
RetTy)) {
1178 if (Ty->getNumElements() != 2)
1180 return (Ty->getElementType(0) == ParamTy &&
1181 Ty->getElementType(1) == ParamTy);
1184 if (
auto *Ty = dyn_cast<FixedVectorType>(
RetTy)) {
1185 if (Ty->getNumElements() != 2)
1187 return Ty->getElementType() == ParamTy;
1194 case LibFunc_size_returning_new:
1195 case LibFunc_size_returning_new_hot_cold:
1196 case LibFunc_size_returning_new_aligned:
1197 case LibFunc_size_returning_new_aligned_hot_cold:
1210 Type *Ty = FTy.getReturnType(), *LastTy = Ty;
1212 for (
auto TyID : ProtoTypes) {
1218 if (TyID ==
Ellip) {
1223 return FTy.isFunctionVarArg();
1227 assert(
Idx != 0 &&
"Type ID 'Same' must not be first!");
1231 if (!Ty || !
matchType(TyID, Ty, IntBits, SizeTBits))
1236 if (
Idx == NumParams) {
1244 Ty = FTy.getParamType(
Idx++);
1249 return Idx == NumParams + 1 && !FTy.isFunctionVarArg();
1260 assert(M &&
"Expecting FDecl to be connected to a Module.");
1262 if (FDecl.LibFuncCache == Function::UnknownLibFunc)
1269 F = FDecl.LibFuncCache;
1279 F = Ty->
isDoubleTy() ? LibFunc_fmod : LibFunc_fmodf;
1284 memset(AvailableArray, 0,
sizeof(AvailableArray));
1288 return LHS.getScalarFnName() <
RHS.getScalarFnName();
1292 return LHS.getVectorFnName() <
RHS.getVectorFnName();
1296 return LHS.getScalarFnName() < S;
1308#define TLI_DEFINE_ACCELERATE_VECFUNCS
1309#include "llvm/Analysis/VecFuncs.def"
1310#undef TLI_DEFINE_ACCELERATE_VECFUNCS
1314#define TLI_DEFINE_DARWIN_LIBSYSTEM_M_VECFUNCS
1315#include "llvm/Analysis/VecFuncs.def"
1316#undef TLI_DEFINE_DARWIN_LIBSYSTEM_M_VECFUNCS
1320#define TLI_DEFINE_LIBMVEC_X86_VECFUNCS
1321#include "llvm/Analysis/VecFuncs.def"
1322#undef TLI_DEFINE_LIBMVEC_X86_VECFUNCS
1326#define TLI_DEFINE_LIBMVEC_AARCH64_VECFUNCS
1327#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, MASK, VABI_PREFIX, CC) \
1328 {SCAL, VEC, VF, MASK, VABI_PREFIX, CC},
1329#include "llvm/Analysis/VecFuncs.def"
1330#undef TLI_DEFINE_LIBMVEC_AARCH64_VECFUNCS
1334#define TLI_DEFINE_MASSV_VECFUNCS
1335#include "llvm/Analysis/VecFuncs.def"
1336#undef TLI_DEFINE_MASSV_VECFUNCS
1340#define TLI_DEFINE_SVML_VECFUNCS
1341#include "llvm/Analysis/VecFuncs.def"
1342#undef TLI_DEFINE_SVML_VECFUNCS
1346#define TLI_DEFINE_SLEEFGNUABI_VF2_VECFUNCS
1347#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, VABI_PREFIX) \
1348 {SCAL, VEC, VF, false, VABI_PREFIX, std::nullopt},
1349#include "llvm/Analysis/VecFuncs.def"
1350#undef TLI_DEFINE_SLEEFGNUABI_VF2_VECFUNCS
1353#define TLI_DEFINE_SLEEFGNUABI_VF4_VECFUNCS
1354#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, VABI_PREFIX) \
1355 {SCAL, VEC, VF, false, VABI_PREFIX, std::nullopt},
1356#include "llvm/Analysis/VecFuncs.def"
1357#undef TLI_DEFINE_SLEEFGNUABI_VF4_VECFUNCS
1360#define TLI_DEFINE_SLEEFGNUABI_SCALABLE_VECFUNCS
1361#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, MASK, VABI_PREFIX) \
1362 {SCAL, VEC, VF, MASK, VABI_PREFIX, std::nullopt},
1363#include "llvm/Analysis/VecFuncs.def"
1364#undef TLI_DEFINE_SLEEFGNUABI_SCALABLE_VECFUNCS
1368#define TLI_DEFINE_SLEEFGNUABI_SCALABLE_VECFUNCS_RISCV
1369#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, MASK, VABI_PREFIX) \
1370 {SCAL, VEC, VF, MASK, VABI_PREFIX, std::nullopt},
1371#include "llvm/Analysis/VecFuncs.def"
1372#undef TLI_DEFINE_SLEEFGNUABI_SCALABLE_VECFUNCS_RISCV
1376#define TLI_DEFINE_ARMPL_VECFUNCS
1377#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, MASK, VABI_PREFIX, CC) \
1378 {SCAL, VEC, VF, MASK, VABI_PREFIX, CC},
1379#include "llvm/Analysis/VecFuncs.def"
1380#undef TLI_DEFINE_ARMPL_VECFUNCS
1384#define TLI_DEFINE_AMDLIBM_VECFUNCS
1385#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, MASK, VABI_PREFIX) \
1386 {SCAL, VEC, VF, MASK, VABI_PREFIX, std::nullopt},
1387#include "llvm/Analysis/VecFuncs.def"
1388#undef TLI_DEFINE_AMDLIBM_VECFUNCS
1403 switch (TargetTriple.
getArch()) {
1426 switch (TargetTriple.
getArch()) {
1442 switch (TargetTriple.
getArch()) {
1463 if (funcName.
empty())
1466 std::vector<VecDesc>::const_iterator
I =
1468 return I != VectorDescs.end() &&
StringRef(
I->getScalarFnName()) == funcName;
1486 std::vector<VecDesc>::const_iterator
I =
1488 while (
I != VectorDescs.end() &&
StringRef(
I->getScalarFnName()) ==
F) {
1489 if ((
I->getVectorizationFactor() == VF) && (
I->isMasked() ==
Masked))
1498 if (!BaselineInfoImpl)
1504 if (
auto *ShortWChar = cast_or_null<ConstantAsMetadata>(
1505 M.getModuleFlag(
"wchar_size")))
1506 return cast<ConstantInt>(ShortWChar->getValue())->getZExtValue();
1520 return M.getDataLayout().getIndexSizeInBits(0);
1541 "Target Library Information",
false,
true)
1554 if (ScalarF.
empty())
1557 std::vector<VecDesc>::const_iterator
I =
1559 while (
I != VectorDescs.end() &&
StringRef(
I->getScalarFnName()) == ScalarF) {
1561 I->getVectorizationFactor().isScalable() ? &ScalableVF : &FixedVF;
1563 *VF =
I->getVectorizationFactor();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
This file defines the DenseMap class.
Module.h This file contains the declarations for the Module class.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the SmallString class.
static bool hasSinCosPiStret(const Triple &T)
static bool isCallingConvCCompatible(CallingConv::ID CC, const Triple &TT, FunctionType *FuncTy)
static StringRef sanitizeFunctionName(StringRef funcName)
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringLiteral > StandardNames)
Initialize the set of available library functions based on the specified target triple.
static const VecDesc VecFuncs_MASSV[]
static void initializeLibCalls(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringLiteral > StandardNames)
Initialize the set of available library functions based on the specified target triple.
static bool matchType(FuncArgTypeID ArgTy, const Type *Ty, unsigned IntBits, unsigned SizeTBits)
static bool hasBcmp(const Triple &TT)
static const VecDesc VecFuncs_SLEEFGNUABI_VF2[]
static void initializeBase(TargetLibraryInfoImpl &TLI, const Triple &T)
static bool compareByScalarFnName(const VecDesc &LHS, const VecDesc &RHS)
static const VecDesc VecFuncs_LIBMVEC_AARCH64[]
static bool compareByVectorFnName(const VecDesc &LHS, const VecDesc &RHS)
static const VecDesc VecFuncs_SLEEFGNUABI_VF4[]
static const FuncProtoTy Signatures[]
static const VecDesc VecFuncs_ArmPL[]
const VecDesc VecFuncs_AMDLIBM[]
static bool isValidProtoForSizeReturningNew(const FunctionType &FTy, LibFunc F, const Module &M, int SizeTSizeBits)
static const VecDesc VecFuncs_LIBMVEC_X86[]
static 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, "LIBMVEC", "GLIBC Vector Math library"), clEnumValN(TargetLibraryInfoImpl::MASSV, "MASSV", "IBM MASS vector library"), clEnumValN(TargetLibraryInfoImpl::SVML, "SVML", "Intel SVML library"), clEnumValN(TargetLibraryInfoImpl::SLEEFGNUABI, "sleefgnuabi", "SIMD Library for Evaluating Elementary Functions"), clEnumValN(TargetLibraryInfoImpl::ArmPL, "ArmPL", "Arm Performance Libraries"), clEnumValN(TargetLibraryInfoImpl::AMDLIBM, "AMDLIBM", "AMD vector math library")))
static const VecDesc VecFuncs_DarwinLibSystemM[]
static const VecDesc VecFuncs_SVML[]
std::array< FuncArgTypeID, 8 > FuncProtoTy
static const VecDesc VecFuncs_SLEEFGNUABI_VFScalable[]
static bool compareWithScalarFnName(const VecDesc &LHS, StringRef S)
static const VecDesc VecFuncs_Accelerate[]
static const VecDesc VecFuncs_SLEEFGNUABI_VFScalableRISCV[]
static DenseMap< StringRef, LibFunc > buildIndexMap(ArrayRef< StringLiteral > StandardNames)
A container for analyses that lazily runs them and caches their results.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
CallingConv::ID getCallingConv() const
FunctionType * getFunctionType() const
iterator find(const_arg_type_t< KeyT > Val)
void reserve(size_type NumEntries)
Grow the densemap so that it can contain at least NumEntries items before resizing again.
static constexpr ElementCount getScalable(ScalarTy MinVal)
static constexpr ElementCount getFixed(ScalarTy MinVal)
FunctionType * getFunctionType() const
Returns the FunctionType for me.
bool isIntrinsic() const
isIntrinsic - Returns true if the function's name starts with "llvm.".
static StringRef dropLLVMManglingEscape(StringRef Name)
If the given string begins with the GlobalValue name mangling escape character '\1',...
Module * getParent()
Get the module that this global value is contained inside of...
ImmutablePass class - This class is used to provide information that does not need to be run.
LLVM_ABI const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
A Module instance is used to store all the information related to an LLVM module.
const Triple & getTargetTriple() const
Get the target triple which is a string describing the target host.
static LLVM_ABI PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
bool contains(StringRef Other) const
Return true if the given string is a substring of *this, and false otherwise.
Class to represent struct types.
static LLVM_ABI StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
LLVM_ABI TargetLibraryInfo run(const Function &F, FunctionAnalysisManager &)
Implementation of the target library information.
void setShouldExtI32Param(bool Val)
Set to true iff i32 parameters to library functions should have signext or zeroext attributes if they...
void setShouldExtI32Return(bool Val)
Set to true iff i32 results from library functions should have signext or zeroext attributes if they ...
LLVM_ABI unsigned getWCharSize(const Module &M) const
Returns the size of the wchar_t type in bytes or 0 if the size is unknown.
LLVM_ABI bool getLibFunc(StringRef funcName, LibFunc &F) const
Searches for a particular function name.
LLVM_ABI void getWidestVF(StringRef ScalarF, ElementCount &FixedVF, ElementCount &Scalable) const
Returns the largest vectorization factor used in the list of vector functions.
bool isFunctionVectorizable(StringRef F, const ElementCount &VF) const
Return true if the function F has a vector equivalent with vectorization factor VF.
void setShouldSignExtI32Param(bool Val)
Set to true iff i32 parameters to library functions should have signext attribute if they correspond ...
void setAvailableWithName(LibFunc F, StringRef Name)
Forces a function to be marked as available and provide an alternate name that must be used.
TargetLibraryInfoImpl()=delete
unsigned getIntSize() const
Get size of a C-level int or unsigned int, in bits.
LLVM_ABI void addVectorizableFunctionsFromVecLib(enum VectorLibrary VecLib, const llvm::Triple &TargetTriple)
Calls addVectorizableFunctions with a known preset of functions for the given vector library.
void setIntSize(unsigned Bits)
Initialize the C-level size of an integer.
LLVM_ABI unsigned getSizeTSize(const Module &M) const
Returns the size of the size_t type in bits.
LLVM_ABI void addVectorizableFunctions(ArrayRef< VecDesc > Fns)
Add a set of scalar -> vector mappings, queryable via getVectorizedFunction and getScalarizedFunction...
LLVM_ABI 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 eq...
static LLVM_ABI bool isCallingConvCCompatible(CallBase *CI)
Returns true if call site / callee has cdecl-compatible calling conventions.
void setShouldSignExtI32Return(bool Val)
Set to true iff i32 results from library functions should have signext attribute if they correspond t...
LLVM_ABI TargetLibraryInfoImpl & operator=(const TargetLibraryInfoImpl &TLI)
LLVM_ABI void disableAllFunctions()
Disables all builtins.
VectorLibrary
List of known vector-functions libraries.
void setUnavailable(LibFunc F)
Forces a function to be marked as unavailable.
LLVM_ABI StringRef getVectorizedFunction(StringRef F, const ElementCount &VF, bool Masked) const
Return the name of the equivalent of F, vectorized with factor VF.
void setAvailable(LibFunc F)
Forces a function to be marked as available.
TargetLibraryInfoWrapperPass()
The default constructor should not be used and is only for pass manager initialization purposes.
Provides information about what library functions are available for the current target.
static void initExtensionsForTriple(bool &ShouldExtI32Param, bool &ShouldExtI32Return, bool &ShouldSignExtI32Param, bool &ShouldSignExtI32Return, const Triple &T)
Triple - Helper class for working with autoconf configuration names.
ArchType getArch() const
Get the parsed architecture type of this triple.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM_ABI TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
bool isArrayTy() const
True if this is an instance of ArrayType.
bool isPointerTy() const
True if this is an instance of PointerType.
Type * getArrayElementType() const
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
static LLVM_ABI IntegerType * getIntNTy(LLVMContext &C, unsigned N)
bool isStructTy() const
True if this is an instance of StructType.
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
bool isIntegerTy() const
True if this is an instance of IntegerType.
bool isVoidTy() const
Return true if this is 'void'.
LLVM_ABI uint64_t getArrayNumElements() const
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
Provides info so a possible vectorization of a function can be computed.
LLVM_ABI std::string getVectorFunctionABIVariantString() const
Returns a vector function ABI variant string on the form: ZGV<isa><mask><vlen><vparams><scalarname>(<...
StringRef getVectorFnName() const
Represents a version number in the form major[.minor[.subminor[.build]]].
static constexpr bool isKnownGT(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
A raw_ostream that writes to an SmallVector or SmallString.
StringRef str() const
Return a StringRef for the vector contents.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ ARM_APCS
ARM Procedure Calling Standard (obsolete, but still used on some targets).
@ ARM_AAPCS
ARM Architecture Procedure Calling Standard calling convention (aka EABI).
@ ARM_AAPCS_VFP
Same as ARM_AAPCS, but uses hard floating point ABI.
@ C
The default llvm calling convention, compatible with C.
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
void sort(IteratorTy Start, IteratorTy End)
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
A special type used by analysis passes to provide an address that identifies that particular analysis...