Eliminate dead host/target feature code for Subzero

Subzero requires specifying the target CPU features at construction,
and doesn't use this legacy LLVM support code.

It is conceivable that this code was putting build host specific
information into static variables, thus not producing the same binary
when built on different machines.

Bug: chromium:937268
Bug: b/155971541
Change-Id: I8934c4abfebc3901ef50edfe86a0122b1b50e319
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/46689
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
diff --git a/src/Reactor/BUILD.gn b/src/Reactor/BUILD.gn
index ca00191..5a5eec1 100644
--- a/src/Reactor/BUILD.gn
+++ b/src/Reactor/BUILD.gn
@@ -241,7 +241,6 @@
       "$subzero_llvm_dir/lib/Support/ErrorHandling.cpp",
       "$subzero_llvm_dir/lib/Support/FoldingSet.cpp",
       "$subzero_llvm_dir/lib/Support/Hashing.cpp",
-      "$subzero_llvm_dir/lib/Support/Host.cpp",
       "$subzero_llvm_dir/lib/Support/ManagedStatic.cpp",
       "$subzero_llvm_dir/lib/Support/MemoryBuffer.cpp",
       "$subzero_llvm_dir/lib/Support/Mutex.cpp",
@@ -257,10 +256,8 @@
       "$subzero_llvm_dir/lib/Support/StringMap.cpp",
       "$subzero_llvm_dir/lib/Support/StringRef.cpp",
       "$subzero_llvm_dir/lib/Support/StringSaver.cpp",
-      "$subzero_llvm_dir/lib/Support/TargetParser.cpp",
       "$subzero_llvm_dir/lib/Support/Threading.cpp",
       "$subzero_llvm_dir/lib/Support/Timer.cpp",
-      "$subzero_llvm_dir/lib/Support/Triple.cpp",
       "$subzero_llvm_dir/lib/Support/Twine.cpp",
       "$subzero_llvm_dir/lib/Support/circular_raw_ostream.cpp",
       "$subzero_llvm_dir/lib/Support/raw_os_ostream.cpp",
diff --git a/third_party/llvm-subzero/Android.bp b/third_party/llvm-subzero/Android.bp
index 72c9b32..f1646b7 100644
--- a/third_party/llvm-subzero/Android.bp
+++ b/third_party/llvm-subzero/Android.bp
@@ -49,7 +49,6 @@
         "lib/Support/ErrorHandling.cpp",
         "lib/Support/FoldingSet.cpp",
         "lib/Support/Hashing.cpp",
-        "lib/Support/Host.cpp",
         "lib/Support/ManagedStatic.cpp",
         "lib/Support/MemoryBuffer.cpp",
         "lib/Support/Mutex.cpp",
@@ -72,10 +71,8 @@
         "lib/Support/StringMap.cpp",
         "lib/Support/StringRef.cpp",
         "lib/Support/StringSaver.cpp",
-        "lib/Support/TargetParser.cpp",
         "lib/Support/Threading.cpp",
         "lib/Support/Timer.cpp",
-        "lib/Support/Triple.cpp",
         "lib/Support/Twine.cpp",
     ],
 
diff --git a/third_party/llvm-subzero/CMakeLists.txt b/third_party/llvm-subzero/CMakeLists.txt
index f8a8ac7..eb08fc4 100644
--- a/third_party/llvm-subzero/CMakeLists.txt
+++ b/third_party/llvm-subzero/CMakeLists.txt
@@ -70,7 +70,6 @@
     "include/llvm/ADT/StringMap.h"
     "include/llvm/ADT/StringRef.h"
     "include/llvm/ADT/StringSwitch.h"
-    "include/llvm/ADT/Triple.h"
     "include/llvm/ADT/Twine.h"
     "include/llvm/Demangle/Demangle.h"
     "include/llvm/IR/Argument.h"
@@ -123,7 +122,6 @@
     "include/llvm/Support/FormatProviders.h"
     "include/llvm/Support/FormatVariadic.h"
     "include/llvm/Support/FormatVariadicDetails.h"
-    "include/llvm/Support/Host.h"
     "include/llvm/Support/MachO.h"
     "include/llvm/Support/ManagedStatic.h"
     "include/llvm/Support/MathExtras.h"
@@ -148,7 +146,6 @@
     "include/llvm/Support/StreamingMemoryObject.h"
     "include/llvm/Support/StringSaver.h"
     "include/llvm/Support/SwapByteOrder.h"
-    "include/llvm/Support/TargetParser.h"
     "include/llvm/Support/thread.h"
     "include/llvm/Support/Threading.h"
     "include/llvm/Support/Timer.h"
@@ -171,7 +168,6 @@
     "lib/Support/ErrorHandling.cpp"
     "lib/Support/FoldingSet.cpp"
     "lib/Support/Hashing.cpp"
-    "lib/Support/Host.cpp"
     "lib/Support/ManagedStatic.cpp"
     "lib/Support/MemoryBuffer.cpp"
     "lib/Support/Mutex.cpp"
@@ -199,10 +195,8 @@
     "lib/Support/StringMap.cpp"
     "lib/Support/StringRef.cpp"
     "lib/Support/StringSaver.cpp"
-    "lib/Support/TargetParser.cpp"
     "lib/Support/Threading.cpp"
     "lib/Support/Timer.cpp"
-    "lib/Support/Triple.cpp"
     "lib/Support/Twine.cpp"
     "lib/Support/Unix/Unix.h"
     "lib/Support/Windows/WindowsSupport.h"
diff --git a/third_party/llvm-subzero/include/llvm/ADT/Triple.h b/third_party/llvm-subzero/include/llvm/ADT/Triple.h
deleted file mode 100644
index d4130e1..0000000
--- a/third_party/llvm-subzero/include/llvm/ADT/Triple.h
+++ /dev/null
@@ -1,742 +0,0 @@
-//===-- llvm/ADT/Triple.h - Target triple helper class ----------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_TRIPLE_H
-#define LLVM_ADT_TRIPLE_H
-
-#include "llvm/ADT/Twine.h"
-
-// Some system headers or GCC predefined macros conflict with identifiers in
-// this file.  Undefine them here.
-#undef NetBSD
-#undef mips
-#undef sparc
-
-namespace llvm {
-
-/// Triple - Helper class for working with autoconf configuration names. For
-/// historical reasons, we also call these 'triples' (they used to contain
-/// exactly three fields).
-///
-/// Configuration names are strings in the canonical form:
-///   ARCHITECTURE-VENDOR-OPERATING_SYSTEM
-/// or
-///   ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT
-///
-/// This class is used for clients which want to support arbitrary
-/// configuration names, but also want to implement certain special
-/// behavior for particular configurations. This class isolates the mapping
-/// from the components of the configuration name to well known IDs.
-///
-/// At its core the Triple class is designed to be a wrapper for a triple
-/// string; the constructor does not change or normalize the triple string.
-/// Clients that need to handle the non-canonical triples that users often
-/// specify should use the normalize method.
-///
-/// See autoconf/config.guess for a glimpse into what configuration names
-/// look like in practice.
-class Triple {
-public:
-  enum ArchType {
-    UnknownArch,
-
-    arm,            // ARM (little endian): arm, armv.*, xscale
-    armeb,          // ARM (big endian): armeb
-    aarch64,        // AArch64 (little endian): aarch64
-    aarch64_be,     // AArch64 (big endian): aarch64_be
-    avr,            // AVR: Atmel AVR microcontroller
-    bpfel,          // eBPF or extended BPF or 64-bit BPF (little endian)
-    bpfeb,          // eBPF or extended BPF or 64-bit BPF (big endian)
-    hexagon,        // Hexagon: hexagon
-    mips,           // MIPS: mips, mipsallegrex
-    mipsel,         // MIPSEL: mipsel, mipsallegrexel
-    mips64,         // MIPS64: mips64
-    mips64el,       // MIPS64EL: mips64el
-    msp430,         // MSP430: msp430
-    ppc,            // PPC: powerpc
-    ppc64,          // PPC64: powerpc64, ppu
-    ppc64le,        // PPC64LE: powerpc64le
-    r600,           // R600: AMD GPUs HD2XXX - HD6XXX
-    amdgcn,         // AMDGCN: AMD GCN GPUs
-    riscv32,        // RISC-V (32-bit): riscv32
-    riscv64,        // RISC-V (64-bit): riscv64
-    sparc,          // Sparc: sparc
-    sparcv9,        // Sparcv9: Sparcv9
-    sparcel,        // Sparc: (endianness = little). NB: 'Sparcle' is a CPU variant
-    systemz,        // SystemZ: s390x
-    tce,            // TCE (http://tce.cs.tut.fi/): tce
-    tcele,          // TCE little endian (http://tce.cs.tut.fi/): tcele
-    thumb,          // Thumb (little endian): thumb, thumbv.*
-    thumbeb,        // Thumb (big endian): thumbeb
-    x86,            // X86: i[3-9]86
-    x86_64,         // X86-64: amd64, x86_64
-    xcore,          // XCore: xcore
-    nvptx,          // NVPTX: 32-bit
-    nvptx64,        // NVPTX: 64-bit
-    le32,           // le32: generic little-endian 32-bit CPU (PNaCl)
-    le64,           // le64: generic little-endian 64-bit CPU (PNaCl)
-    amdil,          // AMDIL
-    amdil64,        // AMDIL with 64-bit pointers
-    hsail,          // AMD HSAIL
-    hsail64,        // AMD HSAIL with 64-bit pointers
-    spir,           // SPIR: standard portable IR for OpenCL 32-bit version
-    spir64,         // SPIR: standard portable IR for OpenCL 64-bit version
-    kalimba,        // Kalimba: generic kalimba
-    shave,          // SHAVE: Movidius vector VLIW processors
-    lanai,          // Lanai: Lanai 32-bit
-    wasm32,         // WebAssembly with 32-bit pointers
-    wasm64,         // WebAssembly with 64-bit pointers
-    renderscript32, // 32-bit RenderScript
-    renderscript64, // 64-bit RenderScript
-    LastArchType = renderscript64
-  };
-  enum SubArchType {
-    NoSubArch,
-
-    ARMSubArch_v8_2a,
-    ARMSubArch_v8_1a,
-    ARMSubArch_v8,
-    ARMSubArch_v8r,
-    ARMSubArch_v8m_baseline,
-    ARMSubArch_v8m_mainline,
-    ARMSubArch_v7,
-    ARMSubArch_v7em,
-    ARMSubArch_v7m,
-    ARMSubArch_v7s,
-    ARMSubArch_v7k,
-    ARMSubArch_v6,
-    ARMSubArch_v6m,
-    ARMSubArch_v6k,
-    ARMSubArch_v6t2,
-    ARMSubArch_v5,
-    ARMSubArch_v5te,
-    ARMSubArch_v4t,
-
-    KalimbaSubArch_v3,
-    KalimbaSubArch_v4,
-    KalimbaSubArch_v5
-  };
-  enum VendorType {
-    UnknownVendor,
-
-    Apple,
-    PC,
-    SCEI,
-    BGP,
-    BGQ,
-    Freescale,
-    IBM,
-    ImaginationTechnologies,
-    MipsTechnologies,
-    NVIDIA,
-    CSR,
-    Myriad,
-    AMD,
-    Mesa,
-    LastVendorType = Mesa
-  };
-  enum OSType {
-    UnknownOS,
-
-    CloudABI,
-    Darwin,
-    DragonFly,
-    FreeBSD,
-    Fuchsia,
-    IOS,
-    KFreeBSD,
-    Linux,
-    Lv2,        // PS3
-    MacOSX,
-    NetBSD,
-    OpenBSD,
-    Solaris,
-    Win32,
-    Haiku,
-    Minix,
-    RTEMS,
-    NaCl,       // Native Client
-    CNK,        // BG/P Compute-Node Kernel
-    Bitrig,
-    AIX,
-    CUDA,       // NVIDIA CUDA
-    NVCL,       // NVIDIA OpenCL
-    AMDHSA,     // AMD HSA Runtime
-    PS4,
-    ELFIAMCU,
-    TvOS,       // Apple tvOS
-    WatchOS,    // Apple watchOS
-    Mesa3D,
-    Contiki,
-    LastOSType = Contiki
-  };
-  enum EnvironmentType {
-    UnknownEnvironment,
-
-    GNU,
-    GNUABI64,
-    GNUEABI,
-    GNUEABIHF,
-    GNUX32,
-    CODE16,
-    EABI,
-    EABIHF,
-    Android,
-    Musl,
-    MuslEABI,
-    MuslEABIHF,
-
-    MSVC,
-    Itanium,
-    Cygnus,
-    AMDOpenCL,
-    CoreCLR,
-    OpenCL,
-    LastEnvironmentType = OpenCL
-  };
-  enum ObjectFormatType {
-    UnknownObjectFormat,
-
-    COFF,
-    ELF,
-    MachO,
-  };
-
-private:
-  std::string Data;
-
-  /// The parsed arch type.
-  ArchType Arch;
-
-  /// The parsed subarchitecture type.
-  SubArchType SubArch;
-
-  /// The parsed vendor type.
-  VendorType Vendor;
-
-  /// The parsed OS type.
-  OSType OS;
-
-  /// The parsed Environment type.
-  EnvironmentType Environment;
-
-  /// The object format type.
-  ObjectFormatType ObjectFormat;
-
-public:
-  /// @name Constructors
-  /// @{
-
-  /// Default constructor is the same as an empty string and leaves all
-  /// triple fields unknown.
-  Triple() : Data(), Arch(), Vendor(), OS(), Environment(), ObjectFormat() {}
-
-  explicit Triple(const Twine &Str);
-  Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr);
-  Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
-         const Twine &EnvironmentStr);
-
-  bool operator==(const Triple &Other) const {
-    return Arch == Other.Arch && SubArch == Other.SubArch &&
-           Vendor == Other.Vendor && OS == Other.OS &&
-           Environment == Other.Environment &&
-           ObjectFormat == Other.ObjectFormat;
-  }
-
-  /// @}
-  /// @name Normalization
-  /// @{
-
-  /// normalize - Turn an arbitrary machine specification into the canonical
-  /// triple form (or something sensible that the Triple class understands if
-  /// nothing better can reasonably be done).  In particular, it handles the
-  /// common case in which otherwise valid components are in the wrong order.
-  static std::string normalize(StringRef Str);
-
-  /// Return the normalized form of this triple's string.
-  std::string normalize() const { return normalize(Data); }
-
-  /// @}
-  /// @name Typed Component Access
-  /// @{
-
-  /// getArch - Get the parsed architecture type of this triple.
-  ArchType getArch() const { return Arch; }
-
-  /// getSubArch - get the parsed subarchitecture type for this triple.
-  SubArchType getSubArch() const { return SubArch; }
-
-  /// getVendor - Get the parsed vendor type of this triple.
-  VendorType getVendor() const { return Vendor; }
-
-  /// getOS - Get the parsed operating system type of this triple.
-  OSType getOS() const { return OS; }
-
-  /// hasEnvironment - Does this triple have the optional environment
-  /// (fourth) component?
-  bool hasEnvironment() const {
-    return getEnvironmentName() != "";
-  }
-
-  /// getEnvironment - Get the parsed environment type of this triple.
-  EnvironmentType getEnvironment() const { return Environment; }
-
-  /// Parse the version number from the OS name component of the
-  /// triple, if present.
-  ///
-  /// For example, "fooos1.2.3" would return (1, 2, 3).
-  ///
-  /// If an entry is not defined, it will be returned as 0.
-  void getEnvironmentVersion(unsigned &Major, unsigned &Minor,
-                             unsigned &Micro) const;
-
-  /// getFormat - Get the object format for this triple.
-  ObjectFormatType getObjectFormat() const { return ObjectFormat; }
-
-  /// getOSVersion - Parse the version number from the OS name component of the
-  /// triple, if present.
-  ///
-  /// For example, "fooos1.2.3" would return (1, 2, 3).
-  ///
-  /// If an entry is not defined, it will be returned as 0.
-  void getOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const;
-
-  /// getOSMajorVersion - Return just the major version number, this is
-  /// specialized because it is a common query.
-  unsigned getOSMajorVersion() const {
-    unsigned Maj, Min, Micro;
-    getOSVersion(Maj, Min, Micro);
-    return Maj;
-  }
-
-  /// getMacOSXVersion - Parse the version number as with getOSVersion and then
-  /// translate generic "darwin" versions to the corresponding OS X versions.
-  /// This may also be called with IOS triples but the OS X version number is
-  /// just set to a constant 10.4.0 in that case.  Returns true if successful.
-  bool getMacOSXVersion(unsigned &Major, unsigned &Minor,
-                        unsigned &Micro) const;
-
-  /// getiOSVersion - Parse the version number as with getOSVersion.  This should
-  /// only be called with IOS or generic triples.
-  void getiOSVersion(unsigned &Major, unsigned &Minor,
-                     unsigned &Micro) const;
-
-  /// getWatchOSVersion - Parse the version number as with getOSVersion.  This
-  /// should only be called with WatchOS or generic triples.
-  void getWatchOSVersion(unsigned &Major, unsigned &Minor,
-                         unsigned &Micro) const;
-
-  /// @}
-  /// @name Direct Component Access
-  /// @{
-
-  const std::string &str() const { return Data; }
-
-  const std::string &getTriple() const { return Data; }
-
-  /// getArchName - Get the architecture (first) component of the
-  /// triple.
-  StringRef getArchName() const;
-
-  /// getVendorName - Get the vendor (second) component of the triple.
-  StringRef getVendorName() const;
-
-  /// getOSName - Get the operating system (third) component of the
-  /// triple.
-  StringRef getOSName() const;
-
-  /// getEnvironmentName - Get the optional environment (fourth)
-  /// component of the triple, or "" if empty.
-  StringRef getEnvironmentName() const;
-
-  /// getOSAndEnvironmentName - Get the operating system and optional
-  /// environment components as a single string (separated by a '-'
-  /// if the environment component is present).
-  StringRef getOSAndEnvironmentName() const;
-
-  /// @}
-  /// @name Convenience Predicates
-  /// @{
-
-  /// Test whether the architecture is 64-bit
-  ///
-  /// Note that this tests for 64-bit pointer width, and nothing else. Note
-  /// that we intentionally expose only three predicates, 64-bit, 32-bit, and
-  /// 16-bit. The inner details of pointer width for particular architectures
-  /// is not summed up in the triple, and so only a coarse grained predicate
-  /// system is provided.
-  bool isArch64Bit() const;
-
-  /// Test whether the architecture is 32-bit
-  ///
-  /// Note that this tests for 32-bit pointer width, and nothing else.
-  bool isArch32Bit() const;
-
-  /// Test whether the architecture is 16-bit
-  ///
-  /// Note that this tests for 16-bit pointer width, and nothing else.
-  bool isArch16Bit() const;
-
-  /// isOSVersionLT - Helper function for doing comparisons against version
-  /// numbers included in the target triple.
-  bool isOSVersionLT(unsigned Major, unsigned Minor = 0,
-                     unsigned Micro = 0) const {
-    unsigned LHS[3];
-    getOSVersion(LHS[0], LHS[1], LHS[2]);
-
-    if (LHS[0] != Major)
-      return LHS[0] < Major;
-    if (LHS[1] != Minor)
-      return LHS[1] < Minor;
-    if (LHS[2] != Micro)
-      return LHS[1] < Micro;
-
-    return false;
-  }
-
-  bool isOSVersionLT(const Triple &Other) const {
-    unsigned RHS[3];
-    Other.getOSVersion(RHS[0], RHS[1], RHS[2]);
-    return isOSVersionLT(RHS[0], RHS[1], RHS[2]);
-  }
-
-  /// isMacOSXVersionLT - Comparison function for checking OS X version
-  /// compatibility, which handles supporting skewed version numbering schemes
-  /// used by the "darwin" triples.
-  bool isMacOSXVersionLT(unsigned Major, unsigned Minor = 0,
-                         unsigned Micro = 0) const {
-    assert(isMacOSX() && "Not an OS X triple!");
-
-    // If this is OS X, expect a sane version number.
-    if (getOS() == Triple::MacOSX)
-      return isOSVersionLT(Major, Minor, Micro);
-
-    // Otherwise, compare to the "Darwin" number.
-    assert(Major == 10 && "Unexpected major version");
-    return isOSVersionLT(Minor + 4, Micro, 0);
-  }
-
-  /// isMacOSX - Is this a Mac OS X triple. For legacy reasons, we support both
-  /// "darwin" and "osx" as OS X triples.
-  bool isMacOSX() const {
-    return getOS() == Triple::Darwin || getOS() == Triple::MacOSX;
-  }
-
-  /// Is this an iOS triple.
-  /// Note: This identifies tvOS as a variant of iOS. If that ever
-  /// changes, i.e., if the two operating systems diverge or their version
-  /// numbers get out of sync, that will need to be changed.
-  /// watchOS has completely different version numbers so it is not included.
-  bool isiOS() const {
-    return getOS() == Triple::IOS || isTvOS();
-  }
-
-  /// Is this an Apple tvOS triple.
-  bool isTvOS() const {
-    return getOS() == Triple::TvOS;
-  }
-
-  /// Is this an Apple watchOS triple.
-  bool isWatchOS() const {
-    return getOS() == Triple::WatchOS;
-  }
-
-  bool isWatchABI() const {
-    return getSubArch() == Triple::ARMSubArch_v7k;
-  }
-
-  /// isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
-  bool isOSDarwin() const {
-    return isMacOSX() || isiOS() || isWatchOS();
-  }
-
-  bool isOSNetBSD() const {
-    return getOS() == Triple::NetBSD;
-  }
-
-  bool isOSOpenBSD() const {
-    return getOS() == Triple::OpenBSD;
-  }
-
-  bool isOSFreeBSD() const {
-    return getOS() == Triple::FreeBSD;
-  }
-
-  bool isOSFuchsia() const {
-    return getOS() == Triple::Fuchsia;
-  }
-
-  bool isOSDragonFly() const { return getOS() == Triple::DragonFly; }
-
-  bool isOSSolaris() const {
-    return getOS() == Triple::Solaris;
-  }
-
-  bool isOSBitrig() const {
-    return getOS() == Triple::Bitrig;
-  }
-
-  bool isOSIAMCU() const {
-    return getOS() == Triple::ELFIAMCU;
-  }
-
-  bool isGNUEnvironment() const {
-    EnvironmentType Env = getEnvironment();
-    return Env == Triple::GNU || Env == Triple::GNUABI64 ||
-           Env == Triple::GNUEABI || Env == Triple::GNUEABIHF ||
-           Env == Triple::GNUX32;
-  }
-
-  bool isOSContiki() const {
-    return getOS() == Triple::Contiki;
-  }
-
-  /// Checks if the environment could be MSVC.
-  bool isWindowsMSVCEnvironment() const {
-    return getOS() == Triple::Win32 &&
-           (getEnvironment() == Triple::UnknownEnvironment ||
-            getEnvironment() == Triple::MSVC);
-  }
-
-  /// Checks if the environment is MSVC.
-  bool isKnownWindowsMSVCEnvironment() const {
-    return getOS() == Triple::Win32 && getEnvironment() == Triple::MSVC;
-  }
-
-  bool isWindowsCoreCLREnvironment() const {
-    return getOS() == Triple::Win32 && getEnvironment() == Triple::CoreCLR;
-  }
-
-  bool isWindowsItaniumEnvironment() const {
-    return getOS() == Triple::Win32 && getEnvironment() == Triple::Itanium;
-  }
-
-  bool isWindowsCygwinEnvironment() const {
-    return getOS() == Triple::Win32 && getEnvironment() == Triple::Cygnus;
-  }
-
-  bool isWindowsGNUEnvironment() const {
-    return getOS() == Triple::Win32 && getEnvironment() == Triple::GNU;
-  }
-
-  /// Tests for either Cygwin or MinGW OS
-  bool isOSCygMing() const {
-    return isWindowsCygwinEnvironment() || isWindowsGNUEnvironment();
-  }
-
-  /// Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
-  bool isOSMSVCRT() const {
-    return isWindowsMSVCEnvironment() || isWindowsGNUEnvironment() ||
-           isWindowsItaniumEnvironment();
-  }
-
-  /// Tests whether the OS is Windows.
-  bool isOSWindows() const {
-    return getOS() == Triple::Win32;
-  }
-
-  /// Tests whether the OS is NaCl (Native Client)
-  bool isOSNaCl() const {
-    return getOS() == Triple::NaCl;
-  }
-
-  /// Tests whether the OS is Linux.
-  bool isOSLinux() const {
-    return getOS() == Triple::Linux;
-  }
-
-  /// Tests whether the OS is kFreeBSD.
-  bool isOSKFreeBSD() const {
-    return getOS() == Triple::KFreeBSD;
-  }
-
-  /// Tests whether the OS uses glibc.
-  bool isOSGlibc() const {
-    return getOS() == Triple::Linux || getOS() == Triple::KFreeBSD;
-  }
-
-  /// Tests whether the OS uses the ELF binary format.
-  bool isOSBinFormatELF() const {
-    return getObjectFormat() == Triple::ELF;
-  }
-
-  /// Tests whether the OS uses the COFF binary format.
-  bool isOSBinFormatCOFF() const {
-    return getObjectFormat() == Triple::COFF;
-  }
-
-  /// Tests whether the environment is MachO.
-  bool isOSBinFormatMachO() const {
-    return getObjectFormat() == Triple::MachO;
-  }
-
-  /// Tests whether the target is the PS4 CPU
-  bool isPS4CPU() const {
-    return getArch() == Triple::x86_64 &&
-           getVendor() == Triple::SCEI &&
-           getOS() == Triple::PS4;
-  }
-
-  /// Tests whether the target is the PS4 platform
-  bool isPS4() const {
-    return getVendor() == Triple::SCEI &&
-           getOS() == Triple::PS4;
-  }
-
-  /// Tests whether the target is Android
-  bool isAndroid() const { return getEnvironment() == Triple::Android; }
-
-  /// Tests whether the environment is musl-libc
-  bool isMusl() const {
-    return getEnvironment() == Triple::Musl ||
-           getEnvironment() == Triple::MuslEABI ||
-           getEnvironment() == Triple::MuslEABIHF;
-  }
-
-  /// Tests whether the target is NVPTX (32- or 64-bit).
-  bool isNVPTX() const {
-    return getArch() == Triple::nvptx || getArch() == Triple::nvptx64;
-  }
-
-  /// Tests wether the target supports comdat
-  bool supportsCOMDAT() const { return !isOSBinFormatMachO(); }
-
-  /// @}
-  /// @name Mutators
-  /// @{
-
-  /// setArch - Set the architecture (first) component of the triple
-  /// to a known type.
-  void setArch(ArchType Kind);
-
-  /// setVendor - Set the vendor (second) component of the triple to a
-  /// known type.
-  void setVendor(VendorType Kind);
-
-  /// setOS - Set the operating system (third) component of the triple
-  /// to a known type.
-  void setOS(OSType Kind);
-
-  /// setEnvironment - Set the environment (fourth) component of the triple
-  /// to a known type.
-  void setEnvironment(EnvironmentType Kind);
-
-  /// setObjectFormat - Set the object file format
-  void setObjectFormat(ObjectFormatType Kind);
-
-  /// setTriple - Set all components to the new triple \p Str.
-  void setTriple(const Twine &Str);
-
-  /// setArchName - Set the architecture (first) component of the
-  /// triple by name.
-  void setArchName(StringRef Str);
-
-  /// setVendorName - Set the vendor (second) component of the triple
-  /// by name.
-  void setVendorName(StringRef Str);
-
-  /// setOSName - Set the operating system (third) component of the
-  /// triple by name.
-  void setOSName(StringRef Str);
-
-  /// setEnvironmentName - Set the optional environment (fourth)
-  /// component of the triple by name.
-  void setEnvironmentName(StringRef Str);
-
-  /// setOSAndEnvironmentName - Set the operating system and optional
-  /// environment components with a single string.
-  void setOSAndEnvironmentName(StringRef Str);
-
-  /// @}
-  /// @name Helpers to build variants of a particular triple.
-  /// @{
-
-  /// Form a triple with a 32-bit variant of the current architecture.
-  ///
-  /// This can be used to move across "families" of architectures where useful.
-  ///
-  /// \returns A new triple with a 32-bit architecture or an unknown
-  ///          architecture if no such variant can be found.
-  llvm::Triple get32BitArchVariant() const;
-
-  /// Form a triple with a 64-bit variant of the current architecture.
-  ///
-  /// This can be used to move across "families" of architectures where useful.
-  ///
-  /// \returns A new triple with a 64-bit architecture or an unknown
-  ///          architecture if no such variant can be found.
-  llvm::Triple get64BitArchVariant() const;
-
-  /// Form a triple with a big endian variant of the current architecture.
-  ///
-  /// This can be used to move across "families" of architectures where useful.
-  ///
-  /// \returns A new triple with a big endian architecture or an unknown
-  ///          architecture if no such variant can be found.
-  llvm::Triple getBigEndianArchVariant() const;
-
-  /// Form a triple with a little endian variant of the current architecture.
-  ///
-  /// This can be used to move across "families" of architectures where useful.
-  ///
-  /// \returns A new triple with a little endian architecture or an unknown
-  ///          architecture if no such variant can be found.
-  llvm::Triple getLittleEndianArchVariant() const;
-
-  /// Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
-  ///
-  /// \param Arch the architecture name (e.g., "armv7s"). If it is an empty
-  /// string then the triple's arch name is used.
-  StringRef getARMCPUForArch(StringRef Arch = StringRef()) const;
-
-  /// Tests whether the target triple is little endian.
-  ///
-  /// \returns true if the triple is little endian, false otherwise.
-  bool isLittleEndian() const;
-
-  /// @}
-  /// @name Static helpers for IDs.
-  /// @{
-
-  /// getArchTypeName - Get the canonical name for the \p Kind architecture.
-  static StringRef getArchTypeName(ArchType Kind);
-
-  /// getArchTypePrefix - Get the "prefix" canonical name for the \p Kind
-  /// architecture. This is the prefix used by the architecture specific
-  /// builtins, and is suitable for passing to \see
-  /// Intrinsic::getIntrinsicForGCCBuiltin().
-  ///
-  /// \return - The architecture prefix, or 0 if none is defined.
-  static StringRef getArchTypePrefix(ArchType Kind);
-
-  /// getVendorTypeName - Get the canonical name for the \p Kind vendor.
-  static StringRef getVendorTypeName(VendorType Kind);
-
-  /// getOSTypeName - Get the canonical name for the \p Kind operating system.
-  static StringRef getOSTypeName(OSType Kind);
-
-  /// getEnvironmentTypeName - Get the canonical name for the \p Kind
-  /// environment.
-  static StringRef getEnvironmentTypeName(EnvironmentType Kind);
-
-  /// @}
-  /// @name Static helpers for converting alternate architecture names.
-  /// @{
-
-  /// getArchTypeForLLVMName - The canonical type for the given LLVM
-  /// architecture name (e.g., "x86").
-  static ArchType getArchTypeForLLVMName(StringRef Str);
-
-  /// @}
-};
-
-} // End llvm namespace
-
-
-#endif
diff --git a/third_party/llvm-subzero/include/llvm/Support/Host.h b/third_party/llvm-subzero/include/llvm/Support/Host.h
index 9df584c..1746c72 100644
--- a/third_party/llvm-subzero/include/llvm/Support/Host.h
+++ b/third_party/llvm-subzero/include/llvm/Support/Host.h
@@ -38,43 +38,6 @@
 #endif
 
   static const bool IsLittleEndianHost = !IsBigEndianHost;
-
-  /// getDefaultTargetTriple() - Return the default target triple the compiler
-  /// has been configured to produce code for.
-  ///
-  /// The target triple is a string in the format of:
-  ///   CPU_TYPE-VENDOR-OPERATING_SYSTEM
-  /// or
-  ///   CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
-  std::string getDefaultTargetTriple();
-
-  /// getProcessTriple() - Return an appropriate target triple for generating
-  /// code to be loaded into the current process, e.g. when using the JIT.
-  std::string getProcessTriple();
-
-  /// getHostCPUName - Get the LLVM name for the host CPU. The particular format
-  /// of the name is target dependent, and suitable for passing as -mcpu to the
-  /// target which matches the host.
-  ///
-  /// \return - The host CPU name, or empty if the CPU could not be determined.
-  StringRef getHostCPUName();
-
-  /// getHostCPUFeatures - Get the LLVM names for the host CPU features.
-  /// The particular format of the names are target dependent, and suitable for
-  /// passing as -mattr to the target which matches the host.
-  ///
-  /// \param Features - A string mapping feature names to either
-  /// true (if enabled) or false (if disabled). This routine makes no guarantees
-  /// about exactly which features may appear in this map, except that they are
-  /// all valid LLVM feature names.
-  ///
-  /// \return - True on success.
-  bool getHostCPUFeatures(StringMap<bool> &Features);
-
-  /// Get the number of physical cores (as opposed to logical cores returned
-  /// from thread::hardware_concurrency(), which includes hyperthreads).
-  /// Returns -1 if unknown for the current host system.
-  int getHostNumPhysicalCores();
 }
 }
 
diff --git a/third_party/llvm-subzero/include/llvm/Support/TargetParser.h b/third_party/llvm-subzero/include/llvm/Support/TargetParser.h
deleted file mode 100644
index 63aeca7..0000000
--- a/third_party/llvm-subzero/include/llvm/Support/TargetParser.h
+++ /dev/null
@@ -1,209 +0,0 @@
-//===-- TargetParser - Parser for target features ---------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a target parser to recognise hardware features such as
-// FPU/CPU/ARCH names as well as specific support such as HDIV, etc.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_TARGETPARSER_H
-#define LLVM_SUPPORT_TARGETPARSER_H
-
-// FIXME: vector is used because that's what clang uses for subtarget feature
-// lists, but SmallVector would probably be better
-#include <vector>
-
-namespace llvm {
-class StringRef;
-
-// Target specific information into their own namespaces. These should be
-// generated from TableGen because the information is already there, and there
-// is where new information about targets will be added.
-// FIXME: To TableGen this we need to make some table generated files available
-// even if the back-end is not compiled with LLVM, plus we need to create a new
-// back-end to TableGen to create these clean tables.
-namespace ARM {
-
-// FPU names.
-enum FPUKind {
-#define ARM_FPU(NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION) KIND,
-#include "ARMTargetParser.def"
-  FK_LAST
-};
-
-// FPU Version
-enum FPUVersion {
-  FV_NONE = 0,
-  FV_VFPV2,
-  FV_VFPV3,
-  FV_VFPV3_FP16,
-  FV_VFPV4,
-  FV_VFPV5
-};
-
-// An FPU name implies one of three levels of Neon support:
-enum NeonSupportLevel {
-  NS_None = 0, ///< No Neon
-  NS_Neon,     ///< Neon
-  NS_Crypto    ///< Neon with Crypto
-};
-
-// An FPU name restricts the FPU in one of three ways:
-enum FPURestriction {
-  FR_None = 0, ///< No restriction
-  FR_D16,      ///< Only 16 D registers
-  FR_SP_D16    ///< Only single-precision instructions, with 16 D registers
-};
-
-// Arch names.
-enum ArchKind {
-#define ARM_ARCH(NAME, ID, CPU_ATTR, SUB_ARCH, ARCH_ATTR, ARCH_FPU, ARCH_BASE_EXT) ID,
-#include "ARMTargetParser.def"
-  AK_LAST
-};
-
-// Arch extension modifiers for CPUs.
-enum ArchExtKind : unsigned {
-  AEK_INVALID = 0x0,
-  AEK_NONE = 0x1,
-  AEK_CRC = 0x2,
-  AEK_CRYPTO = 0x4,
-  AEK_FP = 0x8,
-  AEK_HWDIV = 0x10,
-  AEK_HWDIVARM = 0x20,
-  AEK_MP = 0x40,
-  AEK_SIMD = 0x80,
-  AEK_SEC = 0x100,
-  AEK_VIRT = 0x200,
-  AEK_DSP = 0x400,
-  AEK_FP16 = 0x800,
-  AEK_RAS = 0x1000,
-  // Unsupported extensions.
-  AEK_OS = 0x8000000,
-  AEK_IWMMXT = 0x10000000,
-  AEK_IWMMXT2 = 0x20000000,
-  AEK_MAVERICK = 0x40000000,
-  AEK_XSCALE = 0x80000000,
-};
-
-// ISA kinds.
-enum ISAKind { IK_INVALID = 0, IK_ARM, IK_THUMB, IK_AARCH64 };
-
-// Endianness
-// FIXME: BE8 vs. BE32?
-enum EndianKind { EK_INVALID = 0, EK_LITTLE, EK_BIG };
-
-// v6/v7/v8 Profile
-enum ProfileKind { PK_INVALID = 0, PK_A, PK_R, PK_M };
-
-StringRef getCanonicalArchName(StringRef Arch);
-
-// Information by ID
-StringRef getFPUName(unsigned FPUKind);
-unsigned getFPUVersion(unsigned FPUKind);
-unsigned getFPUNeonSupportLevel(unsigned FPUKind);
-unsigned getFPURestriction(unsigned FPUKind);
-
-// FIXME: These should be moved to TargetTuple once it exists
-bool getFPUFeatures(unsigned FPUKind, std::vector<StringRef> &Features);
-bool getHWDivFeatures(unsigned HWDivKind, std::vector<StringRef> &Features);
-bool getExtensionFeatures(unsigned Extensions,
-                          std::vector<StringRef> &Features);
-
-StringRef getArchName(unsigned ArchKind);
-unsigned getArchAttr(unsigned ArchKind);
-StringRef getCPUAttr(unsigned ArchKind);
-StringRef getSubArch(unsigned ArchKind);
-StringRef getArchExtName(unsigned ArchExtKind);
-StringRef getArchExtFeature(StringRef ArchExt);
-StringRef getHWDivName(unsigned HWDivKind);
-
-// Information by Name
-unsigned  getDefaultFPU(StringRef CPU, unsigned ArchKind);
-unsigned  getDefaultExtensions(StringRef CPU, unsigned ArchKind);
-StringRef getDefaultCPU(StringRef Arch);
-
-// Parser
-unsigned parseHWDiv(StringRef HWDiv);
-unsigned parseFPU(StringRef FPU);
-unsigned parseArch(StringRef Arch);
-unsigned parseArchExt(StringRef ArchExt);
-unsigned parseCPUArch(StringRef CPU);
-unsigned parseArchISA(StringRef Arch);
-unsigned parseArchEndian(StringRef Arch);
-unsigned parseArchProfile(StringRef Arch);
-unsigned parseArchVersion(StringRef Arch);
-
-} // namespace ARM
-
-// FIXME:This should be made into class design,to avoid dupplication. 
-namespace AArch64 {
-
-// Arch names.
-enum class ArchKind {
-#define AARCH64_ARCH(NAME, ID, CPU_ATTR, SUB_ARCH, ARCH_ATTR, ARCH_FPU, ARCH_BASE_EXT) ID,
-#include "AArch64TargetParser.def"
-  AK_LAST
-};
-
-// Arch extension modifiers for CPUs.
-enum ArchExtKind : unsigned {
-  AEK_INVALID = 0x0,
-  AEK_NONE = 0x1,
-  AEK_CRC = 0x2,
-  AEK_CRYPTO = 0x4,
-  AEK_FP = 0x8,
-  AEK_SIMD = 0x10,
-  AEK_FP16 = 0x20,
-  AEK_PROFILE = 0x40,
-  AEK_RAS = 0x80,
-  AEK_LSE = 0x100
-};
-
-StringRef getCanonicalArchName(StringRef Arch);
-
-// Information by ID
-StringRef getFPUName(unsigned FPUKind);
-unsigned getFPUVersion(unsigned FPUKind);
-unsigned getFPUNeonSupportLevel(unsigned FPUKind);
-unsigned getFPURestriction(unsigned FPUKind);
-
-// FIXME: These should be moved to TargetTuple once it exists
-bool getFPUFeatures(unsigned FPUKind, std::vector<StringRef> &Features);
-bool getExtensionFeatures(unsigned Extensions,
-                                   std::vector<StringRef> &Features);
-bool getArchFeatures(unsigned ArchKind, std::vector<StringRef> &Features);
-
-StringRef getArchName(unsigned ArchKind);
-unsigned getArchAttr(unsigned ArchKind);
-StringRef getCPUAttr(unsigned ArchKind);
-StringRef getSubArch(unsigned ArchKind);
-StringRef getArchExtName(unsigned ArchExtKind);
-StringRef getArchExtFeature(StringRef ArchExt);
-unsigned checkArchVersion(StringRef Arch);
-
-// Information by Name
-unsigned  getDefaultFPU(StringRef CPU, unsigned ArchKind);
-unsigned  getDefaultExtensions(StringRef CPU, unsigned ArchKind);
-StringRef getDefaultCPU(StringRef Arch);
-
-// Parser
-unsigned parseFPU(StringRef FPU);
-unsigned parseArch(StringRef Arch);
-unsigned parseArchExt(StringRef ArchExt);
-unsigned parseCPUArch(StringRef CPU);
-unsigned parseArchISA(StringRef Arch);
-unsigned parseArchEndian(StringRef Arch);
-unsigned parseArchProfile(StringRef Arch);
-unsigned parseArchVersion(StringRef Arch);
-
-} // namespace AArch64
-} // namespace llvm
-
-#endif
diff --git a/third_party/llvm-subzero/lib/Support/CommandLine.cpp b/third_party/llvm-subzero/lib/Support/CommandLine.cpp
index 3e77cd0..ad5b733 100644
--- a/third_party/llvm-subzero/lib/Support/CommandLine.cpp
+++ b/third_party/llvm-subzero/lib/Support/CommandLine.cpp
@@ -2053,69 +2053,6 @@
 
 static std::vector<void (*)()> *ExtraVersionPrinters = nullptr;
 
-namespace {
-class VersionPrinter {
-public:
-  void print() {
-    raw_ostream &OS = outs();
-#ifdef PACKAGE_VENDOR
-    OS << PACKAGE_VENDOR << " ";
-#else
-    OS << "LLVM (http://llvm.org/):\n  ";
-#endif
-    OS << PACKAGE_NAME << " version " << PACKAGE_VERSION;
-#ifdef LLVM_VERSION_INFO
-    OS << " " << LLVM_VERSION_INFO;
-#endif
-    OS << "\n  ";
-#ifndef __OPTIMIZE__
-    OS << "DEBUG build";
-#else
-    OS << "Optimized build";
-#endif
-#ifndef NDEBUG
-    OS << " with assertions";
-#endif
-    std::string CPU = sys::getHostCPUName();
-    if (CPU == "generic")
-      CPU = "(unknown)";
-    OS << ".\n"
-       << "  Default target: " << sys::getDefaultTargetTriple() << '\n'
-       << "  Host CPU: " << CPU << '\n';
-  }
-  void operator=(bool OptionWasSpecified) {
-    if (!OptionWasSpecified)
-      return;
-
-    if (OverrideVersionPrinter != nullptr) {
-      (*OverrideVersionPrinter)();
-      exit(0);
-    }
-    print();
-
-    // Iterate over any registered extra printers and call them to add further
-    // information.
-    if (ExtraVersionPrinters != nullptr) {
-      outs() << '\n';
-      for (std::vector<void (*)()>::iterator I = ExtraVersionPrinters->begin(),
-                                             E = ExtraVersionPrinters->end();
-           I != E; ++I)
-        (*I)();
-    }
-
-    exit(0);
-  }
-};
-} // End anonymous namespace
-
-// Define the --version option that prints out the LLVM version for the tool
-static VersionPrinter VersionPrinterInstance;
-
-static cl::opt<VersionPrinter, true, parser<bool>>
-    VersOp("version", cl::desc("Display the version of this program"),
-           cl::location(VersionPrinterInstance), cl::ValueDisallowed,
-           cl::cat(GenericCategory));
-
 // Utility function for printing the help message.
 void cl::PrintHelpMessage(bool Hidden, bool Categorized) {
   // This looks weird, but it actually prints the help message. The Printers are
@@ -2135,9 +2072,6 @@
     CategorizedHiddenPrinter = true;
 }
 
-/// Utility function for printing version number.
-void cl::PrintVersionMessage() { VersionPrinterInstance.print(); }
-
 void cl::SetVersionPrinter(void (*func)()) { OverrideVersionPrinter = func; }
 
 void cl::AddExtraVersionPrinter(void (*func)()) {
diff --git a/third_party/llvm-subzero/lib/Support/Host.cpp b/third_party/llvm-subzero/lib/Support/Host.cpp
deleted file mode 100644
index 52fc297..0000000
--- a/third_party/llvm-subzero/lib/Support/Host.cpp
+++ /dev/null
@@ -1,1456 +0,0 @@
-//===-- Host.cpp - Implement OS Host Concept --------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//  This file implements the operating system Host concept.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Host.h"
-#include "llvm/ADT/SmallSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/ADT/StringSwitch.h"
-#include "llvm/ADT/Triple.h"
-#include "llvm/Config/config.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/raw_ostream.h"
-#include <assert.h>
-#include <string.h>
-
-// Include the platform-specific parts of this class.
-#ifdef LLVM_ON_UNIX
-#include "Unix/Host.inc"
-#endif
-#ifdef LLVM_ON_WIN32
-#include "Windows/Host.inc"
-#endif
-#ifdef _MSC_VER
-#include <intrin.h>
-#endif
-#if defined(__APPLE__) && (defined(__ppc__) || defined(__powerpc__))
-#include <mach/host_info.h>
-#include <mach/mach.h>
-#include <mach/mach_host.h>
-#include <mach/machine.h>
-#endif
-
-#define DEBUG_TYPE "host-detection"
-
-//===----------------------------------------------------------------------===//
-//
-//  Implementations of the CPU detection routines
-//
-//===----------------------------------------------------------------------===//
-
-using namespace llvm;
-
-#if defined(__linux__)
-static ssize_t LLVM_ATTRIBUTE_UNUSED readCpuInfo(void *Buf, size_t Size) {
-  // Note: We cannot mmap /proc/cpuinfo here and then process the resulting
-  // memory buffer because the 'file' has 0 size (it can be read from only
-  // as a stream).
-
-  int FD;
-  std::error_code EC = sys::fs::openFileForRead("/proc/cpuinfo", FD);
-  if (EC) {
-    DEBUG(dbgs() << "Unable to open /proc/cpuinfo: " << EC.message() << "\n");
-    return -1;
-  }
-  int Ret = read(FD, Buf, Size);
-  int CloseStatus = close(FD);
-  if (CloseStatus)
-    return -1;
-  return Ret;
-}
-#endif
-
-#if defined(__i386__) || defined(_M_IX86) || \
-    defined(__x86_64__) || defined(_M_X64)
-
-enum VendorSignatures {
-  SIG_INTEL = 0x756e6547 /* Genu */,
-  SIG_AMD = 0x68747541 /* Auth */
-};
-
-enum ProcessorVendors {
-  VENDOR_INTEL = 1,
-  VENDOR_AMD,
-  VENDOR_OTHER,
-  VENDOR_MAX
-};
-
-enum ProcessorTypes {
-  INTEL_ATOM = 1,
-  INTEL_CORE2,
-  INTEL_COREI7,
-  AMDFAM10H,
-  AMDFAM15H,
-  INTEL_i386,
-  INTEL_i486,
-  INTEL_PENTIUM,
-  INTEL_PENTIUM_PRO,
-  INTEL_PENTIUM_II,
-  INTEL_PENTIUM_III,
-  INTEL_PENTIUM_IV,
-  INTEL_PENTIUM_M,
-  INTEL_CORE_DUO,
-  INTEL_XEONPHI,
-  INTEL_X86_64,
-  INTEL_NOCONA,
-  INTEL_PRESCOTT,
-  AMD_i486,
-  AMDPENTIUM,
-  AMDATHLON,
-  AMDFAM14H,
-  AMDFAM16H,
-  CPU_TYPE_MAX
-};
-
-enum ProcessorSubtypes {
-  INTEL_COREI7_NEHALEM = 1,
-  INTEL_COREI7_WESTMERE,
-  INTEL_COREI7_SANDYBRIDGE,
-  AMDFAM10H_BARCELONA,
-  AMDFAM10H_SHANGHAI,
-  AMDFAM10H_ISTANBUL,
-  AMDFAM15H_BDVER1,
-  AMDFAM15H_BDVER2,
-  INTEL_PENTIUM_MMX,
-  INTEL_CORE2_65,
-  INTEL_CORE2_45,
-  INTEL_COREI7_IVYBRIDGE,
-  INTEL_COREI7_HASWELL,
-  INTEL_COREI7_BROADWELL,
-  INTEL_COREI7_SKYLAKE,
-  INTEL_COREI7_SKYLAKE_AVX512,
-  INTEL_ATOM_BONNELL,
-  INTEL_ATOM_SILVERMONT,
-  INTEL_KNIGHTS_LANDING,
-  AMDPENTIUM_K6,
-  AMDPENTIUM_K62,
-  AMDPENTIUM_K63,
-  AMDPENTIUM_GEODE,
-  AMDATHLON_TBIRD,
-  AMDATHLON_MP,
-  AMDATHLON_XP,
-  AMDATHLON_K8SSE3,
-  AMDATHLON_OPTERON,
-  AMDATHLON_FX,
-  AMDATHLON_64,
-  AMD_BTVER1,
-  AMD_BTVER2,
-  AMDFAM15H_BDVER3,
-  AMDFAM15H_BDVER4,
-  CPU_SUBTYPE_MAX
-};
-
-enum ProcessorFeatures {
-  FEATURE_CMOV = 0,
-  FEATURE_MMX,
-  FEATURE_POPCNT,
-  FEATURE_SSE,
-  FEATURE_SSE2,
-  FEATURE_SSE3,
-  FEATURE_SSSE3,
-  FEATURE_SSE4_1,
-  FEATURE_SSE4_2,
-  FEATURE_AVX,
-  FEATURE_AVX2,
-  FEATURE_AVX512,
-  FEATURE_AVX512SAVE,
-  FEATURE_MOVBE,
-  FEATURE_ADX,
-  FEATURE_EM64T
-};
-
-// The check below for i386 was copied from clang's cpuid.h (__get_cpuid_max).
-// Check motivated by bug reports for OpenSSL crashing on CPUs without CPUID
-// support. Consequently, for i386, the presence of CPUID is checked first
-// via the corresponding eflags bit.
-// Removal of cpuid.h header motivated by PR30384
-// Header cpuid.h and method __get_cpuid_max are not used in llvm, clang, openmp
-// or test-suite, but are used in external projects e.g. libstdcxx
-static bool isCpuIdSupported() {
-#if defined(__GNUC__) || defined(__clang__)
-#if defined(__i386__)
-  int __cpuid_supported;
-  __asm__("  pushfl\n"
-          "  popl   %%eax\n"
-          "  movl   %%eax,%%ecx\n"
-          "  xorl   $0x00200000,%%eax\n"
-          "  pushl  %%eax\n"
-          "  popfl\n"
-          "  pushfl\n"
-          "  popl   %%eax\n"
-          "  movl   $0,%0\n"
-          "  cmpl   %%eax,%%ecx\n"
-          "  je     1f\n"
-          "  movl   $1,%0\n"
-          "1:"
-          : "=r"(__cpuid_supported)
-          :
-          : "eax", "ecx");
-  if (!__cpuid_supported)
-    return false;
-#endif
-  return true;
-#endif
-  return true;
-}
-
-/// getX86CpuIDAndInfo - Execute the specified cpuid and return the 4 values in
-/// the specified arguments.  If we can't run cpuid on the host, return true.
-static bool getX86CpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX,
-                               unsigned *rECX, unsigned *rEDX) {
-#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)
-#if defined(__GNUC__) || defined(__clang__)
-#if defined(__x86_64__)
-  // gcc doesn't know cpuid would clobber ebx/rbx. Preserve it manually.
-  // FIXME: should we save this for Clang?
-  __asm__("movq\t%%rbx, %%rsi\n\t"
-          "cpuid\n\t"
-          "xchgq\t%%rbx, %%rsi\n\t"
-          : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX)
-          : "a"(value));
-#elif defined(__i386__)
-  __asm__("movl\t%%ebx, %%esi\n\t"
-          "cpuid\n\t"
-          "xchgl\t%%ebx, %%esi\n\t"
-          : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX)
-          : "a"(value));
-#else
-  assert(0 && "This method is defined only for x86.");
-#endif
-#elif defined(_MSC_VER)
-  // The MSVC intrinsic is portable across x86 and x64.
-  int registers[4];
-  __cpuid(registers, value);
-  *rEAX = registers[0];
-  *rEBX = registers[1];
-  *rECX = registers[2];
-  *rEDX = registers[3];
-#endif
-  return false;
-#else
-  return true;
-#endif
-}
-
-/// getX86CpuIDAndInfoEx - Execute the specified cpuid with subleaf and return
-/// the 4 values in the specified arguments.  If we can't run cpuid on the host,
-/// return true.
-static bool getX86CpuIDAndInfoEx(unsigned value, unsigned subleaf,
-                                 unsigned *rEAX, unsigned *rEBX, unsigned *rECX,
-                                 unsigned *rEDX) {
-#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)
-#if defined(__x86_64__) || defined(_M_X64)
-#if defined(__GNUC__) || defined(__clang__)
-  // gcc doesn't know cpuid would clobber ebx/rbx. Preseve it manually.
-  // FIXME: should we save this for Clang?
-  __asm__("movq\t%%rbx, %%rsi\n\t"
-          "cpuid\n\t"
-          "xchgq\t%%rbx, %%rsi\n\t"
-          : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX)
-          : "a"(value), "c"(subleaf));
-#elif defined(_MSC_VER)
-  int registers[4];
-  __cpuidex(registers, value, subleaf);
-  *rEAX = registers[0];
-  *rEBX = registers[1];
-  *rECX = registers[2];
-  *rEDX = registers[3];
-#endif
-#elif defined(__i386__) || defined(_M_IX86)
-#if defined(__GNUC__) || defined(__clang__)
-  __asm__("movl\t%%ebx, %%esi\n\t"
-          "cpuid\n\t"
-          "xchgl\t%%ebx, %%esi\n\t"
-          : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX)
-          : "a"(value), "c"(subleaf));
-#elif defined(_MSC_VER)
-  __asm {
-      mov   eax,value
-      mov   ecx,subleaf
-      cpuid
-      mov   esi,rEAX
-      mov   dword ptr [esi],eax
-      mov   esi,rEBX
-      mov   dword ptr [esi],ebx
-      mov   esi,rECX
-      mov   dword ptr [esi],ecx
-      mov   esi,rEDX
-      mov   dword ptr [esi],edx
-  }
-#endif
-#else
-  assert(0 && "This method is defined only for x86.");
-#endif
-  return false;
-#else
-  return true;
-#endif
-}
-
-static bool getX86XCR0(unsigned *rEAX, unsigned *rEDX) {
-#if defined(__GNUC__) || defined(__clang__)
-  // Check xgetbv; this uses a .byte sequence instead of the instruction
-  // directly because older assemblers do not include support for xgetbv and
-  // there is no easy way to conditionally compile based on the assembler used.
-  __asm__(".byte 0x0f, 0x01, 0xd0" : "=a"(*rEAX), "=d"(*rEDX) : "c"(0));
-  return false;
-#elif defined(_MSC_FULL_VER) && defined(_XCR_XFEATURE_ENABLED_MASK)
-  unsigned long long Result = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
-  *rEAX = Result;
-  *rEDX = Result >> 32;
-  return false;
-#else
-  return true;
-#endif
-}
-
-static void detectX86FamilyModel(unsigned EAX, unsigned *Family,
-                                 unsigned *Model) {
-  *Family = (EAX >> 8) & 0xf; // Bits 8 - 11
-  *Model = (EAX >> 4) & 0xf;  // Bits 4 - 7
-  if (*Family == 6 || *Family == 0xf) {
-    if (*Family == 0xf)
-      // Examine extended family ID if family ID is F.
-      *Family += (EAX >> 20) & 0xff; // Bits 20 - 27
-    // Examine extended model ID if family ID is 6 or F.
-    *Model += ((EAX >> 16) & 0xf) << 4; // Bits 16 - 19
-  }
-}
-
-static void
-getIntelProcessorTypeAndSubtype(unsigned int Family, unsigned int Model,
-                                unsigned int Brand_id, unsigned int Features,
-                                unsigned *Type, unsigned *Subtype) {
-  if (Brand_id != 0)
-    return;
-  switch (Family) {
-  case 3:
-    *Type = INTEL_i386;
-    break;
-  case 4:
-    switch (Model) {
-    case 0: // Intel486 DX processors
-    case 1: // Intel486 DX processors
-    case 2: // Intel486 SX processors
-    case 3: // Intel487 processors, IntelDX2 OverDrive processors,
-            // IntelDX2 processors
-    case 4: // Intel486 SL processor
-    case 5: // IntelSX2 processors
-    case 7: // Write-Back Enhanced IntelDX2 processors
-    case 8: // IntelDX4 OverDrive processors, IntelDX4 processors
-    default:
-      *Type = INTEL_i486;
-      break;
-    }
-    break;
-  case 5:
-    switch (Model) {
-    case 1: // Pentium OverDrive processor for Pentium processor (60, 66),
-            // Pentium processors (60, 66)
-    case 2: // Pentium OverDrive processor for Pentium processor (75, 90,
-            // 100, 120, 133), Pentium processors (75, 90, 100, 120, 133,
-            // 150, 166, 200)
-    case 3: // Pentium OverDrive processors for Intel486 processor-based
-            // systems
-      *Type = INTEL_PENTIUM;
-      break;
-    case 4: // Pentium OverDrive processor with MMX technology for Pentium
-            // processor (75, 90, 100, 120, 133), Pentium processor with
-            // MMX technology (166, 200)
-      *Type = INTEL_PENTIUM;
-      *Subtype = INTEL_PENTIUM_MMX;
-      break;
-    default:
-      *Type = INTEL_PENTIUM;
-      break;
-    }
-    break;
-  case 6:
-    switch (Model) {
-    case 0x01: // Pentium Pro processor
-      *Type = INTEL_PENTIUM_PRO;
-      break;
-    case 0x03: // Intel Pentium II OverDrive processor, Pentium II processor,
-               // model 03
-    case 0x05: // Pentium II processor, model 05, Pentium II Xeon processor,
-               // model 05, and Intel Celeron processor, model 05
-    case 0x06: // Celeron processor, model 06
-      *Type = INTEL_PENTIUM_II;
-      break;
-    case 0x07: // Pentium III processor, model 07, and Pentium III Xeon
-               // processor, model 07
-    case 0x08: // Pentium III processor, model 08, Pentium III Xeon processor,
-               // model 08, and Celeron processor, model 08
-    case 0x0a: // Pentium III Xeon processor, model 0Ah
-    case 0x0b: // Pentium III processor, model 0Bh
-      *Type = INTEL_PENTIUM_III;
-      break;
-    case 0x09: // Intel Pentium M processor, Intel Celeron M processor model 09.
-    case 0x0d: // Intel Pentium M processor, Intel Celeron M processor, model
-               // 0Dh. All processors are manufactured using the 90 nm process.
-    case 0x15: // Intel EP80579 Integrated Processor and Intel EP80579
-               // Integrated Processor with Intel QuickAssist Technology
-      *Type = INTEL_PENTIUM_M;
-      break;
-    case 0x0e: // Intel Core Duo processor, Intel Core Solo processor, model
-               // 0Eh. All processors are manufactured using the 65 nm process.
-      *Type = INTEL_CORE_DUO;
-      break;   // yonah
-    case 0x0f: // Intel Core 2 Duo processor, Intel Core 2 Duo mobile
-               // processor, Intel Core 2 Quad processor, Intel Core 2 Quad
-               // mobile processor, Intel Core 2 Extreme processor, Intel
-               // Pentium Dual-Core processor, Intel Xeon processor, model
-               // 0Fh. All processors are manufactured using the 65 nm process.
-    case 0x16: // Intel Celeron processor model 16h. All processors are
-               // manufactured using the 65 nm process
-      *Type = INTEL_CORE2; // "core2"
-      *Subtype = INTEL_CORE2_65;
-      break;
-    case 0x17: // Intel Core 2 Extreme processor, Intel Xeon processor, model
-               // 17h. All processors are manufactured using the 45 nm process.
-               //
-               // 45nm: Penryn , Wolfdale, Yorkfield (XE)
-    case 0x1d: // Intel Xeon processor MP. All processors are manufactured using
-               // the 45 nm process.
-      *Type = INTEL_CORE2; // "penryn"
-      *Subtype = INTEL_CORE2_45;
-      break;
-    case 0x1a: // Intel Core i7 processor and Intel Xeon processor. All
-               // processors are manufactured using the 45 nm process.
-    case 0x1e: // Intel(R) Core(TM) i7 CPU         870  @ 2.93GHz.
-               // As found in a Summer 2010 model iMac.
-    case 0x1f:
-    case 0x2e:             // Nehalem EX
-      *Type = INTEL_COREI7; // "nehalem"
-      *Subtype = INTEL_COREI7_NEHALEM;
-      break;
-    case 0x25: // Intel Core i7, laptop version.
-    case 0x2c: // Intel Core i7 processor and Intel Xeon processor. All
-               // processors are manufactured using the 32 nm process.
-    case 0x2f: // Westmere EX
-      *Type = INTEL_COREI7; // "westmere"
-      *Subtype = INTEL_COREI7_WESTMERE;
-      break;
-    case 0x2a: // Intel Core i7 processor. All processors are manufactured
-               // using the 32 nm process.
-    case 0x2d:
-      *Type = INTEL_COREI7; //"sandybridge"
-      *Subtype = INTEL_COREI7_SANDYBRIDGE;
-      break;
-    case 0x3a:
-    case 0x3e:             // Ivy Bridge EP
-      *Type = INTEL_COREI7; // "ivybridge"
-      *Subtype = INTEL_COREI7_IVYBRIDGE;
-      break;
-
-    // Haswell:
-    case 0x3c:
-    case 0x3f:
-    case 0x45:
-    case 0x46:
-      *Type = INTEL_COREI7; // "haswell"
-      *Subtype = INTEL_COREI7_HASWELL;
-      break;
-
-    // Broadwell:
-    case 0x3d:
-    case 0x47:
-    case 0x4f:
-    case 0x56:
-      *Type = INTEL_COREI7; // "broadwell"
-      *Subtype = INTEL_COREI7_BROADWELL;
-      break;
-
-    // Skylake:
-    case 0x4e:
-      *Type = INTEL_COREI7; // "skylake-avx512"
-      *Subtype = INTEL_COREI7_SKYLAKE_AVX512;
-      break;
-    case 0x5e:
-      *Type = INTEL_COREI7; // "skylake"
-      *Subtype = INTEL_COREI7_SKYLAKE;
-      break;
-
-    case 0x1c: // Most 45 nm Intel Atom processors
-    case 0x26: // 45 nm Atom Lincroft
-    case 0x27: // 32 nm Atom Medfield
-    case 0x35: // 32 nm Atom Midview
-    case 0x36: // 32 nm Atom Midview
-      *Type = INTEL_ATOM;
-      *Subtype = INTEL_ATOM_BONNELL;
-      break; // "bonnell"
-
-    // Atom Silvermont codes from the Intel software optimization guide.
-    case 0x37:
-    case 0x4a:
-    case 0x4d:
-    case 0x5a:
-    case 0x5d:
-    case 0x4c: // really airmont
-      *Type = INTEL_ATOM;
-      *Subtype = INTEL_ATOM_SILVERMONT;
-      break; // "silvermont"
-
-    case 0x57:
-      *Type = INTEL_XEONPHI; // knl
-      *Subtype = INTEL_KNIGHTS_LANDING;
-      break;
-
-    default: // Unknown family 6 CPU, try to guess.
-      if (Features & (1 << FEATURE_AVX512)) {
-        *Type = INTEL_XEONPHI; // knl
-        *Subtype = INTEL_KNIGHTS_LANDING;
-        break;
-      }
-      if (Features & (1 << FEATURE_ADX)) {
-        *Type = INTEL_COREI7;
-        *Subtype = INTEL_COREI7_BROADWELL;
-        break;
-      }
-      if (Features & (1 << FEATURE_AVX2)) {
-        *Type = INTEL_COREI7;
-        *Subtype = INTEL_COREI7_HASWELL;
-        break;
-      }
-      if (Features & (1 << FEATURE_AVX)) {
-        *Type = INTEL_COREI7;
-        *Subtype = INTEL_COREI7_SANDYBRIDGE;
-        break;
-      }
-      if (Features & (1 << FEATURE_SSE4_2)) {
-        if (Features & (1 << FEATURE_MOVBE)) {
-          *Type = INTEL_ATOM;
-          *Subtype = INTEL_ATOM_SILVERMONT;
-        } else {
-          *Type = INTEL_COREI7;
-          *Subtype = INTEL_COREI7_NEHALEM;
-        }
-        break;
-      }
-      if (Features & (1 << FEATURE_SSE4_1)) {
-        *Type = INTEL_CORE2; // "penryn"
-        *Subtype = INTEL_CORE2_45;
-        break;
-      }
-      if (Features & (1 << FEATURE_SSSE3)) {
-        if (Features & (1 << FEATURE_MOVBE)) {
-          *Type = INTEL_ATOM;
-          *Subtype = INTEL_ATOM_BONNELL; // "bonnell"
-        } else {
-          *Type = INTEL_CORE2; // "core2"
-          *Subtype = INTEL_CORE2_65;
-        }
-        break;
-      }
-      if (Features & (1 << FEATURE_EM64T)) {
-        *Type = INTEL_X86_64;
-        break; // x86-64
-      }
-      if (Features & (1 << FEATURE_SSE2)) {
-        *Type = INTEL_PENTIUM_M;
-        break;
-      }
-      if (Features & (1 << FEATURE_SSE)) {
-        *Type = INTEL_PENTIUM_III;
-        break;
-      }
-      if (Features & (1 << FEATURE_MMX)) {
-        *Type = INTEL_PENTIUM_II;
-        break;
-      }
-      *Type = INTEL_PENTIUM_PRO;
-      break;
-    }
-    break;
-  case 15: {
-    switch (Model) {
-    case 0: // Pentium 4 processor, Intel Xeon processor. All processors are
-            // model 00h and manufactured using the 0.18 micron process.
-    case 1: // Pentium 4 processor, Intel Xeon processor, Intel Xeon
-            // processor MP, and Intel Celeron processor. All processors are
-            // model 01h and manufactured using the 0.18 micron process.
-    case 2: // Pentium 4 processor, Mobile Intel Pentium 4 processor - M,
-            // Intel Xeon processor, Intel Xeon processor MP, Intel Celeron
-            // processor, and Mobile Intel Celeron processor. All processors
-            // are model 02h and manufactured using the 0.13 micron process.
-      *Type =
-          ((Features & (1 << FEATURE_EM64T)) ? INTEL_X86_64 : INTEL_PENTIUM_IV);
-      break;
-
-    case 3: // Pentium 4 processor, Intel Xeon processor, Intel Celeron D
-            // processor. All processors are model 03h and manufactured using
-            // the 90 nm process.
-    case 4: // Pentium 4 processor, Pentium 4 processor Extreme Edition,
-            // Pentium D processor, Intel Xeon processor, Intel Xeon
-            // processor MP, Intel Celeron D processor. All processors are
-            // model 04h and manufactured using the 90 nm process.
-    case 6: // Pentium 4 processor, Pentium D processor, Pentium processor
-            // Extreme Edition, Intel Xeon processor, Intel Xeon processor
-            // MP, Intel Celeron D processor. All processors are model 06h
-            // and manufactured using the 65 nm process.
-      *Type =
-          ((Features & (1 << FEATURE_EM64T)) ? INTEL_NOCONA : INTEL_PRESCOTT);
-      break;
-
-    default:
-      *Type =
-          ((Features & (1 << FEATURE_EM64T)) ? INTEL_X86_64 : INTEL_PENTIUM_IV);
-      break;
-    }
-    break;
-  }
-  default:
-    break; /*"generic"*/
-  }
-}
-
-static void getAMDProcessorTypeAndSubtype(unsigned int Family,
-                                          unsigned int Model,
-                                          unsigned int Features,
-                                          unsigned *Type,
-                                          unsigned *Subtype) {
-  // FIXME: this poorly matches the generated SubtargetFeatureKV table.  There
-  // appears to be no way to generate the wide variety of AMD-specific targets
-  // from the information returned from CPUID.
-  switch (Family) {
-  case 4:
-    *Type = AMD_i486;
-    break;
-  case 5:
-    *Type = AMDPENTIUM;
-    switch (Model) {
-    case 6:
-    case 7:
-      *Subtype = AMDPENTIUM_K6;
-      break; // "k6"
-    case 8:
-      *Subtype = AMDPENTIUM_K62;
-      break; // "k6-2"
-    case 9:
-    case 13:
-      *Subtype = AMDPENTIUM_K63;
-      break; // "k6-3"
-    case 10:
-      *Subtype = AMDPENTIUM_GEODE;
-      break; // "geode"
-    }
-    break;
-  case 6:
-    *Type = AMDATHLON;
-    switch (Model) {
-    case 4:
-      *Subtype = AMDATHLON_TBIRD;
-      break; // "athlon-tbird"
-    case 6:
-    case 7:
-    case 8:
-      *Subtype = AMDATHLON_MP;
-      break; // "athlon-mp"
-    case 10:
-      *Subtype = AMDATHLON_XP;
-      break; // "athlon-xp"
-    }
-    break;
-  case 15:
-    *Type = AMDATHLON;
-    if (Features & (1 << FEATURE_SSE3)) {
-      *Subtype = AMDATHLON_K8SSE3;
-      break; // "k8-sse3"
-    }
-    switch (Model) {
-    case 1:
-      *Subtype = AMDATHLON_OPTERON;
-      break; // "opteron"
-    case 5:
-      *Subtype = AMDATHLON_FX;
-      break; // "athlon-fx"; also opteron
-    default:
-      *Subtype = AMDATHLON_64;
-      break; // "athlon64"
-    }
-    break;
-  case 16:
-    *Type = AMDFAM10H; // "amdfam10"
-    switch (Model) {
-    case 2:
-      *Subtype = AMDFAM10H_BARCELONA;
-      break;
-    case 4:
-      *Subtype = AMDFAM10H_SHANGHAI;
-      break;
-    case 8:
-      *Subtype = AMDFAM10H_ISTANBUL;
-      break;
-    }
-    break;
-  case 20:
-    *Type = AMDFAM14H;
-    *Subtype = AMD_BTVER1;
-    break; // "btver1";
-  case 21:
-    *Type = AMDFAM15H;
-    if (!(Features &
-          (1 << FEATURE_AVX))) { // If no AVX support, provide a sane fallback.
-      *Subtype = AMD_BTVER1;
-      break; // "btver1"
-    }
-    if (Model >= 0x50 && Model <= 0x6f) {
-      *Subtype = AMDFAM15H_BDVER4;
-      break; // "bdver4"; 50h-6Fh: Excavator
-    }
-    if (Model >= 0x30 && Model <= 0x3f) {
-      *Subtype = AMDFAM15H_BDVER3;
-      break; // "bdver3"; 30h-3Fh: Steamroller
-    }
-    if (Model >= 0x10 && Model <= 0x1f) {
-      *Subtype = AMDFAM15H_BDVER2;
-      break; // "bdver2"; 10h-1Fh: Piledriver
-    }
-    if (Model <= 0x0f) {
-      *Subtype = AMDFAM15H_BDVER1;
-      break; // "bdver1"; 00h-0Fh: Bulldozer
-    }
-    break;
-  case 22:
-    *Type = AMDFAM16H;
-    if (!(Features &
-          (1 << FEATURE_AVX))) { // If no AVX support provide a sane fallback.
-      *Subtype = AMD_BTVER1;
-      break; // "btver1";
-    }
-    *Subtype = AMD_BTVER2;
-    break; // "btver2"
-  default:
-    break; // "generic"
-  }
-}
-
-static unsigned getAvailableFeatures(unsigned int ECX, unsigned int EDX,
-                                     unsigned MaxLeaf) {
-  unsigned Features = 0;
-  unsigned int EAX = 0, EBX = 0;
-  Features |= (((EDX >> 23) & 1) << FEATURE_MMX);
-  Features |= (((EDX >> 25) & 1) << FEATURE_SSE);
-  Features |= (((EDX >> 26) & 1) << FEATURE_SSE2);
-  Features |= (((ECX >> 0) & 1) << FEATURE_SSE3);
-  Features |= (((ECX >> 9) & 1) << FEATURE_SSSE3);
-  Features |= (((ECX >> 19) & 1) << FEATURE_SSE4_1);
-  Features |= (((ECX >> 20) & 1) << FEATURE_SSE4_2);
-  Features |= (((ECX >> 22) & 1) << FEATURE_MOVBE);
-
-  // If CPUID indicates support for XSAVE, XRESTORE and AVX, and XGETBV
-  // indicates that the AVX registers will be saved and restored on context
-  // switch, then we have full AVX support.
-  const unsigned AVXBits = (1 << 27) | (1 << 28);
-  bool HasAVX = ((ECX & AVXBits) == AVXBits) && !getX86XCR0(&EAX, &EDX) &&
-                ((EAX & 0x6) == 0x6);
-  bool HasAVX512Save = HasAVX && ((EAX & 0xe0) == 0xe0);
-  bool HasLeaf7 =
-      MaxLeaf >= 0x7 && !getX86CpuIDAndInfoEx(0x7, 0x0, &EAX, &EBX, &ECX, &EDX);
-  bool HasADX = HasLeaf7 && ((EBX >> 19) & 1);
-  bool HasAVX2 = HasAVX && HasLeaf7 && (EBX & 0x20);
-  bool HasAVX512 = HasLeaf7 && HasAVX512Save && ((EBX >> 16) & 1);
-  Features |= (HasAVX << FEATURE_AVX);
-  Features |= (HasAVX2 << FEATURE_AVX2);
-  Features |= (HasAVX512 << FEATURE_AVX512);
-  Features |= (HasAVX512Save << FEATURE_AVX512SAVE);
-  Features |= (HasADX << FEATURE_ADX);
-
-  getX86CpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
-  Features |= (((EDX >> 29) & 0x1) << FEATURE_EM64T);
-  return Features;
-}
-
-StringRef sys::getHostCPUName() {
-  unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
-  unsigned MaxLeaf, Vendor;
-
-#if defined(__GNUC__) || defined(__clang__)
-  //FIXME: include cpuid.h from clang or copy __get_cpuid_max here
-  // and simplify it to not invoke __cpuid (like cpu_model.c in
-  // compiler-rt/lib/builtins/cpu_model.c?
-  // Opting for the second option.
-  if(!isCpuIdSupported())
-    return "generic";
-#endif
-  if (getX86CpuIDAndInfo(0, &MaxLeaf, &Vendor, &ECX, &EDX))
-    return "generic";
-  if (getX86CpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX))
-    return "generic";
-
-  unsigned Brand_id = EBX & 0xff;
-  unsigned Family = 0, Model = 0;
-  unsigned Features = 0;
-  detectX86FamilyModel(EAX, &Family, &Model);
-  Features = getAvailableFeatures(ECX, EDX, MaxLeaf);
-
-  unsigned Type = 0;
-  unsigned Subtype = 0;
-
-  if (Vendor == SIG_INTEL) {
-    getIntelProcessorTypeAndSubtype(Family, Model, Brand_id, Features, &Type,
-                                    &Subtype);
-    switch (Type) {
-    case INTEL_i386:
-      return "i386";
-    case INTEL_i486:
-      return "i486";
-    case INTEL_PENTIUM:
-      if (Subtype == INTEL_PENTIUM_MMX)
-        return "pentium-mmx";
-      return "pentium";
-    case INTEL_PENTIUM_PRO:
-      return "pentiumpro";
-    case INTEL_PENTIUM_II:
-      return "pentium2";
-    case INTEL_PENTIUM_III:
-      return "pentium3";
-    case INTEL_PENTIUM_IV:
-      return "pentium4";
-    case INTEL_PENTIUM_M:
-      return "pentium-m";
-    case INTEL_CORE_DUO:
-      return "yonah";
-    case INTEL_CORE2:
-      switch (Subtype) {
-      case INTEL_CORE2_65:
-        return "core2";
-      case INTEL_CORE2_45:
-        return "penryn";
-      default:
-        return "core2";
-      }
-    case INTEL_COREI7:
-      switch (Subtype) {
-      case INTEL_COREI7_NEHALEM:
-        return "nehalem";
-      case INTEL_COREI7_WESTMERE:
-        return "westmere";
-      case INTEL_COREI7_SANDYBRIDGE:
-        return "sandybridge";
-      case INTEL_COREI7_IVYBRIDGE:
-        return "ivybridge";
-      case INTEL_COREI7_HASWELL:
-        return "haswell";
-      case INTEL_COREI7_BROADWELL:
-        return "broadwell";
-      case INTEL_COREI7_SKYLAKE:
-        return "skylake";
-      case INTEL_COREI7_SKYLAKE_AVX512:
-        return "skylake-avx512";
-      default:
-        return "corei7";
-      }
-    case INTEL_ATOM:
-      switch (Subtype) {
-      case INTEL_ATOM_BONNELL:
-        return "bonnell";
-      case INTEL_ATOM_SILVERMONT:
-        return "silvermont";
-      default:
-        return "atom";
-      }
-    case INTEL_XEONPHI:
-      return "knl"; /*update for more variants added*/
-    case INTEL_X86_64:
-      return "x86-64";
-    case INTEL_NOCONA:
-      return "nocona";
-    case INTEL_PRESCOTT:
-      return "prescott";
-    default:
-      return "generic";
-    }
-  } else if (Vendor == SIG_AMD) {
-    getAMDProcessorTypeAndSubtype(Family, Model, Features, &Type, &Subtype);
-    switch (Type) {
-    case AMD_i486:
-      return "i486";
-    case AMDPENTIUM:
-      switch (Subtype) {
-      case AMDPENTIUM_K6:
-        return "k6";
-      case AMDPENTIUM_K62:
-        return "k6-2";
-      case AMDPENTIUM_K63:
-        return "k6-3";
-      case AMDPENTIUM_GEODE:
-        return "geode";
-      default:
-        return "pentium";
-      }
-    case AMDATHLON:
-      switch (Subtype) {
-      case AMDATHLON_TBIRD:
-        return "athlon-tbird";
-      case AMDATHLON_MP:
-        return "athlon-mp";
-      case AMDATHLON_XP:
-        return "athlon-xp";
-      case AMDATHLON_K8SSE3:
-        return "k8-sse3";
-      case AMDATHLON_OPTERON:
-        return "opteron";
-      case AMDATHLON_FX:
-        return "athlon-fx";
-      case AMDATHLON_64:
-        return "athlon64";
-      default:
-        return "athlon";
-      }
-    case AMDFAM10H:
-      if(Subtype == AMDFAM10H_BARCELONA)
-        return "barcelona";
-      return "amdfam10";
-    case AMDFAM14H:
-      return "btver1";
-    case AMDFAM15H:
-      switch (Subtype) {
-      case AMDFAM15H_BDVER1:
-        return "bdver1";
-      case AMDFAM15H_BDVER2:
-        return "bdver2";
-      case AMDFAM15H_BDVER3:
-        return "bdver3";
-      case AMDFAM15H_BDVER4:
-        return "bdver4";
-      case AMD_BTVER1:
-        return "btver1";
-      default:
-        return "amdfam15";
-      }
-    case AMDFAM16H:
-      switch (Subtype) {
-      case AMD_BTVER1:
-        return "btver1";
-      case AMD_BTVER2:
-        return "btver2";
-      default:
-        return "amdfam16";
-      }
-    default:
-      return "generic";
-    }
-  }
-  return "generic";
-}
-
-#elif defined(__APPLE__) && (defined(__ppc__) || defined(__powerpc__))
-StringRef sys::getHostCPUName() {
-  host_basic_info_data_t hostInfo;
-  mach_msg_type_number_t infoCount;
-
-  infoCount = HOST_BASIC_INFO_COUNT;
-  host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&hostInfo,
-            &infoCount);
-
-  if (hostInfo.cpu_type != CPU_TYPE_POWERPC)
-    return "generic";
-
-  switch (hostInfo.cpu_subtype) {
-  case CPU_SUBTYPE_POWERPC_601:
-    return "601";
-  case CPU_SUBTYPE_POWERPC_602:
-    return "602";
-  case CPU_SUBTYPE_POWERPC_603:
-    return "603";
-  case CPU_SUBTYPE_POWERPC_603e:
-    return "603e";
-  case CPU_SUBTYPE_POWERPC_603ev:
-    return "603ev";
-  case CPU_SUBTYPE_POWERPC_604:
-    return "604";
-  case CPU_SUBTYPE_POWERPC_604e:
-    return "604e";
-  case CPU_SUBTYPE_POWERPC_620:
-    return "620";
-  case CPU_SUBTYPE_POWERPC_750:
-    return "750";
-  case CPU_SUBTYPE_POWERPC_7400:
-    return "7400";
-  case CPU_SUBTYPE_POWERPC_7450:
-    return "7450";
-  case CPU_SUBTYPE_POWERPC_970:
-    return "970";
-  default:;
-  }
-
-  return "generic";
-}
-#elif defined(__linux__) && (defined(__ppc__) || defined(__powerpc__))
-StringRef sys::getHostCPUName() {
-  // Access to the Processor Version Register (PVR) on PowerPC is privileged,
-  // and so we must use an operating-system interface to determine the current
-  // processor type. On Linux, this is exposed through the /proc/cpuinfo file.
-  const char *generic = "generic";
-
-  // The cpu line is second (after the 'processor: 0' line), so if this
-  // buffer is too small then something has changed (or is wrong).
-  char buffer[1024];
-  ssize_t CPUInfoSize = readCpuInfo(buffer, sizeof(buffer));
-  if (CPUInfoSize == -1)
-    return generic;
-
-  const char *CPUInfoStart = buffer;
-  const char *CPUInfoEnd = buffer + CPUInfoSize;
-
-  const char *CIP = CPUInfoStart;
-
-  const char *CPUStart = 0;
-  size_t CPULen = 0;
-
-  // We need to find the first line which starts with cpu, spaces, and a colon.
-  // After the colon, there may be some additional spaces and then the cpu type.
-  while (CIP < CPUInfoEnd && CPUStart == 0) {
-    if (CIP < CPUInfoEnd && *CIP == '\n')
-      ++CIP;
-
-    if (CIP < CPUInfoEnd && *CIP == 'c') {
-      ++CIP;
-      if (CIP < CPUInfoEnd && *CIP == 'p') {
-        ++CIP;
-        if (CIP < CPUInfoEnd && *CIP == 'u') {
-          ++CIP;
-          while (CIP < CPUInfoEnd && (*CIP == ' ' || *CIP == '\t'))
-            ++CIP;
-
-          if (CIP < CPUInfoEnd && *CIP == ':') {
-            ++CIP;
-            while (CIP < CPUInfoEnd && (*CIP == ' ' || *CIP == '\t'))
-              ++CIP;
-
-            if (CIP < CPUInfoEnd) {
-              CPUStart = CIP;
-              while (CIP < CPUInfoEnd && (*CIP != ' ' && *CIP != '\t' &&
-                                          *CIP != ',' && *CIP != '\n'))
-                ++CIP;
-              CPULen = CIP - CPUStart;
-            }
-          }
-        }
-      }
-    }
-
-    if (CPUStart == 0)
-      while (CIP < CPUInfoEnd && *CIP != '\n')
-        ++CIP;
-  }
-
-  if (CPUStart == 0)
-    return generic;
-
-  return StringSwitch<const char *>(StringRef(CPUStart, CPULen))
-      .Case("604e", "604e")
-      .Case("604", "604")
-      .Case("7400", "7400")
-      .Case("7410", "7400")
-      .Case("7447", "7400")
-      .Case("7455", "7450")
-      .Case("G4", "g4")
-      .Case("POWER4", "970")
-      .Case("PPC970FX", "970")
-      .Case("PPC970MP", "970")
-      .Case("G5", "g5")
-      .Case("POWER5", "g5")
-      .Case("A2", "a2")
-      .Case("POWER6", "pwr6")
-      .Case("POWER7", "pwr7")
-      .Case("POWER8", "pwr8")
-      .Case("POWER8E", "pwr8")
-      .Case("POWER9", "pwr9")
-      .Default(generic);
-}
-#elif defined(__linux__) && defined(__arm__)
-StringRef sys::getHostCPUName() {
-  // The cpuid register on arm is not accessible from user space. On Linux,
-  // it is exposed through the /proc/cpuinfo file.
-
-  // Read 1024 bytes from /proc/cpuinfo, which should contain the CPU part line
-  // in all cases.
-  char buffer[1024];
-  ssize_t CPUInfoSize = readCpuInfo(buffer, sizeof(buffer));
-  if (CPUInfoSize == -1)
-    return "generic";
-
-  StringRef Str(buffer, CPUInfoSize);
-
-  SmallVector<StringRef, 32> Lines;
-  Str.split(Lines, "\n");
-
-  // Look for the CPU implementer line.
-  StringRef Implementer;
-  for (unsigned I = 0, E = Lines.size(); I != E; ++I)
-    if (Lines[I].startswith("CPU implementer"))
-      Implementer = Lines[I].substr(15).ltrim("\t :");
-
-  if (Implementer == "0x41") // ARM Ltd.
-    // Look for the CPU part line.
-    for (unsigned I = 0, E = Lines.size(); I != E; ++I)
-      if (Lines[I].startswith("CPU part"))
-        // The CPU part is a 3 digit hexadecimal number with a 0x prefix. The
-        // values correspond to the "Part number" in the CP15/c0 register. The
-        // contents are specified in the various processor manuals.
-        return StringSwitch<const char *>(Lines[I].substr(8).ltrim("\t :"))
-            .Case("0x926", "arm926ej-s")
-            .Case("0xb02", "mpcore")
-            .Case("0xb36", "arm1136j-s")
-            .Case("0xb56", "arm1156t2-s")
-            .Case("0xb76", "arm1176jz-s")
-            .Case("0xc08", "cortex-a8")
-            .Case("0xc09", "cortex-a9")
-            .Case("0xc0f", "cortex-a15")
-            .Case("0xc20", "cortex-m0")
-            .Case("0xc23", "cortex-m3")
-            .Case("0xc24", "cortex-m4")
-            .Default("generic");
-
-  if (Implementer == "0x51") // Qualcomm Technologies, Inc.
-    // Look for the CPU part line.
-    for (unsigned I = 0, E = Lines.size(); I != E; ++I)
-      if (Lines[I].startswith("CPU part"))
-        // The CPU part is a 3 digit hexadecimal number with a 0x prefix. The
-        // values correspond to the "Part number" in the CP15/c0 register. The
-        // contents are specified in the various processor manuals.
-        return StringSwitch<const char *>(Lines[I].substr(8).ltrim("\t :"))
-            .Case("0x06f", "krait") // APQ8064
-            .Default("generic");
-
-  return "generic";
-}
-#elif defined(__linux__) && defined(__s390x__)
-StringRef sys::getHostCPUName() {
-  // STIDP is a privileged operation, so use /proc/cpuinfo instead.
-
-  // The "processor 0:" line comes after a fair amount of other information,
-  // including a cache breakdown, but this should be plenty.
-  char buffer[2048];
-  ssize_t CPUInfoSize = readCpuInfo(buffer, sizeof(buffer));
-  if (CPUInfoSize == -1)
-    return "generic";
-
-  StringRef Str(buffer, CPUInfoSize);
-  SmallVector<StringRef, 32> Lines;
-  Str.split(Lines, "\n");
-
-  // Look for the CPU features.
-  SmallVector<StringRef, 32> CPUFeatures;
-  for (unsigned I = 0, E = Lines.size(); I != E; ++I)
-    if (Lines[I].startswith("features")) {
-      size_t Pos = Lines[I].find(":");
-      if (Pos != StringRef::npos) {
-        Lines[I].drop_front(Pos + 1).split(CPUFeatures, ' ');
-        break;
-      }
-    }
-
-  // We need to check for the presence of vector support independently of
-  // the machine type, since we may only use the vector register set when
-  // supported by the kernel (and hypervisor).
-  bool HaveVectorSupport = false;
-  for (unsigned I = 0, E = CPUFeatures.size(); I != E; ++I) {
-    if (CPUFeatures[I] == "vx")
-      HaveVectorSupport = true;
-  }
-
-  // Now check the processor machine type.
-  for (unsigned I = 0, E = Lines.size(); I != E; ++I) {
-    if (Lines[I].startswith("processor ")) {
-      size_t Pos = Lines[I].find("machine = ");
-      if (Pos != StringRef::npos) {
-        Pos += sizeof("machine = ") - 1;
-        unsigned int Id;
-        if (!Lines[I].drop_front(Pos).getAsInteger(10, Id)) {
-          if (Id >= 2964 && HaveVectorSupport)
-            return "z13";
-          if (Id >= 2827)
-            return "zEC12";
-          if (Id >= 2817)
-            return "z196";
-        }
-      }
-      break;
-    }
-  }
-
-  return "generic";
-}
-#else
-StringRef sys::getHostCPUName() { return "generic"; }
-#endif
-
-#if defined(__linux__) && defined(__x86_64__)
-// On Linux, the number of physical cores can be computed from /proc/cpuinfo,
-// using the number of unique physical/core id pairs. The following
-// implementation reads the /proc/cpuinfo format on an x86_64 system.
-static int computeHostNumPhysicalCores() {
-  // Read /proc/cpuinfo as a stream (until EOF reached). It cannot be
-  // mmapped because it appears to have 0 size.
-  llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> Text =
-      llvm::MemoryBuffer::getFileAsStream("/proc/cpuinfo");
-  if (std::error_code EC = Text.getError()) {
-    llvm::errs() << "Can't read "
-                 << "/proc/cpuinfo: " << EC.message() << "\n";
-  }
-  SmallVector<StringRef, 8> strs;
-  (*Text)->getBuffer().split(strs, "\n", /*MaxSplit=*/-1,
-                             /*KeepEmpty=*/false);
-  int CurPhysicalId = -1;
-  int CurCoreId = -1;
-  SmallSet<std::pair<int, int>, 32> UniqueItems;
-  for (auto &Line : strs) {
-    Line = Line.trim();
-    if (!Line.startswith("physical id") && !Line.startswith("core id"))
-      continue;
-    std::pair<StringRef, StringRef> Data = Line.split(':');
-    auto Name = Data.first.trim();
-    auto Val = Data.second.trim();
-    if (Name == "physical id") {
-      assert(CurPhysicalId == -1 &&
-             "Expected a core id before seeing another physical id");
-      Val.getAsInteger(10, CurPhysicalId);
-    }
-    if (Name == "core id") {
-      assert(CurCoreId == -1 &&
-             "Expected a physical id before seeing another core id");
-      Val.getAsInteger(10, CurCoreId);
-    }
-    if (CurPhysicalId != -1 && CurCoreId != -1) {
-      UniqueItems.insert(std::make_pair(CurPhysicalId, CurCoreId));
-      CurPhysicalId = -1;
-      CurCoreId = -1;
-    }
-  }
-  return UniqueItems.size();
-}
-#elif defined(__APPLE__) && defined(__x86_64__)
-#include <sys/param.h>
-#include <sys/sysctl.h>
-
-// Gets the number of *physical cores* on the machine.
-static int computeHostNumPhysicalCores() {
-  uint32_t count;
-  size_t len = sizeof(count);
-  sysctlbyname("hw.physicalcpu", &count, &len, NULL, 0);
-  if (count < 1) {
-    int nm[2];
-    nm[0] = CTL_HW;
-    nm[1] = HW_AVAILCPU;
-    sysctl(nm, 2, &count, &len, NULL, 0);
-    if (count < 1)
-      return -1;
-  }
-  return count;
-}
-#else
-// On other systems, return -1 to indicate unknown.
-static int computeHostNumPhysicalCores() { return -1; }
-#endif
-
-int sys::getHostNumPhysicalCores() {
-  static int NumCores = computeHostNumPhysicalCores();
-  return NumCores;
-}
-
-#if defined(__i386__) || defined(_M_IX86) || \
-    defined(__x86_64__) || defined(_M_X64)
-bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
-  unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
-  unsigned MaxLevel;
-  union {
-    unsigned u[3];
-    char c[12];
-  } text;
-
-  if (getX86CpuIDAndInfo(0, &MaxLevel, text.u + 0, text.u + 2, text.u + 1) ||
-      MaxLevel < 1)
-    return false;
-
-  getX86CpuIDAndInfo(1, &EAX, &EBX, &ECX, &EDX);
-
-  Features["cmov"] = (EDX >> 15) & 1;
-  Features["mmx"] = (EDX >> 23) & 1;
-  Features["sse"] = (EDX >> 25) & 1;
-  Features["sse2"] = (EDX >> 26) & 1;
-  Features["sse3"] = (ECX >> 0) & 1;
-  Features["ssse3"] = (ECX >> 9) & 1;
-  Features["sse4.1"] = (ECX >> 19) & 1;
-  Features["sse4.2"] = (ECX >> 20) & 1;
-
-  Features["pclmul"] = (ECX >> 1) & 1;
-  Features["cx16"] = (ECX >> 13) & 1;
-  Features["movbe"] = (ECX >> 22) & 1;
-  Features["popcnt"] = (ECX >> 23) & 1;
-  Features["aes"] = (ECX >> 25) & 1;
-  Features["rdrnd"] = (ECX >> 30) & 1;
-
-  // If CPUID indicates support for XSAVE, XRESTORE and AVX, and XGETBV
-  // indicates that the AVX registers will be saved and restored on context
-  // switch, then we have full AVX support.
-  bool HasAVXSave = ((ECX >> 27) & 1) && ((ECX >> 28) & 1) &&
-                    !getX86XCR0(&EAX, &EDX) && ((EAX & 0x6) == 0x6);
-  Features["avx"] = HasAVXSave;
-  Features["fma"] = HasAVXSave && (ECX >> 12) & 1;
-  Features["f16c"] = HasAVXSave && (ECX >> 29) & 1;
-
-  // Only enable XSAVE if OS has enabled support for saving YMM state.
-  Features["xsave"] = HasAVXSave && (ECX >> 26) & 1;
-
-  // AVX512 requires additional context to be saved by the OS.
-  bool HasAVX512Save = HasAVXSave && ((EAX & 0xe0) == 0xe0);
-
-  unsigned MaxExtLevel;
-  getX86CpuIDAndInfo(0x80000000, &MaxExtLevel, &EBX, &ECX, &EDX);
-
-  bool HasExtLeaf1 = MaxExtLevel >= 0x80000001 &&
-                     !getX86CpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
-  Features["lzcnt"] = HasExtLeaf1 && ((ECX >> 5) & 1);
-  Features["sse4a"] = HasExtLeaf1 && ((ECX >> 6) & 1);
-  Features["prfchw"] = HasExtLeaf1 && ((ECX >> 8) & 1);
-  Features["xop"] = HasExtLeaf1 && ((ECX >> 11) & 1) && HasAVXSave;
-  Features["fma4"] = HasExtLeaf1 && ((ECX >> 16) & 1) && HasAVXSave;
-  Features["tbm"] = HasExtLeaf1 && ((ECX >> 21) & 1);
-  Features["mwaitx"] = HasExtLeaf1 && ((ECX >> 29) & 1);
-
-  bool HasLeaf7 =
-      MaxLevel >= 7 && !getX86CpuIDAndInfoEx(0x7, 0x0, &EAX, &EBX, &ECX, &EDX);
-
-  // AVX2 is only supported if we have the OS save support from AVX.
-  Features["avx2"] = HasAVXSave && HasLeaf7 && ((EBX >> 5) & 1);
-
-  Features["fsgsbase"] = HasLeaf7 && ((EBX >> 0) & 1);
-  Features["sgx"] = HasLeaf7 && ((EBX >> 2) & 1);
-  Features["bmi"] = HasLeaf7 && ((EBX >> 3) & 1);
-  Features["hle"] = HasLeaf7 && ((EBX >> 4) & 1);
-  Features["bmi2"] = HasLeaf7 && ((EBX >> 8) & 1);
-  Features["invpcid"] = HasLeaf7 && ((EBX >> 10) & 1);
-  Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1);
-  Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1);
-  Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1);
-  Features["smap"] = HasLeaf7 && ((EBX >> 20) & 1);
-  Features["pcommit"] = HasLeaf7 && ((EBX >> 22) & 1);
-  Features["clflushopt"] = HasLeaf7 && ((EBX >> 23) & 1);
-  Features["clwb"] = HasLeaf7 && ((EBX >> 24) & 1);
-  Features["sha"] = HasLeaf7 && ((EBX >> 29) & 1);
-
-  // AVX512 is only supported if the OS supports the context save for it.
-  Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save;
-  Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save;
-  Features["avx512ifma"] = HasLeaf7 && ((EBX >> 21) & 1) && HasAVX512Save;
-  Features["avx512pf"] = HasLeaf7 && ((EBX >> 26) & 1) && HasAVX512Save;
-  Features["avx512er"] = HasLeaf7 && ((EBX >> 27) & 1) && HasAVX512Save;
-  Features["avx512cd"] = HasLeaf7 && ((EBX >> 28) & 1) && HasAVX512Save;
-  Features["avx512bw"] = HasLeaf7 && ((EBX >> 30) & 1) && HasAVX512Save;
-  Features["avx512vl"] = HasLeaf7 && ((EBX >> 31) & 1) && HasAVX512Save;
-
-  Features["prefetchwt1"] = HasLeaf7 && (ECX & 1);
-  Features["avx512vbmi"] = HasLeaf7 && ((ECX >> 1) & 1) && HasAVX512Save;
-  // Enable protection keys
-  Features["pku"] = HasLeaf7 && ((ECX >> 4) & 1);
-
-  bool HasLeafD = MaxLevel >= 0xd &&
-                  !getX86CpuIDAndInfoEx(0xd, 0x1, &EAX, &EBX, &ECX, &EDX);
-
-  // Only enable XSAVE if OS has enabled support for saving YMM state.
-  Features["xsaveopt"] = HasAVXSave && HasLeafD && ((EAX >> 0) & 1);
-  Features["xsavec"] = HasAVXSave && HasLeafD && ((EAX >> 1) & 1);
-  Features["xsaves"] = HasAVXSave && HasLeafD && ((EAX >> 3) & 1);
-
-  return true;
-}
-#elif defined(__linux__) && (defined(__arm__) || defined(__aarch64__))
-bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
-  // Read 1024 bytes from /proc/cpuinfo, which should contain the Features line
-  // in all cases.
-  char buffer[1024];
-  ssize_t CPUInfoSize = readCpuInfo(buffer, sizeof(buffer));
-  if (CPUInfoSize == -1)
-    return false;
-
-  StringRef Str(buffer, CPUInfoSize);
-
-  SmallVector<StringRef, 32> Lines;
-  Str.split(Lines, "\n");
-
-  SmallVector<StringRef, 32> CPUFeatures;
-
-  // Look for the CPU features.
-  for (unsigned I = 0, E = Lines.size(); I != E; ++I)
-    if (Lines[I].startswith("Features")) {
-      Lines[I].split(CPUFeatures, ' ');
-      break;
-    }
-
-#if defined(__aarch64__)
-  // Keep track of which crypto features we have seen
-  enum { CAP_AES = 0x1, CAP_PMULL = 0x2, CAP_SHA1 = 0x4, CAP_SHA2 = 0x8 };
-  uint32_t crypto = 0;
-#endif
-
-  for (unsigned I = 0, E = CPUFeatures.size(); I != E; ++I) {
-    StringRef LLVMFeatureStr = StringSwitch<StringRef>(CPUFeatures[I])
-#if defined(__aarch64__)
-                                   .Case("asimd", "neon")
-                                   .Case("fp", "fp-armv8")
-                                   .Case("crc32", "crc")
-#else
-                                   .Case("half", "fp16")
-                                   .Case("neon", "neon")
-                                   .Case("vfpv3", "vfp3")
-                                   .Case("vfpv3d16", "d16")
-                                   .Case("vfpv4", "vfp4")
-                                   .Case("idiva", "hwdiv-arm")
-                                   .Case("idivt", "hwdiv")
-#endif
-                                   .Default("");
-
-#if defined(__aarch64__)
-    // We need to check crypto separately since we need all of the crypto
-    // extensions to enable the subtarget feature
-    if (CPUFeatures[I] == "aes")
-      crypto |= CAP_AES;
-    else if (CPUFeatures[I] == "pmull")
-      crypto |= CAP_PMULL;
-    else if (CPUFeatures[I] == "sha1")
-      crypto |= CAP_SHA1;
-    else if (CPUFeatures[I] == "sha2")
-      crypto |= CAP_SHA2;
-#endif
-
-    if (LLVMFeatureStr != "")
-      Features[LLVMFeatureStr] = true;
-  }
-
-#if defined(__aarch64__)
-  // If we have all crypto bits we can add the feature
-  if (crypto == (CAP_AES | CAP_PMULL | CAP_SHA1 | CAP_SHA2))
-    Features["crypto"] = true;
-#endif
-
-  return true;
-}
-#else
-bool sys::getHostCPUFeatures(StringMap<bool> &Features) { return false; }
-#endif
-
-std::string sys::getProcessTriple() {
-  Triple PT(Triple::normalize(LLVM_HOST_TRIPLE));
-
-  if (sizeof(void *) == 8 && PT.isArch32Bit())
-    PT = PT.get64BitArchVariant();
-  if (sizeof(void *) == 4 && PT.isArch64Bit())
-    PT = PT.get32BitArchVariant();
-
-  return PT.str();
-}
diff --git a/third_party/llvm-subzero/lib/Support/TargetParser.cpp b/third_party/llvm-subzero/lib/Support/TargetParser.cpp
deleted file mode 100644
index 42fab67..0000000
--- a/third_party/llvm-subzero/lib/Support/TargetParser.cpp
+++ /dev/null
@@ -1,837 +0,0 @@
-//===-- TargetParser - Parser for target features ---------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements a target parser to recognise hardware features such as
-// FPU/CPU/ARCH names as well as specific support such as HDIV, etc.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/ARMBuildAttributes.h"
-#include "llvm/Support/TargetParser.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/StringSwitch.h"
-#include "llvm/ADT/Twine.h"
-#include <cctype>
-
-using namespace llvm;
-using namespace ARM;
-using namespace AArch64;
-
-namespace {
-
-// List of canonical FPU names (use getFPUSynonym) and which architectural
-// features they correspond to (use getFPUFeatures).
-// FIXME: TableGen this.
-// The entries must appear in the order listed in ARM::FPUKind for correct indexing
-static const struct {
-  const char *NameCStr;
-  size_t NameLength;
-  ARM::FPUKind ID;
-  ARM::FPUVersion FPUVersion;
-  ARM::NeonSupportLevel NeonSupport;
-  ARM::FPURestriction Restriction;
-
-  StringRef getName() const { return StringRef(NameCStr, NameLength); }
-} FPUNames[] = {
-#define ARM_FPU(NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION) \
-  { NAME, sizeof(NAME) - 1, KIND, VERSION, NEON_SUPPORT, RESTRICTION },
-#include "llvm/Support/ARMTargetParser.def"
-};
-
-// List of canonical arch names (use getArchSynonym).
-// This table also provides the build attribute fields for CPU arch
-// and Arch ID, according to the Addenda to the ARM ABI, chapters
-// 2.4 and 2.3.5.2 respectively.
-// FIXME: SubArch values were simplified to fit into the expectations
-// of the triples and are not conforming with their official names.
-// Check to see if the expectation should be changed.
-// FIXME: TableGen this.
-template <typename T> struct ArchNames {
-  const char *NameCStr;
-  size_t NameLength;
-  const char *CPUAttrCStr;
-  size_t CPUAttrLength;
-  const char *SubArchCStr;
-  size_t SubArchLength;
-  unsigned DefaultFPU;
-  unsigned ArchBaseExtensions;
-  T ID;
-  ARMBuildAttrs::CPUArch ArchAttr; // Arch ID in build attributes.
-
-  StringRef getName() const { return StringRef(NameCStr, NameLength); }
-
-  // CPU class in build attributes.
-  StringRef getCPUAttr() const { return StringRef(CPUAttrCStr, CPUAttrLength); }
-
-  // Sub-Arch name.
-  StringRef getSubArch() const { return StringRef(SubArchCStr, SubArchLength); }
-};
-ArchNames<ARM::ArchKind> ARCHNames[] = {
-#define ARM_ARCH(NAME, ID, CPU_ATTR, SUB_ARCH, ARCH_ATTR, ARCH_FPU, ARCH_BASE_EXT)       \
-  {NAME, sizeof(NAME) - 1, CPU_ATTR, sizeof(CPU_ATTR) - 1, SUB_ARCH,       \
-   sizeof(SUB_ARCH) - 1, ARCH_FPU, ARCH_BASE_EXT, ID, ARCH_ATTR},
-#include "llvm/Support/ARMTargetParser.def"
-};
-
-ArchNames<AArch64::ArchKind> AArch64ARCHNames[] = {
- #define AARCH64_ARCH(NAME, ID, CPU_ATTR, SUB_ARCH, ARCH_ATTR, ARCH_FPU, ARCH_BASE_EXT)       \
-   {NAME, sizeof(NAME) - 1, CPU_ATTR, sizeof(CPU_ATTR) - 1, SUB_ARCH,       \
-    sizeof(SUB_ARCH) - 1, ARCH_FPU, ARCH_BASE_EXT, AArch64::ArchKind::ID, ARCH_ATTR},
- #include "llvm/Support/AArch64TargetParser.def"
- };
-
-
-// List of Arch Extension names.
-// FIXME: TableGen this.
-static const struct {
-  const char *NameCStr;
-  size_t NameLength;
-  unsigned ID;
-  const char *Feature;
-  const char *NegFeature;
-
-  StringRef getName() const { return StringRef(NameCStr, NameLength); }
-} ARCHExtNames[] = {
-#define ARM_ARCH_EXT_NAME(NAME, ID, FEATURE, NEGFEATURE) \
-  { NAME, sizeof(NAME) - 1, ID, FEATURE, NEGFEATURE },
-#include "llvm/Support/ARMTargetParser.def"
-},AArch64ARCHExtNames[] = {
-#define AARCH64_ARCH_EXT_NAME(NAME, ID, FEATURE, NEGFEATURE) \
-  { NAME, sizeof(NAME) - 1, ID, FEATURE, NEGFEATURE },
-#include "llvm/Support/AArch64TargetParser.def"
-};
-
-// List of HWDiv names (use getHWDivSynonym) and which architectural
-// features they correspond to (use getHWDivFeatures).
-// FIXME: TableGen this.
-static const struct {
-  const char *NameCStr;
-  size_t NameLength;
-  unsigned ID;
-
-  StringRef getName() const { return StringRef(NameCStr, NameLength); }
-} HWDivNames[] = {
-#define ARM_HW_DIV_NAME(NAME, ID) { NAME, sizeof(NAME) - 1, ID },
-#include "llvm/Support/ARMTargetParser.def"
-};
-
-// List of CPU names and their arches.
-// The same CPU can have multiple arches and can be default on multiple arches.
-// When finding the Arch for a CPU, first-found prevails. Sort them accordingly.
-// When this becomes table-generated, we'd probably need two tables.
-// FIXME: TableGen this.
-template <typename T> struct CpuNames {
-  const char *NameCStr;
-  size_t NameLength;
-  T ArchID;
-  bool Default; // is $Name the default CPU for $ArchID ?
-  unsigned DefaultExtensions;
-
-  StringRef getName() const { return StringRef(NameCStr, NameLength); }
-};
-CpuNames<ARM::ArchKind> CPUNames[] = {
-#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
-  { NAME, sizeof(NAME) - 1, ID, IS_DEFAULT, DEFAULT_EXT },
-#include "llvm/Support/ARMTargetParser.def"
-};
-
-CpuNames<AArch64::ArchKind> AArch64CPUNames[] = {
- #define AARCH64_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
-   { NAME, sizeof(NAME) - 1, AArch64::ArchKind::ID, IS_DEFAULT, DEFAULT_EXT },
- #include "llvm/Support/AArch64TargetParser.def"
- };
-
-} // namespace
-
-// ======================================================= //
-// Information by ID
-// ======================================================= //
-
-StringRef llvm::ARM::getFPUName(unsigned FPUKind) {
-  if (FPUKind >= ARM::FK_LAST)
-    return StringRef();
-  return FPUNames[FPUKind].getName();
-}
-
-unsigned llvm::ARM::getFPUVersion(unsigned FPUKind) {
-  if (FPUKind >= ARM::FK_LAST)
-    return 0;
-  return FPUNames[FPUKind].FPUVersion;
-}
-
-unsigned llvm::ARM::getFPUNeonSupportLevel(unsigned FPUKind) {
-  if (FPUKind >= ARM::FK_LAST)
-    return 0;
-  return FPUNames[FPUKind].NeonSupport;
-}
-
-unsigned llvm::ARM::getFPURestriction(unsigned FPUKind) {
-  if (FPUKind >= ARM::FK_LAST)
-    return 0;
-  return FPUNames[FPUKind].Restriction;
-}
-
-unsigned llvm::ARM::getDefaultFPU(StringRef CPU, unsigned ArchKind) {
-  if (CPU == "generic")
-    return ARCHNames[ArchKind].DefaultFPU;
-
-  return StringSwitch<unsigned>(CPU)
-#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
-    .Case(NAME, DEFAULT_FPU)
-#include "llvm/Support/ARMTargetParser.def"
-    .Default(ARM::FK_INVALID);
-}
-
-unsigned llvm::ARM::getDefaultExtensions(StringRef CPU, unsigned ArchKind) {
-  if (CPU == "generic")
-    return ARCHNames[ArchKind].ArchBaseExtensions;
-
-  return StringSwitch<unsigned>(CPU)
-#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
-    .Case(NAME, ARCHNames[ID].ArchBaseExtensions | DEFAULT_EXT)
-#include "llvm/Support/ARMTargetParser.def"
-    .Default(ARM::AEK_INVALID);
-}
-
-bool llvm::ARM::getHWDivFeatures(unsigned HWDivKind,
-                                 std::vector<StringRef> &Features) {
-
-  if (HWDivKind == ARM::AEK_INVALID)
-    return false;
-
-  if (HWDivKind & ARM::AEK_HWDIVARM)
-    Features.push_back("+hwdiv-arm");
-  else
-    Features.push_back("-hwdiv-arm");
-
-  if (HWDivKind & ARM::AEK_HWDIV)
-    Features.push_back("+hwdiv");
-  else
-    Features.push_back("-hwdiv");
-
-  return true;
-}
-
-bool llvm::ARM::getExtensionFeatures(unsigned Extensions,
-                                     std::vector<StringRef> &Features) {
-
-  if (Extensions == ARM::AEK_INVALID)
-    return false;
-
-  if (Extensions & ARM::AEK_CRC)
-    Features.push_back("+crc");
-  else
-    Features.push_back("-crc");
-
-  if (Extensions & ARM::AEK_DSP)
-    Features.push_back("+dsp");
-  else
-    Features.push_back("-dsp");
-
-  return getHWDivFeatures(Extensions, Features);
-}
-
-bool llvm::ARM::getFPUFeatures(unsigned FPUKind,
-                               std::vector<StringRef> &Features) {
-
-  if (FPUKind >= ARM::FK_LAST || FPUKind == ARM::FK_INVALID)
-    return false;
-
-  // fp-only-sp and d16 subtarget features are independent of each other, so we
-  // must enable/disable both.
-  switch (FPUNames[FPUKind].Restriction) {
-  case ARM::FR_SP_D16:
-    Features.push_back("+fp-only-sp");
-    Features.push_back("+d16");
-    break;
-  case ARM::FR_D16:
-    Features.push_back("-fp-only-sp");
-    Features.push_back("+d16");
-    break;
-  case ARM::FR_None:
-    Features.push_back("-fp-only-sp");
-    Features.push_back("-d16");
-    break;
-  }
-
-  // FPU version subtarget features are inclusive of lower-numbered ones, so
-  // enable the one corresponding to this version and disable all that are
-  // higher. We also have to make sure to disable fp16 when vfp4 is disabled,
-  // as +vfp4 implies +fp16 but -vfp4 does not imply -fp16.
-  switch (FPUNames[FPUKind].FPUVersion) {
-  case ARM::FV_VFPV5:
-    Features.push_back("+fp-armv8");
-    break;
-  case ARM::FV_VFPV4:
-    Features.push_back("+vfp4");
-    Features.push_back("-fp-armv8");
-    break;
-  case ARM::FV_VFPV3_FP16:
-    Features.push_back("+vfp3");
-    Features.push_back("+fp16");
-    Features.push_back("-vfp4");
-    Features.push_back("-fp-armv8");
-    break;
-  case ARM::FV_VFPV3:
-    Features.push_back("+vfp3");
-    Features.push_back("-fp16");
-    Features.push_back("-vfp4");
-    Features.push_back("-fp-armv8");
-    break;
-  case ARM::FV_VFPV2:
-    Features.push_back("+vfp2");
-    Features.push_back("-vfp3");
-    Features.push_back("-fp16");
-    Features.push_back("-vfp4");
-    Features.push_back("-fp-armv8");
-    break;
-  case ARM::FV_NONE:
-    Features.push_back("-vfp2");
-    Features.push_back("-vfp3");
-    Features.push_back("-fp16");
-    Features.push_back("-vfp4");
-    Features.push_back("-fp-armv8");
-    break;
-  }
-
-  // crypto includes neon, so we handle this similarly to FPU version.
-  switch (FPUNames[FPUKind].NeonSupport) {
-  case ARM::NS_Crypto:
-    Features.push_back("+neon");
-    Features.push_back("+crypto");
-    break;
-  case ARM::NS_Neon:
-    Features.push_back("+neon");
-    Features.push_back("-crypto");
-    break;
-  case ARM::NS_None:
-    Features.push_back("-neon");
-    Features.push_back("-crypto");
-    break;
-  }
-
-  return true;
-}
-
-StringRef llvm::ARM::getArchName(unsigned ArchKind) {
-  if (ArchKind >= ARM::AK_LAST)
-    return StringRef();
-  return ARCHNames[ArchKind].getName();
-}
-
-StringRef llvm::ARM::getCPUAttr(unsigned ArchKind) {
-  if (ArchKind == ARM::AK_INVALID || ArchKind >= ARM::AK_LAST)
-    return StringRef();
-  return ARCHNames[ArchKind].getCPUAttr();
-}
-
-StringRef llvm::ARM::getSubArch(unsigned ArchKind) {
-  if (ArchKind == ARM::AK_INVALID || ArchKind >= ARM::AK_LAST)
-    return StringRef();
-  return ARCHNames[ArchKind].getSubArch();
-}
-
-unsigned llvm::ARM::getArchAttr(unsigned ArchKind) {
-  if (ArchKind >= ARM::AK_LAST)
-    return ARMBuildAttrs::CPUArch::Pre_v4;
-  return ARCHNames[ArchKind].ArchAttr;
-}
-
-StringRef llvm::ARM::getArchExtName(unsigned ArchExtKind) {
-  for (const auto AE : ARCHExtNames) {
-    if (ArchExtKind == AE.ID)
-      return AE.getName();
-  }
-  return StringRef();
-}
-
-StringRef llvm::ARM::getArchExtFeature(StringRef ArchExt) {
-  if (ArchExt.startswith("no")) {
-    StringRef ArchExtBase(ArchExt.substr(2));
-    for (const auto AE : ARCHExtNames) {
-      if (AE.NegFeature && ArchExtBase == AE.getName())
-        return StringRef(AE.NegFeature);
-    }
-  }
-  for (const auto AE : ARCHExtNames) {
-    if (AE.Feature && ArchExt == AE.getName())
-      return StringRef(AE.Feature);
-  }
-
-  return StringRef();
-}
-
-StringRef llvm::ARM::getHWDivName(unsigned HWDivKind) {
-  for (const auto D : HWDivNames) {
-    if (HWDivKind == D.ID)
-      return D.getName();
-  }
-  return StringRef();
-}
-
-StringRef llvm::ARM::getDefaultCPU(StringRef Arch) {
-  unsigned AK = parseArch(Arch);
-  if (AK == ARM::AK_INVALID)
-    return StringRef();
-
-  // Look for multiple AKs to find the default for pair AK+Name.
-  for (const auto CPU : CPUNames) {
-    if (CPU.ArchID == AK && CPU.Default)
-      return CPU.getName();
-  }
-
-  // If we can't find a default then target the architecture instead
-  return "generic";
-}
-
-StringRef llvm::AArch64::getFPUName(unsigned FPUKind) {
-  return ARM::getFPUName(FPUKind);
-}
-
-unsigned llvm::AArch64::getFPUVersion(unsigned FPUKind) {
-  return ARM::getFPUVersion(FPUKind);
-}
-
-unsigned llvm::AArch64::getFPUNeonSupportLevel(unsigned FPUKind) {
-  return ARM::getFPUNeonSupportLevel( FPUKind);
-}
-
-unsigned llvm::AArch64::getFPURestriction(unsigned FPUKind) {
-  return ARM::getFPURestriction(FPUKind);
-}
-
-unsigned llvm::AArch64::getDefaultFPU(StringRef CPU, unsigned ArchKind) {
-  if (CPU == "generic")
-    return AArch64ARCHNames[ArchKind].DefaultFPU;
-
-  return StringSwitch<unsigned>(CPU)
-#define AARCH64_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
-    .Case(NAME, DEFAULT_FPU)
-#include "llvm/Support/AArch64TargetParser.def"
-    .Default(ARM::FK_INVALID);
-}
-
-unsigned llvm::AArch64::getDefaultExtensions(StringRef CPU, unsigned ArchKind) {
-  if (CPU == "generic")
-    return AArch64ARCHNames[ArchKind].ArchBaseExtensions;
-
-  return StringSwitch<unsigned>(CPU)
-#define AARCH64_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
-    .Case(NAME, DEFAULT_EXT)
-#include "llvm/Support/AArch64TargetParser.def"
-    .Default(AArch64::AEK_INVALID);
-}
-
-bool llvm::AArch64::getExtensionFeatures(unsigned Extensions,
-                                     std::vector<StringRef> &Features) {
-
-  if (Extensions == AArch64::AEK_INVALID)
-    return false;
-
-  if (Extensions & AArch64::AEK_FP)
-    Features.push_back("+fp-armv8");
-  if (Extensions & AArch64::AEK_SIMD)
-    Features.push_back("+neon");
-  if (Extensions & AArch64::AEK_CRC)
-    Features.push_back("+crc");
-  if (Extensions & AArch64::AEK_CRYPTO)
-    Features.push_back("+crypto");
-  if (Extensions & AArch64::AEK_FP16)
-    Features.push_back("+fullfp16");
-  if (Extensions & AArch64::AEK_PROFILE)
-    Features.push_back("+spe");
-  if (Extensions & AArch64::AEK_RAS)
-    Features.push_back("+ras");
-
-  return true;
-}
-
-bool llvm::AArch64::getFPUFeatures(unsigned FPUKind,
-                               std::vector<StringRef> &Features) {
-  return ARM::getFPUFeatures(FPUKind, Features);
-}
-
-bool llvm::AArch64::getArchFeatures(unsigned ArchKind,
-                                     std::vector<StringRef> &Features) {
-  if (ArchKind == static_cast<unsigned>(AArch64::ArchKind::AK_ARMV8_1A))
-    Features.push_back("+v8.1a");
-  if (ArchKind == static_cast<unsigned>(AArch64::ArchKind::AK_ARMV8_2A))
-    Features.push_back("+v8.2a");
-
-  return ArchKind > static_cast<unsigned>(AArch64::ArchKind::AK_INVALID) &&
-         ArchKind < static_cast<unsigned>(AArch64::ArchKind::AK_LAST);
-}
-
-StringRef llvm::AArch64::getArchName(unsigned ArchKind) {
-  if (ArchKind >= static_cast<unsigned>(AArch64::ArchKind::AK_LAST))
-    return StringRef();
-  return AArch64ARCHNames[ArchKind].getName();
-}
-
-StringRef llvm::AArch64::getCPUAttr(unsigned ArchKind) {
-  if (ArchKind == static_cast<unsigned>(AArch64::ArchKind::AK_INVALID) ||
-      ArchKind >= static_cast<unsigned>(AArch64::ArchKind::AK_LAST))
-    return StringRef();
-  return AArch64ARCHNames[ArchKind].getCPUAttr();
-}
-
-StringRef llvm::AArch64::getSubArch(unsigned ArchKind) {
-  if (ArchKind == static_cast<unsigned>(AArch64::ArchKind::AK_INVALID) ||
-      ArchKind >= static_cast<unsigned>(AArch64::ArchKind::AK_LAST))
-    return StringRef();
-  return AArch64ARCHNames[ArchKind].getSubArch();
-}
-
-unsigned llvm::AArch64::getArchAttr(unsigned ArchKind) {
-  if (ArchKind >= static_cast<unsigned>(AArch64::ArchKind::AK_LAST))
-    return ARMBuildAttrs::CPUArch::v8_A;
-  return AArch64ARCHNames[ArchKind].ArchAttr;
-}
-
-StringRef llvm::AArch64::getArchExtName(unsigned ArchExtKind) {
-  for (const auto &AE : AArch64ARCHExtNames)
-    if (ArchExtKind == AE.ID)
-      return AE.getName();
-  return StringRef();
-}
-
-StringRef llvm::AArch64::getArchExtFeature(StringRef ArchExt) {
-  if (ArchExt.startswith("no")) {
-    StringRef ArchExtBase(ArchExt.substr(2));
-    for (const auto &AE : AArch64ARCHExtNames) {
-      if (AE.NegFeature && ArchExtBase == AE.getName())
-        return StringRef(AE.NegFeature);
-    }
-  }
-
-  for (const auto &AE : AArch64ARCHExtNames)
-    if (AE.Feature && ArchExt == AE.getName())
-      return StringRef(AE.Feature);
-  return StringRef();
-}
-
-StringRef llvm::AArch64::getDefaultCPU(StringRef Arch) {
-  unsigned AK = parseArch(Arch);
-  if (AK == static_cast<unsigned>(AArch64::ArchKind::AK_INVALID))
-    return StringRef();
-
-  // Look for multiple AKs to find the default for pair AK+Name.
-  for (const auto &CPU : AArch64CPUNames)
-    if (static_cast<unsigned>(CPU.ArchID) == AK && CPU.Default)
-      return CPU.getName();
-
-  // If we can't find a default then target the architecture instead
-  return "generic";
-}
-
-unsigned llvm::AArch64::checkArchVersion(StringRef Arch) {
-  if (Arch[0] == 'v' && std::isdigit(Arch[1]))
-    return (Arch[1] - 48);
-  return 0;
-}
-
-// ======================================================= //
-// Parsers
-// ======================================================= //
-
-static StringRef getHWDivSynonym(StringRef HWDiv) {
-  return StringSwitch<StringRef>(HWDiv)
-      .Case("thumb,arm", "arm,thumb")
-      .Default(HWDiv);
-}
-
-static StringRef getFPUSynonym(StringRef FPU) {
-  return StringSwitch<StringRef>(FPU)
-      .Cases("fpa", "fpe2", "fpe3", "maverick", "invalid") // Unsupported
-      .Case("vfp2", "vfpv2")
-      .Case("vfp3", "vfpv3")
-      .Case("vfp4", "vfpv4")
-      .Case("vfp3-d16", "vfpv3-d16")
-      .Case("vfp4-d16", "vfpv4-d16")
-      .Cases("fp4-sp-d16", "vfpv4-sp-d16", "fpv4-sp-d16")
-      .Cases("fp4-dp-d16", "fpv4-dp-d16", "vfpv4-d16")
-      .Case("fp5-sp-d16", "fpv5-sp-d16")
-      .Cases("fp5-dp-d16", "fpv5-dp-d16", "fpv5-d16")
-      // FIXME: Clang uses it, but it's bogus, since neon defaults to vfpv3.
-      .Case("neon-vfpv3", "neon")
-      .Default(FPU);
-}
-
-static StringRef getArchSynonym(StringRef Arch) {
-  return StringSwitch<StringRef>(Arch)
-      .Case("v5", "v5t")
-      .Case("v5e", "v5te")
-      .Case("v6j", "v6")
-      .Case("v6hl", "v6k")
-      .Cases("v6m", "v6sm", "v6s-m", "v6-m")
-      .Cases("v6z", "v6zk", "v6kz")
-      .Cases("v7", "v7a", "v7hl", "v7l", "v7-a")
-      .Case("v7r", "v7-r")
-      .Case("v7m", "v7-m")
-      .Case("v7em", "v7e-m")
-      .Cases("v8", "v8a", "aarch64", "arm64", "v8-a")
-      .Case("v8.1a", "v8.1-a")
-      .Case("v8.2a", "v8.2-a")
-      .Case("v8r", "v8-r")
-      .Case("v8m.base", "v8-m.base")
-      .Case("v8m.main", "v8-m.main")
-      .Default(Arch);
-}
-
-// MArch is expected to be of the form (arm|thumb)?(eb)?(v.+)?(eb)?, but
-// (iwmmxt|xscale)(eb)? is also permitted. If the former, return
-// "v.+", if the latter, return unmodified string, minus 'eb'.
-// If invalid, return empty string.
-StringRef llvm::ARM::getCanonicalArchName(StringRef Arch) {
-  size_t offset = StringRef::npos;
-  StringRef A = Arch;
-  StringRef Error = "";
-
-  // Begins with "arm" / "thumb", move past it.
-  if (A.startswith("arm64"))
-    offset = 5;
-  else if (A.startswith("arm"))
-    offset = 3;
-  else if (A.startswith("thumb"))
-    offset = 5;
-  else if (A.startswith("aarch64")) {
-    offset = 7;
-    // AArch64 uses "_be", not "eb" suffix.
-    if (A.find("eb") != StringRef::npos)
-      return Error;
-    if (A.substr(offset, 3) == "_be")
-      offset += 3;
-  }
-
-  // Ex. "armebv7", move past the "eb".
-  if (offset != StringRef::npos && A.substr(offset, 2) == "eb")
-    offset += 2;
-  // Or, if it ends with eb ("armv7eb"), chop it off.
-  else if (A.endswith("eb"))
-    A = A.substr(0, A.size() - 2);
-  // Trim the head
-  if (offset != StringRef::npos)
-    A = A.substr(offset);
-
-  // Empty string means offset reached the end, which means it's valid.
-  if (A.empty())
-    return Arch;
-
-  // Only match non-marketing names
-  if (offset != StringRef::npos) {
-    // Must start with 'vN'.
-    if (A[0] != 'v' || !std::isdigit(A[1]))
-      return Error;
-    // Can't have an extra 'eb'.
-    if (A.find("eb") != StringRef::npos)
-      return Error;
-  }
-
-  // Arch will either be a 'v' name (v7a) or a marketing name (xscale).
-  return A;
-}
-
-unsigned llvm::ARM::parseHWDiv(StringRef HWDiv) {
-  StringRef Syn = getHWDivSynonym(HWDiv);
-  for (const auto D : HWDivNames) {
-    if (Syn == D.getName())
-      return D.ID;
-  }
-  return ARM::AEK_INVALID;
-}
-
-unsigned llvm::ARM::parseFPU(StringRef FPU) {
-  StringRef Syn = getFPUSynonym(FPU);
-  for (const auto F : FPUNames) {
-    if (Syn == F.getName())
-      return F.ID;
-  }
-  return ARM::FK_INVALID;
-}
-
-// Allows partial match, ex. "v7a" matches "armv7a".
-unsigned llvm::ARM::parseArch(StringRef Arch) {
-  Arch = getCanonicalArchName(Arch);
-  StringRef Syn = getArchSynonym(Arch);
-  for (const auto A : ARCHNames) {
-    if (A.getName().endswith(Syn))
-      return A.ID;
-  }
-  return ARM::AK_INVALID;
-}
-
-unsigned llvm::ARM::parseArchExt(StringRef ArchExt) {
-  for (const auto A : ARCHExtNames) {
-    if (ArchExt == A.getName())
-      return A.ID;
-  }
-  return ARM::AEK_INVALID;
-}
-
-unsigned llvm::ARM::parseCPUArch(StringRef CPU) {
-  for (const auto C : CPUNames) {
-    if (CPU == C.getName())
-      return C.ArchID;
-  }
-  return ARM::AK_INVALID;
-}
-
-// ARM, Thumb, AArch64
-unsigned llvm::ARM::parseArchISA(StringRef Arch) {
-  return StringSwitch<unsigned>(Arch)
-      .StartsWith("aarch64", ARM::IK_AARCH64)
-      .StartsWith("arm64", ARM::IK_AARCH64)
-      .StartsWith("thumb", ARM::IK_THUMB)
-      .StartsWith("arm", ARM::IK_ARM)
-      .Default(ARM::IK_INVALID);
-}
-
-// Little/Big endian
-unsigned llvm::ARM::parseArchEndian(StringRef Arch) {
-  if (Arch.startswith("armeb") || Arch.startswith("thumbeb") ||
-      Arch.startswith("aarch64_be"))
-    return ARM::EK_BIG;
-
-  if (Arch.startswith("arm") || Arch.startswith("thumb")) {
-    if (Arch.endswith("eb"))
-      return ARM::EK_BIG;
-    else
-      return ARM::EK_LITTLE;
-  }
-
-  if (Arch.startswith("aarch64"))
-    return ARM::EK_LITTLE;
-
-  return ARM::EK_INVALID;
-}
-
-// Profile A/R/M
-unsigned llvm::ARM::parseArchProfile(StringRef Arch) {
-  Arch = getCanonicalArchName(Arch);
-  switch (parseArch(Arch)) {
-  case ARM::AK_ARMV6M:
-  case ARM::AK_ARMV7M:
-  case ARM::AK_ARMV7EM:
-  case ARM::AK_ARMV8MMainline:
-  case ARM::AK_ARMV8MBaseline:
-    return ARM::PK_M;
-  case ARM::AK_ARMV7R:
-  case ARM::AK_ARMV8R:
-    return ARM::PK_R;
-  case ARM::AK_ARMV7A:
-  case ARM::AK_ARMV7K:
-  case ARM::AK_ARMV8A:
-  case ARM::AK_ARMV8_1A:
-  case ARM::AK_ARMV8_2A:
-    return ARM::PK_A;
-  }
-  return ARM::PK_INVALID;
-}
-
-// Version number (ex. v7 = 7).
-unsigned llvm::ARM::parseArchVersion(StringRef Arch) {
-  Arch = getCanonicalArchName(Arch);
-  switch (parseArch(Arch)) {
-  case ARM::AK_ARMV2:
-  case ARM::AK_ARMV2A:
-    return 2;
-  case ARM::AK_ARMV3:
-  case ARM::AK_ARMV3M:
-    return 3;
-  case ARM::AK_ARMV4:
-  case ARM::AK_ARMV4T:
-    return 4;
-  case ARM::AK_ARMV5T:
-  case ARM::AK_ARMV5TE:
-  case ARM::AK_IWMMXT:
-  case ARM::AK_IWMMXT2:
-  case ARM::AK_XSCALE:
-  case ARM::AK_ARMV5TEJ:
-    return 5;
-  case ARM::AK_ARMV6:
-  case ARM::AK_ARMV6K:
-  case ARM::AK_ARMV6T2:
-  case ARM::AK_ARMV6KZ:
-  case ARM::AK_ARMV6M:
-    return 6;
-  case ARM::AK_ARMV7A:
-  case ARM::AK_ARMV7R:
-  case ARM::AK_ARMV7M:
-  case ARM::AK_ARMV7S:
-  case ARM::AK_ARMV7EM:
-  case ARM::AK_ARMV7K:
-    return 7;
-  case ARM::AK_ARMV8A:
-  case ARM::AK_ARMV8_1A:
-  case ARM::AK_ARMV8_2A:
-  case ARM::AK_ARMV8R:
-  case ARM::AK_ARMV8MBaseline:
-  case ARM::AK_ARMV8MMainline:
-    return 8;
-  }
-  return 0;
-}
-
-StringRef llvm::AArch64::getCanonicalArchName(StringRef Arch) {
-  return ARM::getCanonicalArchName(Arch);
-}
-
-unsigned llvm::AArch64::parseFPU(StringRef FPU) {
-  return ARM::parseFPU(FPU);
-}
-
-// Allows partial match, ex. "v8a" matches "armv8a".
-unsigned llvm::AArch64::parseArch(StringRef Arch) {
-  Arch = getCanonicalArchName(Arch);
-  if (checkArchVersion(Arch) < 8)
-    return static_cast<unsigned>(AArch64::ArchKind::AK_INVALID);
-
-  StringRef Syn = getArchSynonym(Arch);
-  for (const auto A : AArch64ARCHNames) {
-    if (A.getName().endswith(Syn))
-      return static_cast<unsigned>(A.ID);
-  }
-  return static_cast<unsigned>(AArch64::ArchKind::AK_INVALID);
-}
-
-unsigned llvm::AArch64::parseArchExt(StringRef ArchExt) {
-  for (const auto A : AArch64ARCHExtNames) {
-    if (ArchExt == A.getName())
-      return A.ID;
-  }
-  return AArch64::AEK_INVALID;
-}
-
-unsigned llvm::AArch64::parseCPUArch(StringRef CPU) {
-  for (const auto C : AArch64CPUNames) {
-    if (CPU == C.getName())
-      return static_cast<unsigned>(C.ArchID);
-  }
-  return static_cast<unsigned>(AArch64::ArchKind::AK_INVALID);
-}
-
-// ARM, Thumb, AArch64
-unsigned llvm::AArch64::parseArchISA(StringRef Arch) {
-  return ARM::parseArchISA(Arch);
-}
-
-// Little/Big endian
-unsigned llvm::AArch64::parseArchEndian(StringRef Arch) {
-  return ARM::parseArchEndian(Arch);
-}
-
-// Profile A/R/M
-unsigned llvm::AArch64::parseArchProfile(StringRef Arch) {
-  return ARM::parseArchProfile(Arch);
-}
-
-// Version number (ex. v8 = 8).
-unsigned llvm::AArch64::parseArchVersion(StringRef Arch) {
-  return ARM::parseArchVersion(Arch);
-}
diff --git a/third_party/llvm-subzero/lib/Support/Threading.cpp b/third_party/llvm-subzero/lib/Support/Threading.cpp
index 760f9e2..a2f27b3 100644
--- a/third_party/llvm-subzero/lib/Support/Threading.cpp
+++ b/third_party/llvm-subzero/lib/Support/Threading.cpp
@@ -117,13 +117,3 @@
 }
 
 #endif
-
-unsigned llvm::heavyweight_hardware_concurrency() {
-#if !LLVM_ENABLE_THREADS
-  return 1;
-#endif
-  int NumPhysical = sys::getHostNumPhysicalCores();
-  if (NumPhysical == -1)
-    return thread::hardware_concurrency();
-  return NumPhysical;
-}
diff --git a/third_party/llvm-subzero/lib/Support/Triple.cpp b/third_party/llvm-subzero/lib/Support/Triple.cpp
deleted file mode 100644
index 6783b40..0000000
--- a/third_party/llvm-subzero/lib/Support/Triple.cpp
+++ /dev/null
@@ -1,1527 +0,0 @@
-//===--- Triple.cpp - Target triple helper class --------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/Triple.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/StringSwitch.h"
-#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/TargetParser.h"
-#include "llvm/Support/Host.h"
-#include <cstring>
-using namespace llvm;
-
-StringRef Triple::getArchTypeName(ArchType Kind) {
-  switch (Kind) {
-  case UnknownArch:    return "unknown";
-
-  case aarch64:        return "aarch64";
-  case aarch64_be:     return "aarch64_be";
-  case arm:            return "arm";
-  case armeb:          return "armeb";
-  case avr:            return "avr";
-  case bpfel:          return "bpfel";
-  case bpfeb:          return "bpfeb";
-  case hexagon:        return "hexagon";
-  case mips:           return "mips";
-  case mipsel:         return "mipsel";
-  case mips64:         return "mips64";
-  case mips64el:       return "mips64el";
-  case msp430:         return "msp430";
-  case ppc64:          return "powerpc64";
-  case ppc64le:        return "powerpc64le";
-  case ppc:            return "powerpc";
-  case r600:           return "r600";
-  case amdgcn:         return "amdgcn";
-  case riscv32:        return "riscv32";
-  case riscv64:        return "riscv64";
-  case sparc:          return "sparc";
-  case sparcv9:        return "sparcv9";
-  case sparcel:        return "sparcel";
-  case systemz:        return "s390x";
-  case tce:            return "tce";
-  case tcele:          return "tcele";
-  case thumb:          return "thumb";
-  case thumbeb:        return "thumbeb";
-  case x86:            return "i386";
-  case x86_64:         return "x86_64";
-  case xcore:          return "xcore";
-  case nvptx:          return "nvptx";
-  case nvptx64:        return "nvptx64";
-  case le32:           return "le32";
-  case le64:           return "le64";
-  case amdil:          return "amdil";
-  case amdil64:        return "amdil64";
-  case hsail:          return "hsail";
-  case hsail64:        return "hsail64";
-  case spir:           return "spir";
-  case spir64:         return "spir64";
-  case kalimba:        return "kalimba";
-  case lanai:          return "lanai";
-  case shave:          return "shave";
-  case wasm32:         return "wasm32";
-  case wasm64:         return "wasm64";
-  case renderscript32: return "renderscript32";
-  case renderscript64: return "renderscript64";
-  }
-
-  llvm_unreachable("Invalid ArchType!");
-}
-
-StringRef Triple::getArchTypePrefix(ArchType Kind) {
-  switch (Kind) {
-  default:
-    return StringRef();
-
-  case aarch64:
-  case aarch64_be:  return "aarch64";
-
-  case arm:
-  case armeb:
-  case thumb:
-  case thumbeb:     return "arm";
-
-  case avr:         return "avr";
-
-  case ppc64:
-  case ppc64le:
-  case ppc:         return "ppc";
-
-  case mips:
-  case mipsel:
-  case mips64:
-  case mips64el:    return "mips";
-
-  case hexagon:     return "hexagon";
-
-  case amdgcn:      return "amdgcn";
-  case r600:        return "r600";
-
-  case bpfel:
-  case bpfeb:       return "bpf";
-
-  case sparcv9:
-  case sparcel:
-  case sparc:       return "sparc";
-
-  case systemz:     return "s390";
-
-  case x86:
-  case x86_64:      return "x86";
-
-  case xcore:       return "xcore";
-
-  // NVPTX intrinsics are namespaced under nvvm.
-  case nvptx:       return "nvvm";
-  case nvptx64:     return "nvvm";
-
-  case le32:        return "le32";
-  case le64:        return "le64";
-
-  case amdil:
-  case amdil64:     return "amdil";
-
-  case hsail:
-  case hsail64:     return "hsail";
-
-  case spir:
-  case spir64:      return "spir";
-  case kalimba:     return "kalimba";
-  case lanai:       return "lanai";
-  case shave:       return "shave";
-  case wasm32:
-  case wasm64:      return "wasm";
-
-  case riscv32:
-  case riscv64:     return "riscv";
-  }
-}
-
-StringRef Triple::getVendorTypeName(VendorType Kind) {
-  switch (Kind) {
-  case UnknownVendor: return "unknown";
-
-  case Apple: return "apple";
-  case PC: return "pc";
-  case SCEI: return "scei";
-  case BGP: return "bgp";
-  case BGQ: return "bgq";
-  case Freescale: return "fsl";
-  case IBM: return "ibm";
-  case ImaginationTechnologies: return "img";
-  case MipsTechnologies: return "mti";
-  case NVIDIA: return "nvidia";
-  case CSR: return "csr";
-  case Myriad: return "myriad";
-  case AMD: return "amd";
-  case Mesa: return "mesa";
-  }
-
-  llvm_unreachable("Invalid VendorType!");
-}
-
-StringRef Triple::getOSTypeName(OSType Kind) {
-  switch (Kind) {
-  case UnknownOS: return "unknown";
-
-  case CloudABI: return "cloudabi";
-  case Darwin: return "darwin";
-  case DragonFly: return "dragonfly";
-  case FreeBSD: return "freebsd";
-  case Fuchsia: return "fuchsia";
-  case IOS: return "ios";
-  case KFreeBSD: return "kfreebsd";
-  case Linux: return "linux";
-  case Lv2: return "lv2";
-  case MacOSX: return "macosx";
-  case NetBSD: return "netbsd";
-  case OpenBSD: return "openbsd";
-  case Solaris: return "solaris";
-  case Win32: return "windows";
-  case Haiku: return "haiku";
-  case Minix: return "minix";
-  case RTEMS: return "rtems";
-  case NaCl: return "nacl";
-  case CNK: return "cnk";
-  case Bitrig: return "bitrig";
-  case AIX: return "aix";
-  case CUDA: return "cuda";
-  case NVCL: return "nvcl";
-  case AMDHSA: return "amdhsa";
-  case PS4: return "ps4";
-  case ELFIAMCU: return "elfiamcu";
-  case TvOS: return "tvos";
-  case WatchOS: return "watchos";
-  case Mesa3D: return "mesa3d";
-  case Contiki: return "contiki";
-  }
-
-  llvm_unreachable("Invalid OSType");
-}
-
-StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
-  switch (Kind) {
-  case UnknownEnvironment: return "unknown";
-  case GNU: return "gnu";
-  case GNUABI64: return "gnuabi64";
-  case GNUEABIHF: return "gnueabihf";
-  case GNUEABI: return "gnueabi";
-  case GNUX32: return "gnux32";
-  case CODE16: return "code16";
-  case EABI: return "eabi";
-  case EABIHF: return "eabihf";
-  case Android: return "android";
-  case Musl: return "musl";
-  case MuslEABI: return "musleabi";
-  case MuslEABIHF: return "musleabihf";
-  case MSVC: return "msvc";
-  case Itanium: return "itanium";
-  case Cygnus: return "cygnus";
-  case AMDOpenCL: return "amdopencl";
-  case CoreCLR: return "coreclr";
-  case OpenCL: return "opencl";
-  }
-
-  llvm_unreachable("Invalid EnvironmentType!");
-}
-
-static Triple::ArchType parseBPFArch(StringRef ArchName) {
-  if (ArchName.equals("bpf")) {
-    if (sys::IsLittleEndianHost)
-      return Triple::bpfel;
-    else
-      return Triple::bpfeb;
-  } else if (ArchName.equals("bpf_be") || ArchName.equals("bpfeb")) {
-    return Triple::bpfeb;
-  } else if (ArchName.equals("bpf_le") || ArchName.equals("bpfel")) {
-    return Triple::bpfel;
-  } else {
-    return Triple::UnknownArch;
-  }
-}
-
-Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) {
-  Triple::ArchType BPFArch(parseBPFArch(Name));
-  return StringSwitch<Triple::ArchType>(Name)
-    .Case("aarch64", aarch64)
-    .Case("aarch64_be", aarch64_be)
-    .Case("arm64", aarch64) // "arm64" is an alias for "aarch64"
-    .Case("arm", arm)
-    .Case("armeb", armeb)
-    .Case("avr", avr)
-    .StartsWith("bpf", BPFArch)
-    .Case("mips", mips)
-    .Case("mipsel", mipsel)
-    .Case("mips64", mips64)
-    .Case("mips64el", mips64el)
-    .Case("msp430", msp430)
-    .Case("ppc64", ppc64)
-    .Case("ppc32", ppc)
-    .Case("ppc", ppc)
-    .Case("ppc64le", ppc64le)
-    .Case("r600", r600)
-    .Case("amdgcn", amdgcn)
-    .Case("riscv32", riscv32)
-    .Case("riscv64", riscv64)
-    .Case("hexagon", hexagon)
-    .Case("sparc", sparc)
-    .Case("sparcel", sparcel)
-    .Case("sparcv9", sparcv9)
-    .Case("systemz", systemz)
-    .Case("tce", tce)
-    .Case("tcele", tcele)
-    .Case("thumb", thumb)
-    .Case("thumbeb", thumbeb)
-    .Case("x86", x86)
-    .Case("x86-64", x86_64)
-    .Case("xcore", xcore)
-    .Case("nvptx", nvptx)
-    .Case("nvptx64", nvptx64)
-    .Case("le32", le32)
-    .Case("le64", le64)
-    .Case("amdil", amdil)
-    .Case("amdil64", amdil64)
-    .Case("hsail", hsail)
-    .Case("hsail64", hsail64)
-    .Case("spir", spir)
-    .Case("spir64", spir64)
-    .Case("kalimba", kalimba)
-    .Case("lanai", lanai)
-    .Case("shave", shave)
-    .Case("wasm32", wasm32)
-    .Case("wasm64", wasm64)
-    .Case("renderscript32", renderscript32)
-    .Case("renderscript64", renderscript64)
-    .Default(UnknownArch);
-}
-
-static Triple::ArchType parseARMArch(StringRef ArchName) {
-  unsigned ISA = ARM::parseArchISA(ArchName);
-  unsigned ENDIAN = ARM::parseArchEndian(ArchName);
-
-  Triple::ArchType arch = Triple::UnknownArch;
-  switch (ENDIAN) {
-  case ARM::EK_LITTLE: {
-    switch (ISA) {
-    case ARM::IK_ARM:
-      arch = Triple::arm;
-      break;
-    case ARM::IK_THUMB:
-      arch = Triple::thumb;
-      break;
-    case ARM::IK_AARCH64:
-      arch = Triple::aarch64;
-      break;
-    }
-    break;
-  }
-  case ARM::EK_BIG: {
-    switch (ISA) {
-    case ARM::IK_ARM:
-      arch = Triple::armeb;
-      break;
-    case ARM::IK_THUMB:
-      arch = Triple::thumbeb;
-      break;
-    case ARM::IK_AARCH64:
-      arch = Triple::aarch64_be;
-      break;
-    }
-    break;
-  }
-  }
-
-  ArchName = ARM::getCanonicalArchName(ArchName);
-  if (ArchName.empty())
-    return Triple::UnknownArch;
-
-  // Thumb only exists in v4+
-  if (ISA == ARM::IK_THUMB &&
-      (ArchName.startswith("v2") || ArchName.startswith("v3")))
-    return Triple::UnknownArch;
-
-  // Thumb only for v6m
-  unsigned Profile = ARM::parseArchProfile(ArchName);
-  unsigned Version = ARM::parseArchVersion(ArchName);
-  if (Profile == ARM::PK_M && Version == 6) {
-    if (ENDIAN == ARM::EK_BIG)
-      return Triple::thumbeb;
-    else
-      return Triple::thumb;
-  }
-
-  return arch;
-}
-
-static Triple::ArchType parseArch(StringRef ArchName) {
-  auto AT = StringSwitch<Triple::ArchType>(ArchName)
-    .Cases("i386", "i486", "i586", "i686", Triple::x86)
-    // FIXME: Do we need to support these?
-    .Cases("i786", "i886", "i986", Triple::x86)
-    .Cases("amd64", "x86_64", "x86_64h", Triple::x86_64)
-    .Cases("powerpc", "ppc32", Triple::ppc)
-    .Cases("powerpc64", "ppu", "ppc64", Triple::ppc64)
-    .Cases("powerpc64le", "ppc64le", Triple::ppc64le)
-    .Case("xscale", Triple::arm)
-    .Case("xscaleeb", Triple::armeb)
-    .Case("aarch64", Triple::aarch64)
-    .Case("aarch64_be", Triple::aarch64_be)
-    .Case("arm64", Triple::aarch64)
-    .Case("arm", Triple::arm)
-    .Case("armeb", Triple::armeb)
-    .Case("thumb", Triple::thumb)
-    .Case("thumbeb", Triple::thumbeb)
-    .Case("avr", Triple::avr)
-    .Case("msp430", Triple::msp430)
-    .Cases("mips", "mipseb", "mipsallegrex", Triple::mips)
-    .Cases("mipsel", "mipsallegrexel", Triple::mipsel)
-    .Cases("mips64", "mips64eb", Triple::mips64)
-    .Case("mips64el", Triple::mips64el)
-    .Case("r600", Triple::r600)
-    .Case("amdgcn", Triple::amdgcn)
-    .Case("riscv32", Triple::riscv32)
-    .Case("riscv64", Triple::riscv64)
-    .Case("hexagon", Triple::hexagon)
-    .Cases("s390x", "systemz", Triple::systemz)
-    .Case("sparc", Triple::sparc)
-    .Case("sparcel", Triple::sparcel)
-    .Cases("sparcv9", "sparc64", Triple::sparcv9)
-    .Case("tce", Triple::tce)
-    .Case("tcele", Triple::tcele)
-    .Case("xcore", Triple::xcore)
-    .Case("nvptx", Triple::nvptx)
-    .Case("nvptx64", Triple::nvptx64)
-    .Case("le32", Triple::le32)
-    .Case("le64", Triple::le64)
-    .Case("amdil", Triple::amdil)
-    .Case("amdil64", Triple::amdil64)
-    .Case("hsail", Triple::hsail)
-    .Case("hsail64", Triple::hsail64)
-    .Case("spir", Triple::spir)
-    .Case("spir64", Triple::spir64)
-    .StartsWith("kalimba", Triple::kalimba)
-    .Case("lanai", Triple::lanai)
-    .Case("shave", Triple::shave)
-    .Case("wasm32", Triple::wasm32)
-    .Case("wasm64", Triple::wasm64)
-    .Case("renderscript32", Triple::renderscript32)
-    .Case("renderscript64", Triple::renderscript64)
-    .Default(Triple::UnknownArch);
-
-  // Some architectures require special parsing logic just to compute the
-  // ArchType result.
-  if (AT == Triple::UnknownArch) {
-    if (ArchName.startswith("arm") || ArchName.startswith("thumb") ||
-        ArchName.startswith("aarch64"))
-      return parseARMArch(ArchName);
-    if (ArchName.startswith("bpf"))
-      return parseBPFArch(ArchName);
-  }
-
-  return AT;
-}
-
-static Triple::VendorType parseVendor(StringRef VendorName) {
-  return StringSwitch<Triple::VendorType>(VendorName)
-    .Case("apple", Triple::Apple)
-    .Case("pc", Triple::PC)
-    .Case("scei", Triple::SCEI)
-    .Case("bgp", Triple::BGP)
-    .Case("bgq", Triple::BGQ)
-    .Case("fsl", Triple::Freescale)
-    .Case("ibm", Triple::IBM)
-    .Case("img", Triple::ImaginationTechnologies)
-    .Case("mti", Triple::MipsTechnologies)
-    .Case("nvidia", Triple::NVIDIA)
-    .Case("csr", Triple::CSR)
-    .Case("myriad", Triple::Myriad)
-    .Case("amd", Triple::AMD)
-    .Case("mesa", Triple::Mesa)
-    .Default(Triple::UnknownVendor);
-}
-
-static Triple::OSType parseOS(StringRef OSName) {
-  return StringSwitch<Triple::OSType>(OSName)
-    .StartsWith("cloudabi", Triple::CloudABI)
-    .StartsWith("darwin", Triple::Darwin)
-    .StartsWith("dragonfly", Triple::DragonFly)
-    .StartsWith("freebsd", Triple::FreeBSD)
-    .StartsWith("fuchsia", Triple::Fuchsia)
-    .StartsWith("ios", Triple::IOS)
-    .StartsWith("kfreebsd", Triple::KFreeBSD)
-    .StartsWith("linux", Triple::Linux)
-    .StartsWith("lv2", Triple::Lv2)
-    .StartsWith("macosx", Triple::MacOSX)
-    .StartsWith("netbsd", Triple::NetBSD)
-    .StartsWith("openbsd", Triple::OpenBSD)
-    .StartsWith("solaris", Triple::Solaris)
-    .StartsWith("win32", Triple::Win32)
-    .StartsWith("windows", Triple::Win32)
-    .StartsWith("haiku", Triple::Haiku)
-    .StartsWith("minix", Triple::Minix)
-    .StartsWith("rtems", Triple::RTEMS)
-    .StartsWith("nacl", Triple::NaCl)
-    .StartsWith("cnk", Triple::CNK)
-    .StartsWith("bitrig", Triple::Bitrig)
-    .StartsWith("aix", Triple::AIX)
-    .StartsWith("cuda", Triple::CUDA)
-    .StartsWith("nvcl", Triple::NVCL)
-    .StartsWith("amdhsa", Triple::AMDHSA)
-    .StartsWith("ps4", Triple::PS4)
-    .StartsWith("elfiamcu", Triple::ELFIAMCU)
-    .StartsWith("tvos", Triple::TvOS)
-    .StartsWith("watchos", Triple::WatchOS)
-    .StartsWith("mesa3d", Triple::Mesa3D)
-    .StartsWith("contiki", Triple::Contiki)
-    .Default(Triple::UnknownOS);
-}
-
-static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
-  return StringSwitch<Triple::EnvironmentType>(EnvironmentName)
-    .StartsWith("eabihf", Triple::EABIHF)
-    .StartsWith("eabi", Triple::EABI)
-    .StartsWith("gnuabi64", Triple::GNUABI64)
-    .StartsWith("gnueabihf", Triple::GNUEABIHF)
-    .StartsWith("gnueabi", Triple::GNUEABI)
-    .StartsWith("gnux32", Triple::GNUX32)
-    .StartsWith("code16", Triple::CODE16)
-    .StartsWith("gnu", Triple::GNU)
-    .StartsWith("android", Triple::Android)
-    .StartsWith("musleabihf", Triple::MuslEABIHF)
-    .StartsWith("musleabi", Triple::MuslEABI)
-    .StartsWith("musl", Triple::Musl)
-    .StartsWith("msvc", Triple::MSVC)
-    .StartsWith("itanium", Triple::Itanium)
-    .StartsWith("cygnus", Triple::Cygnus)
-    .StartsWith("amdopencl", Triple::AMDOpenCL)
-    .StartsWith("coreclr", Triple::CoreCLR)
-    .StartsWith("opencl", Triple::OpenCL)
-    .Default(Triple::UnknownEnvironment);
-}
-
-static Triple::ObjectFormatType parseFormat(StringRef EnvironmentName) {
-  return StringSwitch<Triple::ObjectFormatType>(EnvironmentName)
-    .EndsWith("coff", Triple::COFF)
-    .EndsWith("elf", Triple::ELF)
-    .EndsWith("macho", Triple::MachO)
-    .Default(Triple::UnknownObjectFormat);
-}
-
-static Triple::SubArchType parseSubArch(StringRef SubArchName) {
-  StringRef ARMSubArch = ARM::getCanonicalArchName(SubArchName);
-
-  // For now, this is the small part. Early return.
-  if (ARMSubArch.empty())
-    return StringSwitch<Triple::SubArchType>(SubArchName)
-      .EndsWith("kalimba3", Triple::KalimbaSubArch_v3)
-      .EndsWith("kalimba4", Triple::KalimbaSubArch_v4)
-      .EndsWith("kalimba5", Triple::KalimbaSubArch_v5)
-      .Default(Triple::NoSubArch);
-
-  // ARM sub arch.
-  switch(ARM::parseArch(ARMSubArch)) {
-  case ARM::AK_ARMV4:
-    return Triple::NoSubArch;
-  case ARM::AK_ARMV4T:
-    return Triple::ARMSubArch_v4t;
-  case ARM::AK_ARMV5T:
-    return Triple::ARMSubArch_v5;
-  case ARM::AK_ARMV5TE:
-  case ARM::AK_IWMMXT:
-  case ARM::AK_IWMMXT2:
-  case ARM::AK_XSCALE:
-  case ARM::AK_ARMV5TEJ:
-    return Triple::ARMSubArch_v5te;
-  case ARM::AK_ARMV6:
-    return Triple::ARMSubArch_v6;
-  case ARM::AK_ARMV6K:
-  case ARM::AK_ARMV6KZ:
-    return Triple::ARMSubArch_v6k;
-  case ARM::AK_ARMV6T2:
-    return Triple::ARMSubArch_v6t2;
-  case ARM::AK_ARMV6M:
-    return Triple::ARMSubArch_v6m;
-  case ARM::AK_ARMV7A:
-  case ARM::AK_ARMV7R:
-    return Triple::ARMSubArch_v7;
-  case ARM::AK_ARMV7K:
-    return Triple::ARMSubArch_v7k;
-  case ARM::AK_ARMV7M:
-    return Triple::ARMSubArch_v7m;
-  case ARM::AK_ARMV7S:
-    return Triple::ARMSubArch_v7s;
-  case ARM::AK_ARMV7EM:
-    return Triple::ARMSubArch_v7em;
-  case ARM::AK_ARMV8A:
-    return Triple::ARMSubArch_v8;
-  case ARM::AK_ARMV8_1A:
-    return Triple::ARMSubArch_v8_1a;
-  case ARM::AK_ARMV8_2A:
-    return Triple::ARMSubArch_v8_2a;
-  case ARM::AK_ARMV8R:
-    return Triple::ARMSubArch_v8r;
-  case ARM::AK_ARMV8MBaseline:
-    return Triple::ARMSubArch_v8m_baseline;
-  case ARM::AK_ARMV8MMainline:
-    return Triple::ARMSubArch_v8m_mainline;
-  default:
-    return Triple::NoSubArch;
-  }
-}
-
-static StringRef getObjectFormatTypeName(Triple::ObjectFormatType Kind) {
-  switch (Kind) {
-  case Triple::UnknownObjectFormat: return "";
-  case Triple::COFF: return "coff";
-  case Triple::ELF: return "elf";
-  case Triple::MachO: return "macho";
-  }
-  llvm_unreachable("unknown object format type");
-}
-
-static Triple::ObjectFormatType getDefaultFormat(const Triple &T) {
-  switch (T.getArch()) {
-  case Triple::UnknownArch:
-  case Triple::aarch64:
-  case Triple::arm:
-  case Triple::thumb:
-  case Triple::x86:
-  case Triple::x86_64:
-    if (T.isOSDarwin())
-      return Triple::MachO;
-    else if (T.isOSWindows())
-      return Triple::COFF;
-    return Triple::ELF;
-
-  case Triple::aarch64_be:
-  case Triple::amdgcn:
-  case Triple::amdil:
-  case Triple::amdil64:
-  case Triple::armeb:
-  case Triple::avr:
-  case Triple::bpfeb:
-  case Triple::bpfel:
-  case Triple::hexagon:
-  case Triple::lanai:
-  case Triple::hsail:
-  case Triple::hsail64:
-  case Triple::kalimba:
-  case Triple::le32:
-  case Triple::le64:
-  case Triple::mips:
-  case Triple::mips64:
-  case Triple::mips64el:
-  case Triple::mipsel:
-  case Triple::msp430:
-  case Triple::nvptx:
-  case Triple::nvptx64:
-  case Triple::ppc64le:
-  case Triple::r600:
-  case Triple::renderscript32:
-  case Triple::renderscript64:
-  case Triple::riscv32:
-  case Triple::riscv64:
-  case Triple::shave:
-  case Triple::sparc:
-  case Triple::sparcel:
-  case Triple::sparcv9:
-  case Triple::spir:
-  case Triple::spir64:
-  case Triple::systemz:
-  case Triple::tce:
-  case Triple::tcele:
-  case Triple::thumbeb:
-  case Triple::wasm32:
-  case Triple::wasm64:
-  case Triple::xcore:
-    return Triple::ELF;
-
-  case Triple::ppc:
-  case Triple::ppc64:
-    if (T.isOSDarwin())
-      return Triple::MachO;
-    return Triple::ELF;
-  }
-  llvm_unreachable("unknown architecture");
-}
-
-/// \brief Construct a triple from the string representation provided.
-///
-/// This stores the string representation and parses the various pieces into
-/// enum members.
-Triple::Triple(const Twine &Str)
-    : Data(Str.str()), Arch(UnknownArch), SubArch(NoSubArch),
-      Vendor(UnknownVendor), OS(UnknownOS), Environment(UnknownEnvironment),
-      ObjectFormat(UnknownObjectFormat) {
-  // Do minimal parsing by hand here.
-  SmallVector<StringRef, 4> Components;
-  StringRef(Data).split(Components, '-', /*MaxSplit*/ 3);
-  if (Components.size() > 0) {
-    Arch = parseArch(Components[0]);
-    SubArch = parseSubArch(Components[0]);
-    if (Components.size() > 1) {
-      Vendor = parseVendor(Components[1]);
-      if (Components.size() > 2) {
-        OS = parseOS(Components[2]);
-        if (Components.size() > 3) {
-          Environment = parseEnvironment(Components[3]);
-          ObjectFormat = parseFormat(Components[3]);
-        }
-      }
-    }
-  }
-  if (ObjectFormat == UnknownObjectFormat)
-    ObjectFormat = getDefaultFormat(*this);
-}
-
-/// \brief Construct a triple from string representations of the architecture,
-/// vendor, and OS.
-///
-/// This joins each argument into a canonical string representation and parses
-/// them into enum members. It leaves the environment unknown and omits it from
-/// the string representation.
-Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr)
-    : Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr).str()),
-      Arch(parseArch(ArchStr.str())),
-      SubArch(parseSubArch(ArchStr.str())),
-      Vendor(parseVendor(VendorStr.str())),
-      OS(parseOS(OSStr.str())),
-      Environment(), ObjectFormat(Triple::UnknownObjectFormat) {
-  ObjectFormat = getDefaultFormat(*this);
-}
-
-/// \brief Construct a triple from string representations of the architecture,
-/// vendor, OS, and environment.
-///
-/// This joins each argument into a canonical string representation and parses
-/// them into enum members.
-Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
-               const Twine &EnvironmentStr)
-    : Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr + Twine('-') +
-            EnvironmentStr).str()),
-      Arch(parseArch(ArchStr.str())),
-      SubArch(parseSubArch(ArchStr.str())),
-      Vendor(parseVendor(VendorStr.str())),
-      OS(parseOS(OSStr.str())),
-      Environment(parseEnvironment(EnvironmentStr.str())),
-      ObjectFormat(parseFormat(EnvironmentStr.str())) {
-  if (ObjectFormat == Triple::UnknownObjectFormat)
-    ObjectFormat = getDefaultFormat(*this);
-}
-
-std::string Triple::normalize(StringRef Str) {
-  bool IsMinGW32 = false;
-  bool IsCygwin = false;
-
-  // Parse into components.
-  SmallVector<StringRef, 4> Components;
-  Str.split(Components, '-');
-
-  // If the first component corresponds to a known architecture, preferentially
-  // use it for the architecture.  If the second component corresponds to a
-  // known vendor, preferentially use it for the vendor, etc.  This avoids silly
-  // component movement when a component parses as (eg) both a valid arch and a
-  // valid os.
-  ArchType Arch = UnknownArch;
-  if (Components.size() > 0)
-    Arch = parseArch(Components[0]);
-  VendorType Vendor = UnknownVendor;
-  if (Components.size() > 1)
-    Vendor = parseVendor(Components[1]);
-  OSType OS = UnknownOS;
-  if (Components.size() > 2) {
-    OS = parseOS(Components[2]);
-    IsCygwin = Components[2].startswith("cygwin");
-    IsMinGW32 = Components[2].startswith("mingw");
-  }
-  EnvironmentType Environment = UnknownEnvironment;
-  if (Components.size() > 3)
-    Environment = parseEnvironment(Components[3]);
-  ObjectFormatType ObjectFormat = UnknownObjectFormat;
-  if (Components.size() > 4)
-    ObjectFormat = parseFormat(Components[4]);
-
-  // Note which components are already in their final position.  These will not
-  // be moved.
-  bool Found[4];
-  Found[0] = Arch != UnknownArch;
-  Found[1] = Vendor != UnknownVendor;
-  Found[2] = OS != UnknownOS;
-  Found[3] = Environment != UnknownEnvironment;
-
-  // If they are not there already, permute the components into their canonical
-  // positions by seeing if they parse as a valid architecture, and if so moving
-  // the component to the architecture position etc.
-  for (unsigned Pos = 0; Pos != array_lengthof(Found); ++Pos) {
-    if (Found[Pos])
-      continue; // Already in the canonical position.
-
-    for (unsigned Idx = 0; Idx != Components.size(); ++Idx) {
-      // Do not reparse any components that already matched.
-      if (Idx < array_lengthof(Found) && Found[Idx])
-        continue;
-
-      // Does this component parse as valid for the target position?
-      bool Valid = false;
-      StringRef Comp = Components[Idx];
-      switch (Pos) {
-      default: llvm_unreachable("unexpected component type!");
-      case 0:
-        Arch = parseArch(Comp);
-        Valid = Arch != UnknownArch;
-        break;
-      case 1:
-        Vendor = parseVendor(Comp);
-        Valid = Vendor != UnknownVendor;
-        break;
-      case 2:
-        OS = parseOS(Comp);
-        IsCygwin = Comp.startswith("cygwin");
-        IsMinGW32 = Comp.startswith("mingw");
-        Valid = OS != UnknownOS || IsCygwin || IsMinGW32;
-        break;
-      case 3:
-        Environment = parseEnvironment(Comp);
-        Valid = Environment != UnknownEnvironment;
-        if (!Valid) {
-          ObjectFormat = parseFormat(Comp);
-          Valid = ObjectFormat != UnknownObjectFormat;
-        }
-        break;
-      }
-      if (!Valid)
-        continue; // Nope, try the next component.
-
-      // Move the component to the target position, pushing any non-fixed
-      // components that are in the way to the right.  This tends to give
-      // good results in the common cases of a forgotten vendor component
-      // or a wrongly positioned environment.
-      if (Pos < Idx) {
-        // Insert left, pushing the existing components to the right.  For
-        // example, a-b-i386 -> i386-a-b when moving i386 to the front.
-        StringRef CurrentComponent(""); // The empty component.
-        // Replace the component we are moving with an empty component.
-        std::swap(CurrentComponent, Components[Idx]);
-        // Insert the component being moved at Pos, displacing any existing
-        // components to the right.
-        for (unsigned i = Pos; !CurrentComponent.empty(); ++i) {
-          // Skip over any fixed components.
-          while (i < array_lengthof(Found) && Found[i])
-            ++i;
-          // Place the component at the new position, getting the component
-          // that was at this position - it will be moved right.
-          std::swap(CurrentComponent, Components[i]);
-        }
-      } else if (Pos > Idx) {
-        // Push right by inserting empty components until the component at Idx
-        // reaches the target position Pos.  For example, pc-a -> -pc-a when
-        // moving pc to the second position.
-        do {
-          // Insert one empty component at Idx.
-          StringRef CurrentComponent(""); // The empty component.
-          for (unsigned i = Idx; i < Components.size();) {
-            // Place the component at the new position, getting the component
-            // that was at this position - it will be moved right.
-            std::swap(CurrentComponent, Components[i]);
-            // If it was placed on top of an empty component then we are done.
-            if (CurrentComponent.empty())
-              break;
-            // Advance to the next component, skipping any fixed components.
-            while (++i < array_lengthof(Found) && Found[i])
-              ;
-          }
-          // The last component was pushed off the end - append it.
-          if (!CurrentComponent.empty())
-            Components.push_back(CurrentComponent);
-
-          // Advance Idx to the component's new position.
-          while (++Idx < array_lengthof(Found) && Found[Idx])
-            ;
-        } while (Idx < Pos); // Add more until the final position is reached.
-      }
-      assert(Pos < Components.size() && Components[Pos] == Comp &&
-             "Component moved wrong!");
-      Found[Pos] = true;
-      break;
-    }
-  }
-
-  // Special case logic goes here.  At this point Arch, Vendor and OS have the
-  // correct values for the computed components.
-  std::string NormalizedEnvironment;
-  if (Environment == Triple::Android && Components[3].startswith("androideabi")) {
-    StringRef AndroidVersion = Components[3].drop_front(strlen("androideabi"));
-    if (AndroidVersion.empty()) {
-      Components[3] = "android";
-    } else {
-      NormalizedEnvironment = Twine("android", AndroidVersion).str();
-      Components[3] = NormalizedEnvironment;
-    }
-  }
-
-  if (OS == Triple::Win32) {
-    Components.resize(4);
-    Components[2] = "windows";
-    if (Environment == UnknownEnvironment) {
-      if (ObjectFormat == UnknownObjectFormat || ObjectFormat == Triple::COFF)
-        Components[3] = "msvc";
-      else
-        Components[3] = getObjectFormatTypeName(ObjectFormat);
-    }
-  } else if (IsMinGW32) {
-    Components.resize(4);
-    Components[2] = "windows";
-    Components[3] = "gnu";
-  } else if (IsCygwin) {
-    Components.resize(4);
-    Components[2] = "windows";
-    Components[3] = "cygnus";
-  }
-  if (IsMinGW32 || IsCygwin ||
-      (OS == Triple::Win32 && Environment != UnknownEnvironment)) {
-    if (ObjectFormat != UnknownObjectFormat && ObjectFormat != Triple::COFF) {
-      Components.resize(5);
-      Components[4] = getObjectFormatTypeName(ObjectFormat);
-    }
-  }
-
-  // Stick the corrected components back together to form the normalized string.
-  std::string Normalized;
-  for (unsigned i = 0, e = Components.size(); i != e; ++i) {
-    if (i) Normalized += '-';
-    Normalized += Components[i];
-  }
-  return Normalized;
-}
-
-StringRef Triple::getArchName() const {
-  return StringRef(Data).split('-').first;           // Isolate first component
-}
-
-StringRef Triple::getVendorName() const {
-  StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
-  return Tmp.split('-').first;                       // Isolate second component
-}
-
-StringRef Triple::getOSName() const {
-  StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
-  Tmp = Tmp.split('-').second;                       // Strip second component
-  return Tmp.split('-').first;                       // Isolate third component
-}
-
-StringRef Triple::getEnvironmentName() const {
-  StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
-  Tmp = Tmp.split('-').second;                       // Strip second component
-  return Tmp.split('-').second;                      // Strip third component
-}
-
-StringRef Triple::getOSAndEnvironmentName() const {
-  StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
-  return Tmp.split('-').second;                      // Strip second component
-}
-
-static unsigned EatNumber(StringRef &Str) {
-  assert(!Str.empty() && Str[0] >= '0' && Str[0] <= '9' && "Not a number");
-  unsigned Result = 0;
-
-  do {
-    // Consume the leading digit.
-    Result = Result*10 + (Str[0] - '0');
-
-    // Eat the digit.
-    Str = Str.substr(1);
-  } while (!Str.empty() && Str[0] >= '0' && Str[0] <= '9');
-
-  return Result;
-}
-
-static void parseVersionFromName(StringRef Name, unsigned &Major,
-                                 unsigned &Minor, unsigned &Micro) {
-  // Any unset version defaults to 0.
-  Major = Minor = Micro = 0;
-
-  // Parse up to three components.
-  unsigned *Components[3] = {&Major, &Minor, &Micro};
-  for (unsigned i = 0; i != 3; ++i) {
-    if (Name.empty() || Name[0] < '0' || Name[0] > '9')
-      break;
-
-    // Consume the leading number.
-    *Components[i] = EatNumber(Name);
-
-    // Consume the separator, if present.
-    if (Name.startswith("."))
-      Name = Name.substr(1);
-  }
-}
-
-void Triple::getEnvironmentVersion(unsigned &Major, unsigned &Minor,
-                                   unsigned &Micro) const {
-  StringRef EnvironmentName = getEnvironmentName();
-  StringRef EnvironmentTypeName = getEnvironmentTypeName(getEnvironment());
-  if (EnvironmentName.startswith(EnvironmentTypeName))
-    EnvironmentName = EnvironmentName.substr(EnvironmentTypeName.size());
-
-  parseVersionFromName(EnvironmentName, Major, Minor, Micro);
-}
-
-void Triple::getOSVersion(unsigned &Major, unsigned &Minor,
-                          unsigned &Micro) const {
-  StringRef OSName = getOSName();
-  // Assume that the OS portion of the triple starts with the canonical name.
-  StringRef OSTypeName = getOSTypeName(getOS());
-  if (OSName.startswith(OSTypeName))
-    OSName = OSName.substr(OSTypeName.size());
-
-  parseVersionFromName(OSName, Major, Minor, Micro);
-}
-
-bool Triple::getMacOSXVersion(unsigned &Major, unsigned &Minor,
-                              unsigned &Micro) const {
-  getOSVersion(Major, Minor, Micro);
-
-  switch (getOS()) {
-  default: llvm_unreachable("unexpected OS for Darwin triple");
-  case Darwin:
-    // Default to darwin8, i.e., MacOSX 10.4.
-    if (Major == 0)
-      Major = 8;
-    // Darwin version numbers are skewed from OS X versions.
-    if (Major < 4)
-      return false;
-    Micro = 0;
-    Minor = Major - 4;
-    Major = 10;
-    break;
-  case MacOSX:
-    // Default to 10.4.
-    if (Major == 0) {
-      Major = 10;
-      Minor = 4;
-    }
-    if (Major != 10)
-      return false;
-    break;
-  case IOS:
-  case TvOS:
-  case WatchOS:
-    // Ignore the version from the triple.  This is only handled because the
-    // the clang driver combines OS X and IOS support into a common Darwin
-    // toolchain that wants to know the OS X version number even when targeting
-    // IOS.
-    Major = 10;
-    Minor = 4;
-    Micro = 0;
-    break;
-  }
-  return true;
-}
-
-void Triple::getiOSVersion(unsigned &Major, unsigned &Minor,
-                           unsigned &Micro) const {
-  switch (getOS()) {
-  default: llvm_unreachable("unexpected OS for Darwin triple");
-  case Darwin:
-  case MacOSX:
-    // Ignore the version from the triple.  This is only handled because the
-    // the clang driver combines OS X and IOS support into a common Darwin
-    // toolchain that wants to know the iOS version number even when targeting
-    // OS X.
-    Major = 5;
-    Minor = 0;
-    Micro = 0;
-    break;
-  case IOS:
-  case TvOS:
-    getOSVersion(Major, Minor, Micro);
-    // Default to 5.0 (or 7.0 for arm64).
-    if (Major == 0)
-      Major = (getArch() == aarch64) ? 7 : 5;
-    break;
-  case WatchOS:
-    llvm_unreachable("conflicting triple info");
-  }
-}
-
-void Triple::getWatchOSVersion(unsigned &Major, unsigned &Minor,
-                               unsigned &Micro) const {
-  switch (getOS()) {
-  default: llvm_unreachable("unexpected OS for Darwin triple");
-  case Darwin:
-  case MacOSX:
-    // Ignore the version from the triple.  This is only handled because the
-    // the clang driver combines OS X and IOS support into a common Darwin
-    // toolchain that wants to know the iOS version number even when targeting
-    // OS X.
-    Major = 2;
-    Minor = 0;
-    Micro = 0;
-    break;
-  case WatchOS:
-    getOSVersion(Major, Minor, Micro);
-    if (Major == 0)
-      Major = 2;
-    break;
-  case IOS:
-    llvm_unreachable("conflicting triple info");
-  }
-}
-
-void Triple::setTriple(const Twine &Str) {
-  *this = Triple(Str);
-}
-
-void Triple::setArch(ArchType Kind) {
-  setArchName(getArchTypeName(Kind));
-}
-
-void Triple::setVendor(VendorType Kind) {
-  setVendorName(getVendorTypeName(Kind));
-}
-
-void Triple::setOS(OSType Kind) {
-  setOSName(getOSTypeName(Kind));
-}
-
-void Triple::setEnvironment(EnvironmentType Kind) {
-  if (ObjectFormat == getDefaultFormat(*this))
-    return setEnvironmentName(getEnvironmentTypeName(Kind));
-
-  setEnvironmentName((getEnvironmentTypeName(Kind) + Twine("-") +
-                      getObjectFormatTypeName(ObjectFormat)).str());
-}
-
-void Triple::setObjectFormat(ObjectFormatType Kind) {
-  if (Environment == UnknownEnvironment)
-    return setEnvironmentName(getObjectFormatTypeName(Kind));
-
-  setEnvironmentName((getEnvironmentTypeName(Environment) + Twine("-") +
-                      getObjectFormatTypeName(Kind)).str());
-}
-
-void Triple::setArchName(StringRef Str) {
-  // Work around a miscompilation bug for Twines in gcc 4.0.3.
-  SmallString<64> Triple;
-  Triple += Str;
-  Triple += "-";
-  Triple += getVendorName();
-  Triple += "-";
-  Triple += getOSAndEnvironmentName();
-  setTriple(Triple);
-}
-
-void Triple::setVendorName(StringRef Str) {
-  setTriple(getArchName() + "-" + Str + "-" + getOSAndEnvironmentName());
-}
-
-void Triple::setOSName(StringRef Str) {
-  if (hasEnvironment())
-    setTriple(getArchName() + "-" + getVendorName() + "-" + Str +
-              "-" + getEnvironmentName());
-  else
-    setTriple(getArchName() + "-" + getVendorName() + "-" + Str);
-}
-
-void Triple::setEnvironmentName(StringRef Str) {
-  setTriple(getArchName() + "-" + getVendorName() + "-" + getOSName() +
-            "-" + Str);
-}
-
-void Triple::setOSAndEnvironmentName(StringRef Str) {
-  setTriple(getArchName() + "-" + getVendorName() + "-" + Str);
-}
-
-static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) {
-  switch (Arch) {
-  case llvm::Triple::UnknownArch:
-    return 0;
-
-  case llvm::Triple::avr:
-  case llvm::Triple::msp430:
-    return 16;
-
-  case llvm::Triple::arm:
-  case llvm::Triple::armeb:
-  case llvm::Triple::hexagon:
-  case llvm::Triple::le32:
-  case llvm::Triple::mips:
-  case llvm::Triple::mipsel:
-  case llvm::Triple::nvptx:
-  case llvm::Triple::ppc:
-  case llvm::Triple::r600:
-  case llvm::Triple::riscv32:
-  case llvm::Triple::sparc:
-  case llvm::Triple::sparcel:
-  case llvm::Triple::tce:
-  case llvm::Triple::tcele:
-  case llvm::Triple::thumb:
-  case llvm::Triple::thumbeb:
-  case llvm::Triple::x86:
-  case llvm::Triple::xcore:
-  case llvm::Triple::amdil:
-  case llvm::Triple::hsail:
-  case llvm::Triple::spir:
-  case llvm::Triple::kalimba:
-  case llvm::Triple::lanai:
-  case llvm::Triple::shave:
-  case llvm::Triple::wasm32:
-  case llvm::Triple::renderscript32:
-    return 32;
-
-  case llvm::Triple::aarch64:
-  case llvm::Triple::aarch64_be:
-  case llvm::Triple::amdgcn:
-  case llvm::Triple::bpfel:
-  case llvm::Triple::bpfeb:
-  case llvm::Triple::le64:
-  case llvm::Triple::mips64:
-  case llvm::Triple::mips64el:
-  case llvm::Triple::nvptx64:
-  case llvm::Triple::ppc64:
-  case llvm::Triple::ppc64le:
-  case llvm::Triple::riscv64:
-  case llvm::Triple::sparcv9:
-  case llvm::Triple::systemz:
-  case llvm::Triple::x86_64:
-  case llvm::Triple::amdil64:
-  case llvm::Triple::hsail64:
-  case llvm::Triple::spir64:
-  case llvm::Triple::wasm64:
-  case llvm::Triple::renderscript64:
-    return 64;
-  }
-  llvm_unreachable("Invalid architecture value");
-}
-
-bool Triple::isArch64Bit() const {
-  return getArchPointerBitWidth(getArch()) == 64;
-}
-
-bool Triple::isArch32Bit() const {
-  return getArchPointerBitWidth(getArch()) == 32;
-}
-
-bool Triple::isArch16Bit() const {
-  return getArchPointerBitWidth(getArch()) == 16;
-}
-
-Triple Triple::get32BitArchVariant() const {
-  Triple T(*this);
-  switch (getArch()) {
-  case Triple::UnknownArch:
-  case Triple::amdgcn:
-  case Triple::avr:
-  case Triple::bpfel:
-  case Triple::bpfeb:
-  case Triple::msp430:
-  case Triple::systemz:
-  case Triple::ppc64le:
-    T.setArch(UnknownArch);
-    break;
-
-  case Triple::amdil:
-  case Triple::hsail:
-  case Triple::spir:
-  case Triple::arm:
-  case Triple::armeb:
-  case Triple::hexagon:
-  case Triple::kalimba:
-  case Triple::le32:
-  case Triple::mips:
-  case Triple::mipsel:
-  case Triple::nvptx:
-  case Triple::ppc:
-  case Triple::r600:
-  case Triple::riscv32:
-  case Triple::sparc:
-  case Triple::sparcel:
-  case Triple::tce:
-  case Triple::tcele:
-  case Triple::thumb:
-  case Triple::thumbeb:
-  case Triple::x86:
-  case Triple::xcore:
-  case Triple::lanai:
-  case Triple::shave:
-  case Triple::wasm32:
-  case Triple::renderscript32:
-    // Already 32-bit.
-    break;
-
-  case Triple::aarch64:        T.setArch(Triple::arm);     break;
-  case Triple::aarch64_be:     T.setArch(Triple::armeb);   break;
-  case Triple::le64:           T.setArch(Triple::le32);    break;
-  case Triple::mips64:         T.setArch(Triple::mips);    break;
-  case Triple::mips64el:       T.setArch(Triple::mipsel);  break;
-  case Triple::nvptx64:        T.setArch(Triple::nvptx);   break;
-  case Triple::ppc64:          T.setArch(Triple::ppc);     break;
-  case Triple::sparcv9:        T.setArch(Triple::sparc);   break;
-  case Triple::riscv64:        T.setArch(Triple::riscv32); break;
-  case Triple::x86_64:         T.setArch(Triple::x86);     break;
-  case Triple::amdil64:        T.setArch(Triple::amdil);   break;
-  case Triple::hsail64:        T.setArch(Triple::hsail);   break;
-  case Triple::spir64:         T.setArch(Triple::spir);    break;
-  case Triple::wasm64:         T.setArch(Triple::wasm32);  break;
-  case Triple::renderscript64: T.setArch(Triple::renderscript32); break;
-  }
-  return T;
-}
-
-Triple Triple::get64BitArchVariant() const {
-  Triple T(*this);
-  switch (getArch()) {
-  case Triple::UnknownArch:
-  case Triple::avr:
-  case Triple::hexagon:
-  case Triple::kalimba:
-  case Triple::lanai:
-  case Triple::msp430:
-  case Triple::r600:
-  case Triple::tce:
-  case Triple::tcele:
-  case Triple::xcore:
-  case Triple::sparcel:
-  case Triple::shave:
-    T.setArch(UnknownArch);
-    break;
-
-  case Triple::aarch64:
-  case Triple::aarch64_be:
-  case Triple::bpfel:
-  case Triple::bpfeb:
-  case Triple::le64:
-  case Triple::amdil64:
-  case Triple::amdgcn:
-  case Triple::hsail64:
-  case Triple::spir64:
-  case Triple::mips64:
-  case Triple::mips64el:
-  case Triple::nvptx64:
-  case Triple::ppc64:
-  case Triple::ppc64le:
-  case Triple::riscv64:
-  case Triple::sparcv9:
-  case Triple::systemz:
-  case Triple::x86_64:
-  case Triple::wasm64:
-  case Triple::renderscript64:
-    // Already 64-bit.
-    break;
-
-  case Triple::arm:             T.setArch(Triple::aarch64);    break;
-  case Triple::armeb:           T.setArch(Triple::aarch64_be); break;
-  case Triple::le32:            T.setArch(Triple::le64);       break;
-  case Triple::mips:            T.setArch(Triple::mips64);     break;
-  case Triple::mipsel:          T.setArch(Triple::mips64el);   break;
-  case Triple::nvptx:           T.setArch(Triple::nvptx64);    break;
-  case Triple::ppc:             T.setArch(Triple::ppc64);      break;
-  case Triple::sparc:           T.setArch(Triple::sparcv9);    break;
-  case Triple::riscv32:         T.setArch(Triple::riscv64);    break;
-  case Triple::x86:             T.setArch(Triple::x86_64);     break;
-  case Triple::amdil:           T.setArch(Triple::amdil64);    break;
-  case Triple::hsail:           T.setArch(Triple::hsail64);    break;
-  case Triple::spir:            T.setArch(Triple::spir64);     break;
-  case Triple::thumb:           T.setArch(Triple::aarch64);    break;
-  case Triple::thumbeb:         T.setArch(Triple::aarch64_be); break;
-  case Triple::wasm32:          T.setArch(Triple::wasm64);     break;
-  case Triple::renderscript32:  T.setArch(Triple::renderscript64);     break;
-  }
-  return T;
-}
-
-Triple Triple::getBigEndianArchVariant() const {
-  Triple T(*this);
-  // Already big endian.
-  if (!isLittleEndian())
-    return T;
-  switch (getArch()) {
-  case Triple::UnknownArch:
-  case Triple::amdgcn:
-  case Triple::amdil64:
-  case Triple::amdil:
-  case Triple::avr:
-  case Triple::hexagon:
-  case Triple::hsail64:
-  case Triple::hsail:
-  case Triple::kalimba:
-  case Triple::le32:
-  case Triple::le64:
-  case Triple::msp430:
-  case Triple::nvptx64:
-  case Triple::nvptx:
-  case Triple::r600:
-  case Triple::riscv32:
-  case Triple::riscv64:
-  case Triple::shave:
-  case Triple::spir64:
-  case Triple::spir:
-  case Triple::wasm32:
-  case Triple::wasm64:
-  case Triple::x86:
-  case Triple::x86_64:
-  case Triple::xcore:
-  case Triple::renderscript32:
-  case Triple::renderscript64:
-
-  // ARM is intentionally unsupported here, changing the architecture would
-  // drop any arch suffixes.
-  case Triple::arm:
-  case Triple::thumb:
-    T.setArch(UnknownArch);
-    break;
-
-  case Triple::tcele:   T.setArch(Triple::tce);        break;
-  case Triple::aarch64: T.setArch(Triple::aarch64_be); break;
-  case Triple::bpfel:   T.setArch(Triple::bpfeb);      break;
-  case Triple::mips64el:T.setArch(Triple::mips64);     break;
-  case Triple::mipsel:  T.setArch(Triple::mips);       break;
-  case Triple::ppc64le: T.setArch(Triple::ppc64);      break;
-  case Triple::sparcel: T.setArch(Triple::sparc);      break;
-  default:
-    llvm_unreachable("getBigEndianArchVariant: unknown triple.");
-  }
-  return T;
-}
-
-Triple Triple::getLittleEndianArchVariant() const {
-  Triple T(*this);
-  if (isLittleEndian())
-    return T;
-
-  switch (getArch()) {
-  case Triple::UnknownArch:
-  case Triple::lanai:
-  case Triple::ppc:
-  case Triple::sparcv9:
-  case Triple::systemz:
-
-  // ARM is intentionally unsupported here, changing the architecture would
-  // drop any arch suffixes.
-  case Triple::armeb:
-  case Triple::thumbeb:
-    T.setArch(UnknownArch);
-    break;
-
-  case Triple::tce:        T.setArch(Triple::tcele);    break;
-  case Triple::aarch64_be: T.setArch(Triple::aarch64);  break;
-  case Triple::bpfeb:      T.setArch(Triple::bpfel);    break;
-  case Triple::mips64:     T.setArch(Triple::mips64el); break;
-  case Triple::mips:       T.setArch(Triple::mipsel);   break;
-  case Triple::ppc64:      T.setArch(Triple::ppc64le);  break;
-  case Triple::sparc:      T.setArch(Triple::sparcel);  break;
-  default:
-    llvm_unreachable("getLittleEndianArchVariant: unknown triple.");
-  }
-  return T;
-}
-
-bool Triple::isLittleEndian() const {
-  switch (getArch()) {
-  case Triple::aarch64:
-  case Triple::amdgcn:
-  case Triple::amdil64:
-  case Triple::amdil:
-  case Triple::arm:
-  case Triple::avr:
-  case Triple::bpfel:
-  case Triple::hexagon:
-  case Triple::hsail64:
-  case Triple::hsail:
-  case Triple::kalimba:
-  case Triple::le32:
-  case Triple::le64:
-  case Triple::mips64el:
-  case Triple::mipsel:
-  case Triple::msp430:
-  case Triple::nvptx64:
-  case Triple::nvptx:
-  case Triple::ppc64le:
-  case Triple::r600:
-  case Triple::riscv32:
-  case Triple::riscv64:
-  case Triple::shave:
-  case Triple::sparcel:
-  case Triple::spir64:
-  case Triple::spir:
-  case Triple::thumb:
-  case Triple::wasm32:
-  case Triple::wasm64:
-  case Triple::x86:
-  case Triple::x86_64:
-  case Triple::xcore:
-  case Triple::tcele:
-  case Triple::renderscript32:
-  case Triple::renderscript64:
-    return true;
-  default:
-    return false;
-  }
-}
-
-StringRef Triple::getARMCPUForArch(StringRef MArch) const {
-  if (MArch.empty())
-    MArch = getArchName();
-  MArch = ARM::getCanonicalArchName(MArch);
-
-  // Some defaults are forced.
-  switch (getOS()) {
-  case llvm::Triple::FreeBSD:
-  case llvm::Triple::NetBSD:
-    if (!MArch.empty() && MArch == "v6")
-      return "arm1176jzf-s";
-    break;
-  case llvm::Triple::Win32:
-    // FIXME: this is invalid for WindowsCE
-    return "cortex-a9";
-  case llvm::Triple::MacOSX:
-  case llvm::Triple::IOS:
-  case llvm::Triple::WatchOS:
-  case llvm::Triple::TvOS:
-    if (MArch == "v7k")
-      return "cortex-a7";
-    break;
-  default:
-    break;
-  }
-
-  if (MArch.empty())
-    return StringRef();
-
-  StringRef CPU = ARM::getDefaultCPU(MArch);
-  if (!CPU.empty())
-    return CPU;
-
-  // If no specific architecture version is requested, return the minimum CPU
-  // required by the OS and environment.
-  switch (getOS()) {
-  case llvm::Triple::NetBSD:
-    switch (getEnvironment()) {
-    case llvm::Triple::GNUEABIHF:
-    case llvm::Triple::GNUEABI:
-    case llvm::Triple::EABIHF:
-    case llvm::Triple::EABI:
-      return "arm926ej-s";
-    default:
-      return "strongarm";
-    }
-  case llvm::Triple::NaCl:
-    return "cortex-a8";
-  default:
-    switch (getEnvironment()) {
-    case llvm::Triple::EABIHF:
-    case llvm::Triple::GNUEABIHF:
-    case llvm::Triple::MuslEABIHF:
-      return "arm1176jzf-s";
-    default:
-      return "arm7tdmi";
-    }
-  }
-
-  llvm_unreachable("invalid arch name");
-}
diff --git a/third_party/llvm-subzero/lib/Support/Unix/Host.inc b/third_party/llvm-subzero/lib/Support/Unix/Host.inc
deleted file mode 100644
index 4572171..0000000
--- a/third_party/llvm-subzero/lib/Support/Unix/Host.inc
+++ /dev/null
@@ -1,49 +0,0 @@
-//===- llvm/Support/Unix/Host.inc -------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the UNIX Host support.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-//=== WARNING: Implementation here must contain only generic UNIX code that
-//===          is guaranteed to work on *all* UNIX variants.
-//===----------------------------------------------------------------------===//
-
-#include "Unix.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/Config/config.h"
-#include <cctype>
-#include <string>
-#include <sys/utsname.h>
-
-using namespace llvm;
-
-static std::string getOSVersion() {
-  struct utsname info;
-
-  if (uname(&info))
-    return "";
-
-  return info.release;
-}
-
-std::string sys::getDefaultTargetTriple() {
-  std::string TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
-
-  // On darwin, we want to update the version to match that of the
-  // target.
-  std::string::size_type DarwinDashIdx = TargetTripleString.find("-darwin");
-  if (DarwinDashIdx != std::string::npos) {
-    TargetTripleString.resize(DarwinDashIdx + strlen("-darwin"));
-    TargetTripleString += getOSVersion();
-  }
-
-  return Triple::normalize(TargetTripleString);
-}
diff --git a/third_party/llvm-subzero/lib/Support/Windows/Host.inc b/third_party/llvm-subzero/lib/Support/Windows/Host.inc
deleted file mode 100644
index fe89fe0..0000000
--- a/third_party/llvm-subzero/lib/Support/Windows/Host.inc
+++ /dev/null
@@ -1,22 +0,0 @@
-//===- llvm/Support/Win32/Host.inc ------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Win32 Host support.
-//
-//===----------------------------------------------------------------------===//
-
-#include "WindowsSupport.h"
-#include <cstdio>
-#include <string>
-
-using namespace llvm;
-
-std::string sys::getDefaultTargetTriple() {
-  return Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE);
-}