forked from OSchip/llvm-project
[AArch64] Don't always override CPU for arm64e.
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.
This commit is contained in:
parent
a8a3a43792
commit
cedb5b06df
|
@ -41,10 +41,6 @@ std::string aarch64::getAArch64TargetCPU(const ArgList &Args,
|
|||
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;
|
||||
|
||||
|
@ -54,6 +50,10 @@ std::string aarch64::getAArch64TargetCPU(const ArgList &Args,
|
|||
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())
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
// 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
|
||||
|
|
Loading…
Reference in New Issue