31 case amdgcn:
return "amdgcn";
33 case amdil:
return "amdil";
34 case arc:
return "arc";
35 case arm:
return "arm";
36 case armeb:
return "armeb";
37 case avr:
return "avr";
38 case bpfeb:
return "bpfeb";
39 case bpfel:
return "bpfel";
40 case csky:
return "csky";
41 case dxil:
return "dxil";
44 case hsail:
return "hsail";
46 case lanai:
return "lanai";
47 case le32:
return "le32";
48 case le64:
return "le64";
51 case m68k:
return "m68k";
52 case mips64:
return "mips64";
54 case mips:
return "mips";
55 case mipsel:
return "mipsel";
56 case msp430:
return "msp430";
58 case nvptx:
return "nvptx";
59 case ppc64:
return "powerpc64";
60 case ppc64le:
return "powerpc64le";
61 case ppc:
return "powerpc";
62 case ppcle:
return "powerpcle";
63 case r600:
return "r600";
68 case shave:
return "shave";
69 case sparc:
return "sparc";
72 case spir64:
return "spir64";
73 case spir:
return "spir";
74 case spirv:
return "spirv";
78 case tce:
return "tce";
79 case tcele:
return "tcele";
80 case thumb:
return "thumb";
83 case wasm32:
return "wasm32";
84 case wasm64:
return "wasm64";
85 case x86:
return "i386";
86 case x86_64:
return "x86_64";
87 case xcore:
return "xcore";
88 case xtensa:
return "xtensa";
102 return "mipsisa32r6el";
106 return "mipsisa64r6";
110 return "mipsisa64r6el";
133 case arc:
return "arc";
140 case avr:
return "avr";
145 case ppcle:
return "ppc";
147 case m68k:
return "m68k";
154 case hexagon:
return "hexagon";
156 case amdgcn:
return "amdgcn";
157 case r600:
return "r600";
160 case bpfeb:
return "bpf";
164 case sparc:
return "sparc";
169 case x86_64:
return "x86";
171 case xcore:
return "xcore";
174 case nvptx:
return "nvvm";
177 case le32:
return "le32";
178 case le64:
return "le64";
187 case spir64:
return "spir";
193 case kalimba:
return "kalimba";
194 case lanai:
return "lanai";
195 case shave:
return "shave";
197 case wasm64:
return "wasm";
202 case ve:
return "ve";
203 case csky:
return "csky";
208 case dxil:
return "dx";
210 case xtensa:
return "xtensa";
218 case AMD:
return "amd";
219 case Apple:
return "apple";
220 case CSR:
return "csr";
222 case IBM:
return "ibm";
224 case Mesa:
return "mesa";
226 case NVIDIA:
return "nvidia";
228 case PC:
return "pc";
229 case SCEI:
return "scei";
230 case SUSE:
return "suse";
240 case AIX:
return "aix";
241 case AMDHSA:
return "amdhsa";
242 case AMDPAL:
return "amdpal";
244 case CUDA:
return "cuda";
245 case Darwin:
return "darwin";
250 case FreeBSD:
return "freebsd";
251 case Fuchsia:
return "fuchsia";
252 case Haiku:
return "haiku";
254 case Hurd:
return "hurd";
255 case IOS:
return "ios";
257 case Linux:
return "linux";
258 case Lv2:
return "lv2";
259 case MacOSX:
return "macosx";
260 case Mesa3D:
return "mesa3d";
261 case NVCL:
return "nvcl";
262 case NaCl:
return "nacl";
263 case NetBSD:
return "netbsd";
264 case OpenBSD:
return "openbsd";
265 case PS4:
return "ps4";
266 case PS5:
return "ps5";
267 case RTEMS:
return "rtems";
268 case Solaris:
return "solaris";
270 case TvOS:
return "tvos";
271 case UEFI:
return "uefi";
272 case WASI:
return "wasi";
273 case WatchOS:
return "watchos";
274 case Win32:
return "windows";
275 case ZOS:
return "zos";
277 case LiteOS:
return "liteos";
278 case XROS:
return "xros";
279 case Vulkan:
return "vulkan";
288 case Android:
return "android";
289 case CODE16:
return "code16";
290 case CoreCLR:
return "coreclr";
291 case Cygnus:
return "cygnus";
292 case EABI:
return "eabi";
293 case EABIHF:
return "eabihf";
294 case GNU:
return "gnu";
297 case GNUEABI:
return "gnueabi";
299 case GNUF32:
return "gnuf32";
300 case GNUF64:
return "gnuf64";
301 case GNUSF:
return "gnusf";
302 case GNUX32:
return "gnux32";
304 case Itanium:
return "itanium";
305 case MSVC:
return "msvc";
306 case MacABI:
return "macabi";
307 case Musl:
return "musl";
310 case MuslX32:
return "muslx32";
312 case Pixel:
return "pixel";
313 case Vertex:
return "vertex";
315 case Hull:
return "hull";
316 case Domain:
return "domain";
317 case Compute:
return "compute";
318 case Library:
return "library";
321 case AnyHit:
return "anyhit";
323 case Miss:
return "miss";
325 case Mesh:
return "mesh";
338 case COFF:
return "coff";
339 case ELF:
return "elf";
340 case GOFF:
return "goff";
341 case MachO:
return "macho";
342 case Wasm:
return "wasm";
343 case XCOFF:
return "xcoff";
345 case SPIRV:
return "spirv";
351 if (ArchName.
equals(
"bpf")) {
356 }
else if (ArchName.
equals(
"bpf_be") || ArchName.
equals(
"bpfeb")) {
358 }
else if (ArchName.
equals(
"bpf_le") || ArchName.
equals(
"bpfel")) {
481 if (ArchName.
empty())
529 .
Cases(
"mips",
"mipseb",
"mipsallegrex",
"mipsisa32r6",
531 .
Cases(
"mipsel",
"mipsallegrexel",
"mipsisa32r6el",
"mipsr6el",
533 .
Cases(
"mips64",
"mips64eb",
"mipsn32",
"mipsisa64r6",
535 .
Cases(
"mips64el",
"mipsn32el",
"mipsisa64r6el",
"mips64r6el",
560 .
Cases(
"spirv32",
"spirv32v1.0",
"spirv32v1.1",
"spirv32v1.2",
562 .
Cases(
"spirv64",
"spirv64v1.0",
"spirv64v1.1",
"spirv64v1.2",
723 if (SubArchName ==
"powerpcspe")
726 if (SubArchName ==
"arm64e")
729 if (SubArchName ==
"arm64ec")
746 if (ARMSubArch.
empty())
755 case ARM::ArchKind::ARMV4:
757 case ARM::ArchKind::ARMV4T:
759 case ARM::ArchKind::ARMV5T:
761 case ARM::ArchKind::ARMV5TE:
762 case ARM::ArchKind::IWMMXT:
763 case ARM::ArchKind::IWMMXT2:
764 case ARM::ArchKind::XSCALE:
765 case ARM::ArchKind::ARMV5TEJ:
767 case ARM::ArchKind::ARMV6:
769 case ARM::ArchKind::ARMV6K:
770 case ARM::ArchKind::ARMV6KZ:
772 case ARM::ArchKind::ARMV6T2:
774 case ARM::ArchKind::ARMV6M:
776 case ARM::ArchKind::ARMV7A:
777 case ARM::ArchKind::ARMV7R:
779 case ARM::ArchKind::ARMV7VE:
781 case ARM::ArchKind::ARMV7K:
783 case ARM::ArchKind::ARMV7M:
785 case ARM::ArchKind::ARMV7S:
787 case ARM::ArchKind::ARMV7EM:
789 case ARM::ArchKind::ARMV8A:
791 case ARM::ArchKind::ARMV8_1A:
793 case ARM::ArchKind::ARMV8_2A:
795 case ARM::ArchKind::ARMV8_3A:
797 case ARM::ArchKind::ARMV8_4A:
799 case ARM::ArchKind::ARMV8_5A:
801 case ARM::ArchKind::ARMV8_6A:
803 case ARM::ArchKind::ARMV8_7A:
805 case ARM::ArchKind::ARMV8_8A:
807 case ARM::ArchKind::ARMV8_9A:
809 case ARM::ArchKind::ARMV9A:
811 case ARM::ArchKind::ARMV9_1A:
813 case ARM::ArchKind::ARMV9_2A:
815 case ARM::ArchKind::ARMV9_3A:
817 case ARM::ArchKind::ARMV9_4A:
819 case ARM::ArchKind::ARMV9_5A:
821 case ARM::ArchKind::ARMV8R:
823 case ARM::ArchKind::ARMV8MBaseline:
825 case ARM::ArchKind::ARMV8MMainline:
827 case ARM::ArchKind::ARMV8_1MMainline:
835 switch (
T.getArch()) {
931 :
Data(Str.str()), Arch(UnknownArch), SubArch(NoSubArch),
932 Vendor(UnknownVendor),
OS(UnknownOS), Environment(UnknownEnvironment),
933 ObjectFormat(UnknownObjectFormat) {
937 if (Components.
size() > 0) {
940 if (Components.
size() > 1) {
942 if (Components.
size() > 2) {
944 if (Components.
size() > 3) {
971 :
Data((ArchStr +
Twine(
'-') + VendorStr +
Twine(
'-') + OSStr).str()),
976 Environment(), ObjectFormat(
Triple::UnknownObjectFormat) {
986 const Twine &EnvironmentStr)
988 EnvironmentStr).str()),
1000 bool IsMinGW32 =
false;
1001 bool IsCygwin =
false;
1005 Str.split(Components,
'-');
1013 if (Components.
size() > 0)
1016 if (Components.
size() > 1)
1019 if (Components.
size() > 2) {
1021 IsCygwin = Components[2].starts_with(
"cygwin");
1022 IsMinGW32 = Components[2].starts_with(
"mingw");
1025 if (Components.
size() > 3)
1028 if (Components.
size() > 4)
1042 for (
unsigned Pos = 0; Pos != std::size(Found); ++Pos) {
1048 if (
Idx < std::size(Found) && Found[
Idx])
1094 for (
unsigned i = Pos; !CurrentComponent.
empty(); ++i) {
1096 while (i < std::size(Found) && Found[i])
1100 std::swap(CurrentComponent, Components[i]);
1102 }
else if (Pos >
Idx) {
1109 for (
unsigned i =
Idx; i < Components.
size();) {
1112 std::swap(CurrentComponent, Components[i]);
1114 if (CurrentComponent.
empty())
1117 while (++i < std::size(Found) && Found[i])
1121 if (!CurrentComponent.
empty())
1125 while (++
Idx < std::size(Found) && Found[
Idx])
1127 }
while (
Idx < Pos);
1129 assert(Pos < Components.
size() && Components[Pos] == Comp &&
1130 "Component moved wrong!");
1143 std::string NormalizedEnvironment;
1146 StringRef AndroidVersion = Components[3].drop_front(strlen(
"androideabi"));
1147 if (AndroidVersion.
empty()) {
1148 Components[3] =
"android";
1150 NormalizedEnvironment =
Twine(
"android", AndroidVersion).
str();
1151 Components[3] = NormalizedEnvironment;
1157 Components[3] =
"gnueabihf";
1161 Components[2] =
"windows";
1164 Components[3] =
"msvc";
1168 }
else if (IsMinGW32) {
1170 Components[2] =
"windows";
1171 Components[3] =
"gnu";
1172 }
else if (IsCygwin) {
1174 Components[2] =
"windows";
1175 Components[3] =
"cygnus";
1177 if (IsMinGW32 || IsCygwin ||
1186 return join(Components,
"-");
1195 return Tmp.
split(
'-').first;
1200 Tmp = Tmp.
split(
'-').second;
1201 return Tmp.
split(
'-').first;
1206 Tmp = Tmp.
split(
'-').second;
1207 return Tmp.
split(
'-').second;
1212 return Tmp.
split(
'-').second;
1217 Version.tryParse(
Name);
1218 return Version.withoutBuild();
1230 if (EnvironmentName ==
"none")
1236 if (EnvironmentName.
contains(
"-")) {
1241 const std::string tmp = (
Twine(
"-") + ObjectFormatTypeName).
str();
1245 return EnvironmentName;
1269 if (Version.getMajor() == 0)
1272 if (Version.getMajor() < 4) {
1275 if (Version.getMajor() <= 19) {
1284 if (Version.getMajor() == 0) {
1286 }
else if (Version.getMajor() < 10) {
1321 if (Version.getMajor() == 0)
1328 return Version.withMajorReplaced(Version.getMajor() + 16);
1349 if (Version.getMajor() == 0)
1368 if (Version.getMajor() == 0)
1369 return Version.withMajorReplaced(19);
1391 if (ValidVersionMap.
contains(VulkanVersion) &&
1392 (ValidVersionMap.
lookup(VulkanVersion) == SpirvVersion ||
1394 return VulkanVersion;
1892 return *
this ==
Other;
1898 if (
Other.isOSVersionLT(*
this))
1905 unsigned Micro)
const {
1916 assert(Major >= 11 &&
"Unexpected major version");
1970 "incorrect HLSL stage order");
1972 "incorrect HLSL stage order");
1974 "incorrect HLSL stage order");
1976 "incorrect HLSL stage order");
1978 "incorrect HLSL stage order");
1980 "incorrect HLSL stage order");
1982 "incorrect HLSL stage order");
1984 "incorrect HLSL stage order");
1986 "incorrect HLSL stage order");
1988 "incorrect HLSL stage order");
1990 "incorrect HLSL stage order");
1992 "incorrect HLSL stage order");
1994 "incorrect HLSL stage order");
1996 "incorrect HLSL stage order");
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.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallString class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName)
static VersionTuple parseVersionFromName(StringRef Name)
static Triple::ObjectFormatType getDefaultFormat(const Triple &T)
static Triple::ArchType parseARMArch(StringRef ArchName)
static Triple::OSType parseOS(StringRef OSName)
static Triple::ArchType parseBPFArch(StringRef ArchName)
static Triple::SubArchType parseSubArch(StringRef SubArchName)
static Triple::ObjectFormatType parseFormat(StringRef EnvironmentName)
static Triple::ArchType parseArch(StringRef ArchName)
static Triple::VendorType parseVendor(StringRef VendorName)
Defines the llvm::VersionTuple class, which represents a version in the form major[....
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
bool contains(const_arg_type_t< KeyT > Val) const
Return true if the specified key is in the map, false otherwise.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
bool consume_back(StringRef Suffix)
Returns true if this StringRef has the given suffix and removes that suffix.
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr bool empty() const
empty - Check if the string is empty.
constexpr size_t size() const
size - Get the string size.
bool contains(StringRef Other) const
Return true if the given string is a substring of *this, and false otherwise.
bool consume_front(StringRef Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
bool ends_with(StringRef Suffix) const
Check if this string ends with the given Suffix.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & StartsWith(StringLiteral S, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, T Value)
StringSwitch & EndsWith(StringLiteral S, T Value)
Triple - Helper class for working with autoconf configuration names.
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Comparison function for checking OS X version compatibility, which handles supporting skewed version ...
VersionTuple getOSVersion() const
Parse the version number from the OS name component of the triple, if present.
StringRef getVendorName() const
Get the vendor (second) component of the triple.
VersionTuple getWatchOSVersion() const
Parse the version number as with getOSVersion.
void setArchName(StringRef Str)
Set the architecture (first) component of the triple by name.
void setObjectFormat(ObjectFormatType Kind)
Set the object file format.
llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
Triple()=default
Default constructor is the same as an empty string and leaves all triple fields unknown.
std::string normalize() const
Return the normalized form of this triple's string.
unsigned getArchPointerBitWidth() const
Returns the pointer width of this architecture.
llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
static StringRef getVendorTypeName(VendorType Kind)
Get the canonical name for the Kind vendor.
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
SubArchType getSubArch() const
get the parsed subarchitecture type for this triple.
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
void setVendorName(StringRef Str)
Set the vendor (second) component of the triple by name.
void setOSAndEnvironmentName(StringRef Str)
Set the operating system and optional environment components with a single string.
llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
bool isLittleEndian() const
Tests whether the target triple is little endian.
void setEnvironment(EnvironmentType Kind)
Set the environment (fourth) component of the triple to a known type.
StringRef getOSName() const
Get the operating system (third) component of the triple.
void setTriple(const Twine &Str)
Set all components to the new triple Str.
OSType getOS() const
Get the parsed operating system type of this triple.
VersionTuple getEnvironmentVersion() const
Parse the version number from the OS name component of the triple, if present.
static ArchType getArchTypeForLLVMName(StringRef Str)
The canonical type for the given LLVM architecture name (e.g., "x86").
ArchType getArch() const
Get the parsed architecture type of this triple.
StringRef getEnvironmentName() const
Get the optional environment (fourth) component of the triple, or "" if empty.
bool isSimulatorEnvironment() const
const std::string & str() const
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
VersionTuple getVulkanVersion() const
Parse the Vulkan version number from the OSVersion and SPIR-V version (SubArch).
VersionTuple getDriverKitVersion() const
Parse the version number as with getOSVersion.
static StringRef getArchTypeName(ArchType Kind)
Get the canonical name for the Kind architecture.
static StringRef getOSTypeName(OSType Kind)
Get the canonical name for the Kind operating system.
std::string merge(const Triple &Other) const
Merge target triples.
@ ImaginationTechnologies
VersionTuple getMinimumSupportedOSVersion() const
Some platforms have different minimum supported OS versions that varies by the architecture specified...
bool isArch64Bit() const
Test whether the architecture is 64-bit.
StringRef getOSAndEnvironmentName() const
Get the operating system and optional environment components as a single string (separated by a '-' i...
@ ARMSubArch_v8m_mainline
@ ARMSubArch_v8m_baseline
@ ARMSubArch_v8_1m_mainline
bool getMacOSXVersion(VersionTuple &Version) const
Parse the version number as with getOSVersion and then translate generic "darwin" versions to the cor...
bool isMacOSX() const
Is this a Mac OS X triple.
void setEnvironmentName(StringRef Str)
Set the optional environment (fourth) component of the triple by name.
void setOS(OSType Kind)
Set the operating system (third) component of the triple to a known type.
void setOSName(StringRef Str)
Set the operating system (third) component of the triple by name.
VendorType getVendor() const
Get the parsed vendor type of this triple.
static StringRef getEnvironmentTypeName(EnvironmentType Kind)
Get the canonical name for the Kind environment.
bool isOSVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Helper function for doing comparisons against version numbers included in the target triple.
static VersionTuple getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version)
Returns a canonicalized OS version number for the specified OS.
StringRef getArchName() const
Get the architecture (first) component of the triple.
bool isMacCatalystEnvironment() const
static StringRef getObjectFormatTypeName(ObjectFormatType ObjectFormat)
Get the name for the Object format.
bool isArch16Bit() const
Test whether the architecture is 16-bit.
llvm::Triple getBigEndianArchVariant() const
Form a triple with a big endian variant of the current architecture.
VersionTuple getiOSVersion() const
Parse the version number as with getOSVersion.
StringRef getEnvironmentVersionString() const
Get the version component of the environment component as a single string (the version after the envi...
bool isArch32Bit() const
Test whether the architecture is 32-bit.
bool isCompatibleWith(const Triple &Other) const
Test whether target triples are compatible.
bool hasEnvironment() const
Does this triple have the optional environment (fourth) component?
static StringRef getArchTypePrefix(ArchType Kind)
Get the "prefix" canonical name for the Kind architecture.
void setArch(ArchType Kind, SubArchType SubArch=NoSubArch)
Set the architecture (first) component of the triple to a known type.
void setVendor(VendorType Kind)
Set the vendor (second) component of the triple to a known type.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
std::string str() const
Return the twine contents as a std::string.
Represents a version number in the form major[.minor[.subminor[.build]]].
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StringRef getCanonicalArchName(StringRef Arch)
MArch is expected to be of the form (arm|thumb)?(eb)?(v.
ISAKind parseArchISA(StringRef Arch)
ArchKind parseArch(StringRef Arch)
ProfileKind parseArchProfile(StringRef Arch)
unsigned parseArchVersion(StringRef Arch)
EndianKind parseArchEndian(StringRef Arch)
@ C
The default llvm calling convention, compatible with C.
static const bool IsLittleEndianHost
This is an optimization pass for GlobalISel generic memory operations.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.