This demotes the apple-a12 CPU selection for arm64e to just be the
last-resort default. Concretely, this means:
- an explicitly-specified -mcpu will override the arm64e default;
a user could potentially pick an invalid CPU that doesn't have
v8.3a support, but that's not a major problem anymore
- arm64e-apple-macos (and variants) will pick apple-m1 instead of
being forced to apple-a12.
if (CPU == "native")
return std::string(llvm::sys::getHostCPUName());
- // arm64e requires v8.3a and only runs on apple-a12 and later CPUs.
- if (Triple.isArm64e())
- return "apple-a12";
-
if (CPU.size())
return CPU;
return "apple-m1";
}
+ // arm64e requires v8.3a and only runs on apple-a12 and later CPUs.
+ if (Triple.isArm64e())
+ return "apple-a12";
+
// Make sure we pick the appropriate Apple CPU if -arch is used or when
// targetting a Darwin OS.
if (Args.getLastArg(options::OPT_arch) || Triple.isOSDarwin())
// RUN: %clang -target arm64-apple-macos -arch arm64 -### -c %s 2>&1 | FileCheck %s
+// RUN: %clang -target arm64e-apple-macos -### -c %s 2>&1 | FileCheck %s
+
// RUN: %clang -target arm64-apple-macos -mcpu=apple-a11 -### -c %s 2>&1 | FileCheck --check-prefix=EXPLICIT-A11 %s
// RUN: %clang -target arm64-apple-macos -mcpu=apple-a7 -### -c %s 2>&1 | FileCheck --check-prefix=EXPLICIT-A7 %s
// RUN: %clang -target arm64-apple-macos -mcpu=apple-a14 -### -c %s 2>&1 | FileCheck --check-prefix=EXPLICIT-A14 %s