24 "No vector functions library"),
26 "Accelerate framework"),
28 "Intel SVML library")));
31 #define TLI_DEFINE_STRING 32 #include "llvm/Analysis/TargetLibraryInfo.def" 63 "TargetLibraryInfoImpl function names must be sorted");
77 bool ShouldExtI32Param =
false, ShouldExtI32Return =
false,
78 ShouldSignExtI32Param =
false;
83 ShouldExtI32Param =
true;
84 ShouldExtI32Return =
true;
89 ShouldSignExtI32Param =
true;
129 }
else if (T.
isiOS()) {
169 bool hasPartialC99 =
true;
171 unsigned Major, Minor, Micro;
173 hasPartialC99 = (Major == 0 || Major >= 19);
179 bool hasPartialFloat = (isARM ||
183 if (!hasPartialFloat) {
234 if (!hasPartialC99) {
542 memset(AvailableArray, -1,
sizeof(AvailableArray));
549 memset(AvailableArray, -1,
sizeof(AvailableArray));
555 : CustomNames(TLI.CustomNames), ShouldExtI32Param(TLI.ShouldExtI32Param),
556 ShouldExtI32Return(TLI.ShouldExtI32Return),
557 ShouldSignExtI32Param(TLI.ShouldSignExtI32Param) {
558 memcpy(AvailableArray, TLI.AvailableArray,
sizeof(AvailableArray));
559 VectorDescs = TLI.VectorDescs;
560 ScalarDescs = TLI.ScalarDescs;
564 : CustomNames(
std::move(TLI.CustomNames)),
565 ShouldExtI32Param(TLI.ShouldExtI32Param),
566 ShouldExtI32Return(TLI.ShouldExtI32Return),
567 ShouldSignExtI32Param(TLI.ShouldSignExtI32Param) {
570 VectorDescs = TLI.VectorDescs;
571 ScalarDescs = TLI.ScalarDescs;
575 CustomNames = TLI.CustomNames;
576 ShouldExtI32Param = TLI.ShouldExtI32Param;
577 ShouldExtI32Return = TLI.ShouldExtI32Return;
578 ShouldSignExtI32Param = TLI.ShouldSignExtI32Param;
579 memcpy(AvailableArray, TLI.AvailableArray,
sizeof(AvailableArray));
584 CustomNames = std::move(TLI.CustomNames);
585 ShouldExtI32Param = TLI.ShouldExtI32Param;
586 ShouldExtI32Return = TLI.ShouldExtI32Return;
587 ShouldSignExtI32Param = TLI.ShouldSignExtI32Param;
606 StringRef const *Start = &StandardNames[0];
610 if (funcName.
empty())
617 if (I != End && *I == funcName) {
624 bool TargetLibraryInfoImpl::isValidProtoForLibFunc(
const FunctionType &FTy,
630 auto IsSizeTTy = [SizeTTy](
Type *Ty) {
631 return SizeTTy ? Ty == SizeTTy : Ty->
isIntegerTy();
648 case LibFunc_execvpe:
659 case LibFunc_strrchr:
667 case LibFunc_strtoul:
668 case LibFunc_strtoll:
669 case LibFunc_strtold:
670 case LibFunc_strtoull:
671 return ((NumParams == 2 || NumParams == 3) &&
679 case LibFunc_strncat:
685 case LibFunc_strcpy_chk:
686 case LibFunc_stpcpy_chk:
697 case LibFunc_strncpy_chk:
698 case LibFunc_stpncpy_chk:
703 case LibFunc_strncpy:
704 case LibFunc_stpncpy:
710 case LibFunc_strxfrm:
719 case LibFunc_strncmp:
726 case LibFunc_strcspn:
731 case LibFunc_strcoll:
732 case LibFunc_strcasecmp:
733 case LibFunc_strncasecmp:
742 case LibFunc_strpbrk:
748 case LibFunc_strtok_r:
752 case LibFunc_setvbuf:
755 case LibFunc_strndup:
760 case LibFunc_statvfs:
761 case LibFunc_siprintf:
762 case LibFunc_sprintf:
766 case LibFunc_snprintf:
770 case LibFunc_setitimer:
783 case LibFunc_memrchr:
793 case LibFunc_memcpy_chk:
794 case LibFunc_memmove_chk:
800 case LibFunc_mempcpy:
801 case LibFunc_memmove:
807 case LibFunc_memset_chk:
818 case LibFunc_memccpy:
820 case LibFunc_memalign:
822 case LibFunc_realloc:
823 case LibFunc_reallocf:
832 case LibFunc_realpath:
837 case LibFunc_readlink:
857 case LibFunc_getpwnam:
858 case LibFunc_iprintf:
864 case LibFunc_under_IO_getc:
866 case LibFunc_unsetenv:
872 case LibFunc_clearerr:
873 case LibFunc_closedir:
874 case LibFunc_ctermid:
879 case LibFunc_fgetc_unlocked:
881 case LibFunc_flockfile:
884 case LibFunc_fseeko64:
886 case LibFunc_fsetpos:
888 case LibFunc_ftello64:
890 case LibFunc_ftrylockfile:
891 case LibFunc_funlockfile:
893 case LibFunc_getc_unlocked:
894 case LibFunc_getlogin_r:
910 case LibFunc_fputc_unlocked:
915 case LibFunc_fstatvfs:
918 case LibFunc_fgets_unlocked:
922 case LibFunc_fread_unlocked:
926 case LibFunc_fwrite_unlocked:
933 case LibFunc_fputs_unlocked:
937 case LibFunc_fiprintf:
938 case LibFunc_fprintf:
942 case LibFunc_fgetpos:
945 case LibFunc_getchar:
946 case LibFunc_getchar_unlocked:
949 return (NumParams == 1 && FTy.
getParamType(0) == PCharTy);
950 case LibFunc_getitimer:
959 case LibFunc_putc_unlocked:
970 case LibFunc_vsscanf:
973 case LibFunc_vfscanf:
978 case LibFunc_vprintf:
980 case LibFunc_vfprintf:
981 case LibFunc_vsprintf:
984 case LibFunc_vsnprintf:
989 case LibFunc_opendir:
992 case LibFunc_tmpfile:
1005 case LibFunc_lchown:
1009 case LibFunc_dunder_strdup:
1010 case LibFunc_dunder_strndup:
1013 case LibFunc_dunder_strtok_r:
1015 case LibFunc_under_IO_putc:
1017 case LibFunc_dunder_isoc99_scanf:
1019 case LibFunc_stat64:
1020 case LibFunc_lstat64:
1021 case LibFunc_statvfs64:
1024 case LibFunc_dunder_isoc99_sscanf:
1027 case LibFunc_fopen64:
1031 case LibFunc_tmpfile64:
1033 case LibFunc_fstat64:
1034 case LibFunc_fstatvfs64:
1036 case LibFunc_open64:
1038 case LibFunc_gettimeofday:
1051 case LibFunc_msvc_new_int:
1053 case LibFunc_msvc_new_longlong:
1055 case LibFunc_msvc_new_array_int:
1057 case LibFunc_msvc_new_array_longlong:
1061 case LibFunc_ZnwjRKSt9nothrow_t:
1063 case LibFunc_ZnwmRKSt9nothrow_t:
1065 case LibFunc_ZnajRKSt9nothrow_t:
1067 case LibFunc_ZnamRKSt9nothrow_t:
1069 case LibFunc_msvc_new_int_nothrow:
1071 case LibFunc_msvc_new_longlong_nothrow:
1073 case LibFunc_msvc_new_array_int_nothrow:
1075 case LibFunc_msvc_new_array_longlong_nothrow:
1077 case LibFunc_ZnwjSt11align_val_t:
1079 case LibFunc_ZnwmSt11align_val_t:
1081 case LibFunc_ZnajSt11align_val_t:
1083 case LibFunc_ZnamSt11align_val_t:
1087 case LibFunc_ZnwjSt11align_val_tRKSt9nothrow_t:
1089 case LibFunc_ZnwmSt11align_val_tRKSt9nothrow_t:
1091 case LibFunc_ZnajSt11align_val_tRKSt9nothrow_t:
1093 case LibFunc_ZnamSt11align_val_tRKSt9nothrow_t:
1101 case LibFunc_msvc_delete_array_ptr32:
1103 case LibFunc_msvc_delete_array_ptr64:
1105 case LibFunc_msvc_delete_ptr32:
1107 case LibFunc_msvc_delete_ptr64:
1111 case LibFunc_ZdaPvRKSt9nothrow_t:
1113 case LibFunc_ZdaPvj:
1115 case LibFunc_ZdaPvm:
1117 case LibFunc_ZdlPvRKSt9nothrow_t:
1119 case LibFunc_ZdlPvj:
1121 case LibFunc_ZdlPvm:
1123 case LibFunc_ZdlPvSt11align_val_t:
1125 case LibFunc_ZdaPvSt11align_val_t:
1127 case LibFunc_msvc_delete_array_ptr32_int:
1129 case LibFunc_msvc_delete_array_ptr32_nothrow:
1131 case LibFunc_msvc_delete_array_ptr64_longlong:
1133 case LibFunc_msvc_delete_array_ptr64_nothrow:
1135 case LibFunc_msvc_delete_ptr32_int:
1137 case LibFunc_msvc_delete_ptr32_nothrow:
1139 case LibFunc_msvc_delete_ptr64_longlong:
1141 case LibFunc_msvc_delete_ptr64_nothrow:
1145 case LibFunc_ZdlPvSt11align_val_tRKSt9nothrow_t:
1147 case LibFunc_ZdaPvSt11align_val_tRKSt9nothrow_t:
1150 case LibFunc_memset_pattern16:
1151 return (!FTy.
isVarArg() && NumParams == 3 &&
1156 case LibFunc_cxa_guard_abort:
1157 case LibFunc_cxa_guard_acquire:
1158 case LibFunc_cxa_guard_release:
1159 case LibFunc_nvvm_reflect:
1162 case LibFunc_sincospi_stret:
1163 case LibFunc_sincospif_stret:
1167 case LibFunc_acos_finite:
1169 case LibFunc_acosf_finite:
1171 case LibFunc_acosh_finite:
1172 case LibFunc_acoshf:
1173 case LibFunc_acoshf_finite:
1174 case LibFunc_acoshl:
1175 case LibFunc_acoshl_finite:
1177 case LibFunc_acosl_finite:
1179 case LibFunc_asin_finite:
1181 case LibFunc_asinf_finite:
1183 case LibFunc_asinhf:
1184 case LibFunc_asinhl:
1186 case LibFunc_asinl_finite:
1190 case LibFunc_atanh_finite:
1191 case LibFunc_atanhf:
1192 case LibFunc_atanhf_finite:
1193 case LibFunc_atanhl:
1194 case LibFunc_atanhl_finite:
1205 case LibFunc_cosh_finite:
1207 case LibFunc_coshf_finite:
1209 case LibFunc_coshl_finite:
1212 case LibFunc_exp10_finite:
1213 case LibFunc_exp10f:
1214 case LibFunc_exp10f_finite:
1215 case LibFunc_exp10l:
1216 case LibFunc_exp10l_finite:
1218 case LibFunc_exp2_finite:
1220 case LibFunc_exp2f_finite:
1222 case LibFunc_exp2l_finite:
1224 case LibFunc_exp_finite:
1226 case LibFunc_expf_finite:
1228 case LibFunc_expl_finite:
1230 case LibFunc_expm1f:
1231 case LibFunc_expm1l:
1236 case LibFunc_floorf:
1237 case LibFunc_floorl:
1239 case LibFunc_log10_finite:
1240 case LibFunc_log10f:
1241 case LibFunc_log10f_finite:
1242 case LibFunc_log10l:
1243 case LibFunc_log10l_finite:
1245 case LibFunc_log1pf:
1246 case LibFunc_log1pl:
1248 case LibFunc_log2_finite:
1250 case LibFunc_log2f_finite:
1252 case LibFunc_log2l_finite:
1254 case LibFunc_log_finite:
1259 case LibFunc_logf_finite:
1261 case LibFunc_logl_finite:
1262 case LibFunc_nearbyint:
1263 case LibFunc_nearbyintf:
1264 case LibFunc_nearbyintl:
1269 case LibFunc_roundf:
1270 case LibFunc_roundl:
1274 case LibFunc_sinh_finite:
1276 case LibFunc_sinhf_finite:
1278 case LibFunc_sinhl_finite:
1281 case LibFunc_sqrt_finite:
1283 case LibFunc_sqrtf_finite:
1285 case LibFunc_sqrtl_finite:
1293 case LibFunc_truncf:
1294 case LibFunc_truncl:
1299 case LibFunc_atan2_finite:
1300 case LibFunc_atan2f:
1301 case LibFunc_atan2f_finite:
1302 case LibFunc_atan2l:
1303 case LibFunc_atan2l_finite:
1313 case LibFunc_copysign:
1314 case LibFunc_copysignf:
1315 case LibFunc_copysignl:
1317 case LibFunc_pow_finite:
1319 case LibFunc_powf_finite:
1321 case LibFunc_powl_finite:
1327 case LibFunc_ldexpf:
1328 case LibFunc_ldexpl:
1342 case LibFunc_isdigit:
1343 case LibFunc_isascii:
1344 case LibFunc_toascii:
1345 case LibFunc_putchar:
1346 case LibFunc_putchar_unlocked:
1356 case LibFunc_cxa_atexit:
1367 case LibFunc_sinpif:
1368 case LibFunc_cospif:
1372 case LibFunc_strnlen:
1377 case LibFunc_posix_memalign:
1382 case LibFunc_wcslen:
1388 case LibFunc_cabsl: {
1400 else if (NumParams == 2)
1421 memset(AvailableArray, 0,
sizeof(AvailableArray));
1441 VectorDescs.insert(VectorDescs.end(), Fns.
begin(), Fns.
end());
1444 ScalarDescs.insert(ScalarDescs.end(), Fns.
begin(), Fns.
end());
1454 {
"ceilf",
"vceilf", 4},
1455 {
"fabsf",
"vfabsf", 4},
1456 {
"llvm.fabs.f32",
"vfabsf", 4},
1457 {
"floorf",
"vfloorf", 4},
1458 {
"sqrtf",
"vsqrtf", 4},
1459 {
"llvm.sqrt.f32",
"vsqrtf", 4},
1462 {
"expf",
"vexpf", 4},
1463 {
"llvm.exp.f32",
"vexpf", 4},
1464 {
"expm1f",
"vexpm1f", 4},
1465 {
"logf",
"vlogf", 4},
1466 {
"llvm.log.f32",
"vlogf", 4},
1467 {
"log1pf",
"vlog1pf", 4},
1468 {
"log10f",
"vlog10f", 4},
1469 {
"llvm.log10.f32",
"vlog10f", 4},
1470 {
"logbf",
"vlogbf", 4},
1473 {
"sinf",
"vsinf", 4},
1474 {
"llvm.sin.f32",
"vsinf", 4},
1475 {
"cosf",
"vcosf", 4},
1476 {
"llvm.cos.f32",
"vcosf", 4},
1477 {
"tanf",
"vtanf", 4},
1478 {
"asinf",
"vasinf", 4},
1479 {
"acosf",
"vacosf", 4},
1480 {
"atanf",
"vatanf", 4},
1483 {
"sinhf",
"vsinhf", 4},
1484 {
"coshf",
"vcoshf", 4},
1485 {
"tanhf",
"vtanhf", 4},
1486 {
"asinhf",
"vasinhf", 4},
1487 {
"acoshf",
"vacoshf", 4},
1488 {
"atanhf",
"vatanhf", 4},
1495 {
"sin",
"__svml_sin2", 2},
1496 {
"sin",
"__svml_sin4", 4},
1497 {
"sin",
"__svml_sin8", 8},
1499 {
"sinf",
"__svml_sinf4", 4},
1500 {
"sinf",
"__svml_sinf8", 8},
1501 {
"sinf",
"__svml_sinf16", 16},
1503 {
"llvm.sin.f64",
"__svml_sin2", 2},
1504 {
"llvm.sin.f64",
"__svml_sin4", 4},
1505 {
"llvm.sin.f64",
"__svml_sin8", 8},
1507 {
"llvm.sin.f32",
"__svml_sinf4", 4},
1508 {
"llvm.sin.f32",
"__svml_sinf8", 8},
1509 {
"llvm.sin.f32",
"__svml_sinf16", 16},
1511 {
"cos",
"__svml_cos2", 2},
1512 {
"cos",
"__svml_cos4", 4},
1513 {
"cos",
"__svml_cos8", 8},
1515 {
"cosf",
"__svml_cosf4", 4},
1516 {
"cosf",
"__svml_cosf8", 8},
1517 {
"cosf",
"__svml_cosf16", 16},
1519 {
"llvm.cos.f64",
"__svml_cos2", 2},
1520 {
"llvm.cos.f64",
"__svml_cos4", 4},
1521 {
"llvm.cos.f64",
"__svml_cos8", 8},
1523 {
"llvm.cos.f32",
"__svml_cosf4", 4},
1524 {
"llvm.cos.f32",
"__svml_cosf8", 8},
1525 {
"llvm.cos.f32",
"__svml_cosf16", 16},
1527 {
"pow",
"__svml_pow2", 2},
1528 {
"pow",
"__svml_pow4", 4},
1529 {
"pow",
"__svml_pow8", 8},
1531 {
"powf",
"__svml_powf4", 4},
1532 {
"powf",
"__svml_powf8", 8},
1533 {
"powf",
"__svml_powf16", 16},
1535 {
"__pow_finite",
"__svml_pow2", 2 },
1536 {
"__pow_finite",
"__svml_pow4", 4 },
1537 {
"__pow_finite",
"__svml_pow8", 8 },
1539 {
"__powf_finite",
"__svml_powf4", 4 },
1540 {
"__powf_finite",
"__svml_powf8", 8 },
1541 {
"__powf_finite",
"__svml_powf16", 16 },
1543 {
"llvm.pow.f64",
"__svml_pow2", 2},
1544 {
"llvm.pow.f64",
"__svml_pow4", 4},
1545 {
"llvm.pow.f64",
"__svml_pow8", 8},
1547 {
"llvm.pow.f32",
"__svml_powf4", 4},
1548 {
"llvm.pow.f32",
"__svml_powf8", 8},
1549 {
"llvm.pow.f32",
"__svml_powf16", 16},
1551 {
"exp",
"__svml_exp2", 2},
1552 {
"exp",
"__svml_exp4", 4},
1553 {
"exp",
"__svml_exp8", 8},
1555 {
"expf",
"__svml_expf4", 4},
1556 {
"expf",
"__svml_expf8", 8},
1557 {
"expf",
"__svml_expf16", 16},
1559 {
"__exp_finite",
"__svml_exp2", 2 },
1560 {
"__exp_finite",
"__svml_exp4", 4 },
1561 {
"__exp_finite",
"__svml_exp8", 8 },
1563 {
"__expf_finite",
"__svml_expf4", 4 },
1564 {
"__expf_finite",
"__svml_expf8", 8 },
1565 {
"__expf_finite",
"__svml_expf16", 16 },
1567 {
"llvm.exp.f64",
"__svml_exp2", 2},
1568 {
"llvm.exp.f64",
"__svml_exp4", 4},
1569 {
"llvm.exp.f64",
"__svml_exp8", 8},
1571 {
"llvm.exp.f32",
"__svml_expf4", 4},
1572 {
"llvm.exp.f32",
"__svml_expf8", 8},
1573 {
"llvm.exp.f32",
"__svml_expf16", 16},
1575 {
"log",
"__svml_log2", 2},
1576 {
"log",
"__svml_log4", 4},
1577 {
"log",
"__svml_log8", 8},
1579 {
"logf",
"__svml_logf4", 4},
1580 {
"logf",
"__svml_logf8", 8},
1581 {
"logf",
"__svml_logf16", 16},
1583 {
"__log_finite",
"__svml_log2", 2 },
1584 {
"__log_finite",
"__svml_log4", 4 },
1585 {
"__log_finite",
"__svml_log8", 8 },
1587 {
"__logf_finite",
"__svml_logf4", 4 },
1588 {
"__logf_finite",
"__svml_logf8", 8 },
1589 {
"__logf_finite",
"__svml_logf16", 16 },
1591 {
"llvm.log.f64",
"__svml_log2", 2},
1592 {
"llvm.log.f64",
"__svml_log4", 4},
1593 {
"llvm.log.f64",
"__svml_log8", 8},
1595 {
"llvm.log.f32",
"__svml_logf4", 4},
1596 {
"llvm.log.f32",
"__svml_logf8", 8},
1597 {
"llvm.log.f32",
"__svml_logf16", 16},
1609 if (funcName.
empty())
1613 VectorDescs.begin(), VectorDescs.end(), funcName,
1615 return I != VectorDescs.end() &&
StringRef(I->ScalarFnName) == funcName;
1619 unsigned VF)
const {
1625 while (I != VectorDescs.end() &&
StringRef(I->ScalarFnName) ==
F) {
1626 if (I->VectorizationFactor == VF)
1627 return I->VectorFnName;
1634 unsigned &VF)
const {
1641 if (I == VectorDescs.end() ||
StringRef(I->VectorFnName) !=
F)
1643 VF = I->VectorizationFactor;
1644 return I->ScalarFnName;
1665 std::unique_ptr<TargetLibraryInfoImpl> &Impl =
1674 if (
auto *ShortWChar = cast_or_null<ConstantAsMetadata>(
1676 return cast<ConstantInt>(ShortWChar->getValue())->getZExtValue();
1700 "Target Library Information",
false,
true)
1703 void TargetLibraryInfoWrapperPass::anchor() {}
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
A parsed version of the target data layout string in and methods for querying it. ...
const_iterator end(StringRef path)
Get end iterator over path.
const std::string & getTargetTriple() const
Get the target triple which is a string describing the target host.
static bool compareByVectorFnName(const VecDesc &LHS, const VecDesc &RHS)
static std::string normalize(StringRef Str)
normalize - Turn an arbitrary machine specification into the canonical triple form (or something sens...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
This class represents lattice values for constants.
bool isMacOSX() const
isMacOSX - Is this a Mac OS X triple.
Type * getParamType(unsigned i) const
Parameter type accessors.
void setShouldExtI32Return(bool Val)
Set to true iff i32 results from library functions should have signext or zeroext attributes if they ...
void addVectorizableFunctions(ArrayRef< VecDesc > Fns)
Add a set of scalar -> vector mappings, queryable via getVectorizedFunction and getScalarizedFunction...
A Module instance is used to store all the information related to an LLVM module. ...
static StringRef sanitizeFunctionName(StringRef funcName)
VectorLibrary
List of known vector-functions libraries.
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
void initializeTargetLibraryInfoWrapperPassPass(PassRegistry &)
void setShouldExtI32Param(bool Val)
Set to true iff i32 parameters to library functions should have signext or zeroext attributes if they...
void disableAllFunctions()
Disables all builtins.
TargetLibraryInfoWrapperPass()
bool isWatchOS() const
Is this an Apple watchOS triple.
Implementation of the target library information.
void getEnvironmentVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
Parse the version number from the OS name component of the triple, if present.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
bool isFloatingPointTy() const
Return true if this is one of the six floating-point types.
uint64_t getArrayNumElements() const
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
bool isIntegerTy() const
True if this is an instance of IntegerType.
friend class TargetLibraryInfo
Class to represent function types.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
bool getLibFunc(StringRef funcName, LibFunc &F) const
Searches for a particular function name.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
auto lower_bound(R &&Range, ForwardIt I) -> decltype(adl_begin(Range))
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
bool isiOS() const
Is this an iOS triple.
void setShouldSignExtI32Param(bool Val)
Set to true iff i32 parameters to library functions should have signext attribute if they correspond ...
TargetLibraryInfo run(Module &M, ModuleAnalysisManager &)
void setUnavailable(LibFunc F)
Forces a function to be marked as unavailable.
bool isOSWindows() const
Tests whether the OS is Windows.
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
StringRef getScalarizedFunction(StringRef F, unsigned &VF) const
Return the name of the equivalent of F, scalarized.
bool isMusl() const
Tests whether the environment is musl-libc.
initializer< Ty > init(const Ty &Val)
bool isFunctionVectorizable(StringRef F, unsigned VF) const
Return true if the function F has a vector equivalent with vectorization factor VF.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
Metadata * getModuleFlag(StringRef Key) const
Return the corresponding value if Key appears in module flags, otherwise return null.
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool isPointerTy() const
True if this is an instance of PointerType.
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
static bool compareByScalarFnName(const VecDesc &LHS, const VecDesc &RHS)
bool isAndroidVersionLT(unsigned Major) const
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
void sort(IteratorTy Start, IteratorTy End)
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::SVML, "SVML", "Intel SVML library")))
static bool hasSinCosPiStret(const Triple &T)
ImmutablePass class - This class is used to provide information that does not need to be run...
Describes a possible vectorization of a function.
Provides information about what library functions are available for the current target.
StringRef getVectorizedFunction(StringRef F, unsigned VF) const
Return the name of the equivalent of F, vectorized with factor VF.
bool isOSLinux() const
Tests whether the OS is Linux.
TargetLibraryInfoImpl & operator=(const TargetLibraryInfoImpl &TLI)
Type * getReturnType() const
FunctionType * getFunctionType() const
Returns the FunctionType for me.
void addVectorizableFunctionsFromVecLib(enum VectorLibrary VecLib)
Calls addVectorizableFunctions with a known preset of functions for the given vector library...
static StringRef dropLLVMManglingEscape(StringRef Name)
If the given string begins with the GlobalValue name mangling escape character '\1', drop it.
bool isMIPS() const
Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringRef > StandardNames)
Initialize the set of available library functions based on the specified target triple.
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
StringRef getName() const
Return a constant reference to the value's name.
static bool compareWithVectorFnName(const VecDesc &LHS, StringRef S)
bool isGNUEnvironment() const
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles suppor...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
void setAvailableWithName(LibFunc F, StringRef Name)
Forces a function to be marked as available and provide an alternate name that must be used...
bool isAndroid() const
Tests whether the target is Android.
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
StringRef - Represent a constant reference to a string, i.e.
A container for analyses that lazily runs them and caches their results.
bool isOSVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isOSVersionLT - Helper function for doing comparisons against version numbers included in the target ...
Type * getArrayElementType() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.
void setAvailable(LibFunc F)
Forces a function to be marked as available.
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
unsigned getWCharSize(const Module &M) const
Returns the size of the wchar_t type in bytes or 0 if the size is unknown.
A special type used by analysis passes to provide an address that identifies that particular analysis...
static bool compareWithScalarFnName(const VecDesc &LHS, StringRef S)
bool isArrayTy() const
True if this is an instance of ArrayType.