[clang] [AArch64] Bump default CPUs for iOS 26/watchOS 26 to A12/S6. (PR #152235)

Ahmed Bougacha via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 6 10:05:34 PDT 2025


================
@@ -52,6 +52,22 @@ std::string aarch64::getAArch64TargetCPU(const ArgList &Args,
     return "apple-m1";
   }
 
+  if (Triple.getOS() == llvm::Triple::IOS) {
+    assert(!Triple.isSimulatorEnvironment() && "iossim should be mac-like");
+    // iOS 26 only runs on apple-a12 and later CPUs.
+    if (!Triple.isOSVersionLT(26))
+      return "apple-a12";
+  }
+
+  if (Triple.isWatchOS()) {
+    assert(!Triple.isSimulatorEnvironment() && "watchossim should be mac-like");
+    // arm64_32/arm64e watchOS requires S4 before watchOS 26, S6 after.
+    if (Triple.getArch() == llvm::Triple::aarch64_32 || Triple.isArm64e())
+      return Triple.isOSVersionLT(26) ? "apple-s4" : "apple-s6";
----------------
ahmedbougacha wrote:

Yeah, that could be a sensible alternative, but I tried to keep it structured in a way that keeps each policy clearly delineated:  in this case there are distinct reasons we end up with S6;  the same applies later for the various ways we end up with A12.

https://github.com/llvm/llvm-project/pull/152235


More information about the cfe-commits mailing list