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()) {
522 memset(AvailableArray, -1,
sizeof(AvailableArray));
529 memset(AvailableArray, -1,
sizeof(AvailableArray));
535 : CustomNames(TLI.CustomNames), ShouldExtI32Param(TLI.ShouldExtI32Param),
536 ShouldExtI32Return(TLI.ShouldExtI32Return),
537 ShouldSignExtI32Param(TLI.ShouldSignExtI32Param) {
538 memcpy(AvailableArray, TLI.AvailableArray,
sizeof(AvailableArray));
539 VectorDescs = TLI.VectorDescs;
540 ScalarDescs = TLI.ScalarDescs;
544 : CustomNames(
std::move(TLI.CustomNames)),
545 ShouldExtI32Param(TLI.ShouldExtI32Param),
546 ShouldExtI32Return(TLI.ShouldExtI32Return),
547 ShouldSignExtI32Param(TLI.ShouldSignExtI32Param) {
550 VectorDescs = TLI.VectorDescs;
551 ScalarDescs = TLI.ScalarDescs;
555 CustomNames = TLI.CustomNames;
556 ShouldExtI32Param = TLI.ShouldExtI32Param;
557 ShouldExtI32Return = TLI.ShouldExtI32Return;
558 ShouldSignExtI32Param = TLI.ShouldSignExtI32Param;
559 memcpy(AvailableArray, TLI.AvailableArray,
sizeof(AvailableArray));
564 CustomNames = std::move(TLI.CustomNames);
565 ShouldExtI32Param = TLI.ShouldExtI32Param;
566 ShouldExtI32Return = TLI.ShouldExtI32Return;
567 ShouldSignExtI32Param = TLI.ShouldSignExtI32Param;
586 StringRef const *Start = &StandardNames[0];
590 if (funcName.
empty())
597 if (I != End && *I == funcName) {
604 bool TargetLibraryInfoImpl::isValidProtoForLibFunc(
const FunctionType &FTy,
610 auto IsSizeTTy = [SizeTTy](
Type *Ty) {
611 return SizeTTy ? Ty == SizeTTy : Ty->
isIntegerTy();
621 case LibFunc_strrchr:
629 case LibFunc_strtoul:
630 case LibFunc_strtoll:
631 case LibFunc_strtold:
632 case LibFunc_strtoull:
633 return ((NumParams == 2 || NumParams == 3) &&
641 case LibFunc_strncat:
647 case LibFunc_strcpy_chk:
648 case LibFunc_stpcpy_chk:
659 case LibFunc_strncpy_chk:
660 case LibFunc_stpncpy_chk:
665 case LibFunc_strncpy:
666 case LibFunc_stpncpy:
672 case LibFunc_strxfrm:
681 case LibFunc_strncmp:
688 case LibFunc_strcspn:
693 case LibFunc_strcoll:
694 case LibFunc_strcasecmp:
695 case LibFunc_strncasecmp:
704 case LibFunc_strpbrk:
710 case LibFunc_strtok_r:
714 case LibFunc_setvbuf:
717 case LibFunc_strndup:
722 case LibFunc_statvfs:
723 case LibFunc_siprintf:
724 case LibFunc_sprintf:
728 case LibFunc_snprintf:
732 case LibFunc_setitimer:
745 case LibFunc_memrchr:
755 case LibFunc_memcpy_chk:
756 case LibFunc_memmove_chk:
762 case LibFunc_mempcpy:
763 case LibFunc_memmove:
769 case LibFunc_memset_chk:
780 case LibFunc_memccpy:
782 case LibFunc_memalign:
784 case LibFunc_realloc:
785 case LibFunc_reallocf:
794 case LibFunc_realpath:
799 case LibFunc_readlink:
819 case LibFunc_getpwnam:
820 case LibFunc_iprintf:
826 case LibFunc_under_IO_getc:
828 case LibFunc_unsetenv:
834 case LibFunc_clearerr:
835 case LibFunc_closedir:
836 case LibFunc_ctermid:
841 case LibFunc_fgetc_unlocked:
843 case LibFunc_flockfile:
846 case LibFunc_fseeko64:
848 case LibFunc_fsetpos:
850 case LibFunc_ftello64:
852 case LibFunc_ftrylockfile:
853 case LibFunc_funlockfile:
855 case LibFunc_getc_unlocked:
856 case LibFunc_getlogin_r:
870 case LibFunc_fputc_unlocked:
875 case LibFunc_fstatvfs:
878 case LibFunc_fgets_unlocked:
882 case LibFunc_fread_unlocked:
886 case LibFunc_fwrite_unlocked:
893 case LibFunc_fputs_unlocked:
897 case LibFunc_fiprintf:
898 case LibFunc_fprintf:
902 case LibFunc_fgetpos:
905 case LibFunc_getchar:
906 case LibFunc_getchar_unlocked:
909 return (NumParams == 1 && FTy.
getParamType(0) == PCharTy);
910 case LibFunc_getitimer:
919 case LibFunc_putc_unlocked:
930 case LibFunc_vsscanf:
933 case LibFunc_vfscanf:
938 case LibFunc_vprintf:
940 case LibFunc_vfprintf:
941 case LibFunc_vsprintf:
944 case LibFunc_vsnprintf:
949 case LibFunc_opendir:
952 case LibFunc_tmpfile:
969 case LibFunc_dunder_strdup:
970 case LibFunc_dunder_strndup:
973 case LibFunc_dunder_strtok_r:
975 case LibFunc_under_IO_putc:
977 case LibFunc_dunder_isoc99_scanf:
980 case LibFunc_lstat64:
981 case LibFunc_statvfs64:
984 case LibFunc_dunder_isoc99_sscanf:
987 case LibFunc_fopen64:
991 case LibFunc_tmpfile64:
993 case LibFunc_fstat64:
994 case LibFunc_fstatvfs64:
998 case LibFunc_gettimeofday:
1011 case LibFunc_msvc_new_int:
1013 case LibFunc_msvc_new_longlong:
1015 case LibFunc_msvc_new_array_int:
1017 case LibFunc_msvc_new_array_longlong:
1021 case LibFunc_ZnwjRKSt9nothrow_t:
1023 case LibFunc_ZnwmRKSt9nothrow_t:
1025 case LibFunc_ZnajRKSt9nothrow_t:
1027 case LibFunc_ZnamRKSt9nothrow_t:
1029 case LibFunc_msvc_new_int_nothrow:
1031 case LibFunc_msvc_new_longlong_nothrow:
1033 case LibFunc_msvc_new_array_int_nothrow:
1035 case LibFunc_msvc_new_array_longlong_nothrow:
1037 case LibFunc_ZnwjSt11align_val_t:
1039 case LibFunc_ZnwmSt11align_val_t:
1041 case LibFunc_ZnajSt11align_val_t:
1043 case LibFunc_ZnamSt11align_val_t:
1047 case LibFunc_ZnwjSt11align_val_tRKSt9nothrow_t:
1049 case LibFunc_ZnwmSt11align_val_tRKSt9nothrow_t:
1051 case LibFunc_ZnajSt11align_val_tRKSt9nothrow_t:
1053 case LibFunc_ZnamSt11align_val_tRKSt9nothrow_t:
1061 case LibFunc_msvc_delete_array_ptr32:
1063 case LibFunc_msvc_delete_array_ptr64:
1065 case LibFunc_msvc_delete_ptr32:
1067 case LibFunc_msvc_delete_ptr64:
1071 case LibFunc_ZdaPvRKSt9nothrow_t:
1073 case LibFunc_ZdaPvj:
1075 case LibFunc_ZdaPvm:
1077 case LibFunc_ZdlPvRKSt9nothrow_t:
1079 case LibFunc_ZdlPvj:
1081 case LibFunc_ZdlPvm:
1083 case LibFunc_ZdlPvSt11align_val_t:
1085 case LibFunc_ZdaPvSt11align_val_t:
1087 case LibFunc_msvc_delete_array_ptr32_int:
1089 case LibFunc_msvc_delete_array_ptr32_nothrow:
1091 case LibFunc_msvc_delete_array_ptr64_longlong:
1093 case LibFunc_msvc_delete_array_ptr64_nothrow:
1095 case LibFunc_msvc_delete_ptr32_int:
1097 case LibFunc_msvc_delete_ptr32_nothrow:
1099 case LibFunc_msvc_delete_ptr64_longlong:
1101 case LibFunc_msvc_delete_ptr64_nothrow:
1105 case LibFunc_ZdlPvSt11align_val_tRKSt9nothrow_t:
1107 case LibFunc_ZdaPvSt11align_val_tRKSt9nothrow_t:
1110 case LibFunc_memset_pattern16:
1111 return (!FTy.
isVarArg() && NumParams == 3 &&
1116 case LibFunc_cxa_guard_abort:
1117 case LibFunc_cxa_guard_acquire:
1118 case LibFunc_cxa_guard_release:
1119 case LibFunc_nvvm_reflect:
1122 case LibFunc_sincospi_stret:
1123 case LibFunc_sincospif_stret:
1127 case LibFunc_acos_finite:
1129 case LibFunc_acosf_finite:
1131 case LibFunc_acosh_finite:
1132 case LibFunc_acoshf:
1133 case LibFunc_acoshf_finite:
1134 case LibFunc_acoshl:
1135 case LibFunc_acoshl_finite:
1137 case LibFunc_acosl_finite:
1139 case LibFunc_asin_finite:
1141 case LibFunc_asinf_finite:
1143 case LibFunc_asinhf:
1144 case LibFunc_asinhl:
1146 case LibFunc_asinl_finite:
1150 case LibFunc_atanh_finite:
1151 case LibFunc_atanhf:
1152 case LibFunc_atanhf_finite:
1153 case LibFunc_atanhl:
1154 case LibFunc_atanhl_finite:
1165 case LibFunc_cosh_finite:
1167 case LibFunc_coshf_finite:
1169 case LibFunc_coshl_finite:
1172 case LibFunc_exp10_finite:
1173 case LibFunc_exp10f:
1174 case LibFunc_exp10f_finite:
1175 case LibFunc_exp10l:
1176 case LibFunc_exp10l_finite:
1178 case LibFunc_exp2_finite:
1180 case LibFunc_exp2f_finite:
1182 case LibFunc_exp2l_finite:
1184 case LibFunc_exp_finite:
1186 case LibFunc_expf_finite:
1188 case LibFunc_expl_finite:
1190 case LibFunc_expm1f:
1191 case LibFunc_expm1l:
1196 case LibFunc_floorf:
1197 case LibFunc_floorl:
1199 case LibFunc_log10_finite:
1200 case LibFunc_log10f:
1201 case LibFunc_log10f_finite:
1202 case LibFunc_log10l:
1203 case LibFunc_log10l_finite:
1205 case LibFunc_log1pf:
1206 case LibFunc_log1pl:
1208 case LibFunc_log2_finite:
1210 case LibFunc_log2f_finite:
1212 case LibFunc_log2l_finite:
1214 case LibFunc_log_finite:
1219 case LibFunc_logf_finite:
1221 case LibFunc_logl_finite:
1222 case LibFunc_nearbyint:
1223 case LibFunc_nearbyintf:
1224 case LibFunc_nearbyintl:
1229 case LibFunc_roundf:
1230 case LibFunc_roundl:
1234 case LibFunc_sinh_finite:
1236 case LibFunc_sinhf_finite:
1238 case LibFunc_sinhl_finite:
1241 case LibFunc_sqrt_finite:
1243 case LibFunc_sqrtf_finite:
1245 case LibFunc_sqrtl_finite:
1253 case LibFunc_truncf:
1254 case LibFunc_truncl:
1259 case LibFunc_atan2_finite:
1260 case LibFunc_atan2f:
1261 case LibFunc_atan2f_finite:
1262 case LibFunc_atan2l:
1263 case LibFunc_atan2l_finite:
1273 case LibFunc_copysign:
1274 case LibFunc_copysignf:
1275 case LibFunc_copysignl:
1277 case LibFunc_pow_finite:
1279 case LibFunc_powf_finite:
1281 case LibFunc_powl_finite:
1287 case LibFunc_ldexpf:
1288 case LibFunc_ldexpl:
1302 case LibFunc_isdigit:
1303 case LibFunc_isascii:
1304 case LibFunc_toascii:
1305 case LibFunc_putchar:
1306 case LibFunc_putchar_unlocked:
1316 case LibFunc_cxa_atexit:
1327 case LibFunc_sinpif:
1328 case LibFunc_cospif:
1332 case LibFunc_strnlen:
1337 case LibFunc_posix_memalign:
1342 case LibFunc_wcslen:
1348 case LibFunc_cabsl: {
1360 else if (NumParams == 2)
1381 memset(AvailableArray, 0,
sizeof(AvailableArray));
1401 VectorDescs.insert(VectorDescs.end(), Fns.
begin(), Fns.
end());
1404 ScalarDescs.insert(ScalarDescs.end(), Fns.
begin(), Fns.
end());
1414 {
"ceilf",
"vceilf", 4},
1415 {
"fabsf",
"vfabsf", 4},
1416 {
"llvm.fabs.f32",
"vfabsf", 4},
1417 {
"floorf",
"vfloorf", 4},
1418 {
"sqrtf",
"vsqrtf", 4},
1419 {
"llvm.sqrt.f32",
"vsqrtf", 4},
1422 {
"expf",
"vexpf", 4},
1423 {
"llvm.exp.f32",
"vexpf", 4},
1424 {
"expm1f",
"vexpm1f", 4},
1425 {
"logf",
"vlogf", 4},
1426 {
"llvm.log.f32",
"vlogf", 4},
1427 {
"log1pf",
"vlog1pf", 4},
1428 {
"log10f",
"vlog10f", 4},
1429 {
"llvm.log10.f32",
"vlog10f", 4},
1430 {
"logbf",
"vlogbf", 4},
1433 {
"sinf",
"vsinf", 4},
1434 {
"llvm.sin.f32",
"vsinf", 4},
1435 {
"cosf",
"vcosf", 4},
1436 {
"llvm.cos.f32",
"vcosf", 4},
1437 {
"tanf",
"vtanf", 4},
1438 {
"asinf",
"vasinf", 4},
1439 {
"acosf",
"vacosf", 4},
1440 {
"atanf",
"vatanf", 4},
1443 {
"sinhf",
"vsinhf", 4},
1444 {
"coshf",
"vcoshf", 4},
1445 {
"tanhf",
"vtanhf", 4},
1446 {
"asinhf",
"vasinhf", 4},
1447 {
"acoshf",
"vacoshf", 4},
1448 {
"atanhf",
"vatanhf", 4},
1455 {
"sin",
"__svml_sin2", 2},
1456 {
"sin",
"__svml_sin4", 4},
1457 {
"sin",
"__svml_sin8", 8},
1459 {
"sinf",
"__svml_sinf4", 4},
1460 {
"sinf",
"__svml_sinf8", 8},
1461 {
"sinf",
"__svml_sinf16", 16},
1463 {
"llvm.sin.f64",
"__svml_sin2", 2},
1464 {
"llvm.sin.f64",
"__svml_sin4", 4},
1465 {
"llvm.sin.f64",
"__svml_sin8", 8},
1467 {
"llvm.sin.f32",
"__svml_sinf4", 4},
1468 {
"llvm.sin.f32",
"__svml_sinf8", 8},
1469 {
"llvm.sin.f32",
"__svml_sinf16", 16},
1471 {
"cos",
"__svml_cos2", 2},
1472 {
"cos",
"__svml_cos4", 4},
1473 {
"cos",
"__svml_cos8", 8},
1475 {
"cosf",
"__svml_cosf4", 4},
1476 {
"cosf",
"__svml_cosf8", 8},
1477 {
"cosf",
"__svml_cosf16", 16},
1479 {
"llvm.cos.f64",
"__svml_cos2", 2},
1480 {
"llvm.cos.f64",
"__svml_cos4", 4},
1481 {
"llvm.cos.f64",
"__svml_cos8", 8},
1483 {
"llvm.cos.f32",
"__svml_cosf4", 4},
1484 {
"llvm.cos.f32",
"__svml_cosf8", 8},
1485 {
"llvm.cos.f32",
"__svml_cosf16", 16},
1487 {
"pow",
"__svml_pow2", 2},
1488 {
"pow",
"__svml_pow4", 4},
1489 {
"pow",
"__svml_pow8", 8},
1491 {
"powf",
"__svml_powf4", 4},
1492 {
"powf",
"__svml_powf8", 8},
1493 {
"powf",
"__svml_powf16", 16},
1495 {
"__pow_finite",
"__svml_pow2", 2 },
1496 {
"__pow_finite",
"__svml_pow4", 4 },
1497 {
"__pow_finite",
"__svml_pow8", 8 },
1499 {
"__powf_finite",
"__svml_powf4", 4 },
1500 {
"__powf_finite",
"__svml_powf8", 8 },
1501 {
"__powf_finite",
"__svml_powf16", 16 },
1503 {
"llvm.pow.f64",
"__svml_pow2", 2},
1504 {
"llvm.pow.f64",
"__svml_pow4", 4},
1505 {
"llvm.pow.f64",
"__svml_pow8", 8},
1507 {
"llvm.pow.f32",
"__svml_powf4", 4},
1508 {
"llvm.pow.f32",
"__svml_powf8", 8},
1509 {
"llvm.pow.f32",
"__svml_powf16", 16},
1511 {
"exp",
"__svml_exp2", 2},
1512 {
"exp",
"__svml_exp4", 4},
1513 {
"exp",
"__svml_exp8", 8},
1515 {
"expf",
"__svml_expf4", 4},
1516 {
"expf",
"__svml_expf8", 8},
1517 {
"expf",
"__svml_expf16", 16},
1519 {
"__exp_finite",
"__svml_exp2", 2 },
1520 {
"__exp_finite",
"__svml_exp4", 4 },
1521 {
"__exp_finite",
"__svml_exp8", 8 },
1523 {
"__expf_finite",
"__svml_expf4", 4 },
1524 {
"__expf_finite",
"__svml_expf8", 8 },
1525 {
"__expf_finite",
"__svml_expf16", 16 },
1527 {
"llvm.exp.f64",
"__svml_exp2", 2},
1528 {
"llvm.exp.f64",
"__svml_exp4", 4},
1529 {
"llvm.exp.f64",
"__svml_exp8", 8},
1531 {
"llvm.exp.f32",
"__svml_expf4", 4},
1532 {
"llvm.exp.f32",
"__svml_expf8", 8},
1533 {
"llvm.exp.f32",
"__svml_expf16", 16},
1535 {
"log",
"__svml_log2", 2},
1536 {
"log",
"__svml_log4", 4},
1537 {
"log",
"__svml_log8", 8},
1539 {
"logf",
"__svml_logf4", 4},
1540 {
"logf",
"__svml_logf8", 8},
1541 {
"logf",
"__svml_logf16", 16},
1543 {
"__log_finite",
"__svml_log2", 2 },
1544 {
"__log_finite",
"__svml_log4", 4 },
1545 {
"__log_finite",
"__svml_log8", 8 },
1547 {
"__logf_finite",
"__svml_logf4", 4 },
1548 {
"__logf_finite",
"__svml_logf8", 8 },
1549 {
"__logf_finite",
"__svml_logf16", 16 },
1551 {
"llvm.log.f64",
"__svml_log2", 2},
1552 {
"llvm.log.f64",
"__svml_log4", 4},
1553 {
"llvm.log.f64",
"__svml_log8", 8},
1555 {
"llvm.log.f32",
"__svml_logf4", 4},
1556 {
"llvm.log.f32",
"__svml_logf8", 8},
1557 {
"llvm.log.f32",
"__svml_logf16", 16},
1569 if (funcName.
empty())
1573 VectorDescs.begin(), VectorDescs.end(), funcName,
1575 return I != VectorDescs.end() &&
StringRef(I->ScalarFnName) == funcName;
1579 unsigned VF)
const {
1585 while (I != VectorDescs.end() &&
StringRef(I->ScalarFnName) ==
F) {
1586 if (I->VectorizationFactor == VF)
1587 return I->VectorFnName;
1594 unsigned &VF)
const {
1601 if (I == VectorDescs.end() ||
StringRef(I->VectorFnName) !=
F)
1603 VF = I->VectorizationFactor;
1604 return I->ScalarFnName;
1625 std::unique_ptr<TargetLibraryInfoImpl> &Impl =
1634 if (
auto *ShortWChar = cast_or_null<ConstantAsMetadata>(
1636 return cast<ConstantInt>(ShortWChar->getValue())->getZExtValue();
1660 "Target Library Information",
false,
true)
1663 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.
Compute iterated dominance frontiers using a linear time algorithm.
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.
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 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.
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).
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
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.