[llvm] 70da915 - Update host CPU detection for Apple M2 and Apple M3 (#82100)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 8 11:34:29 PST 2024
Author: Mads Marquart
Date: 2024-03-08T11:34:25-08:00
New Revision: 70da9155efb3aeb2c6b37678168cf29f91e80734
URL: https://github.com/llvm/llvm-project/commit/70da9155efb3aeb2c6b37678168cf29f91e80734
DIFF: https://github.com/llvm/llvm-project/commit/70da9155efb3aeb2c6b37678168cf29f91e80734.diff
LOG: Update host CPU detection for Apple M2 and Apple M3 (#82100)
`CPUFAMILY_ARM_BLIZZARD_AVALANCHE` and `CPUFAMILY_ARM_EVEREST_SAWTOOTH`
are taken from `<mach/machine.h>` in `Kernel.framework`.
Added:
Modified:
llvm/lib/TargetParser/Host.cpp
Removed:
################################################################################
diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp
index ae58ddf03f8614..ee4fd0425ca5e8 100644
--- a/llvm/lib/TargetParser/Host.cpp
+++ b/llvm/lib/TargetParser/Host.cpp
@@ -1466,6 +1466,8 @@ StringRef sys::getHostCPUName() {
#define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07d34b9f
#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504d2
#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3
+#define CPUFAMILY_ARM_BLIZZARD_AVALANCHE 0xda33d83d
+#define CPUFAMILY_ARM_EVEREST_SAWTOOTH 0x8765edea
StringRef sys::getHostCPUName() {
uint32_t Family;
@@ -1491,9 +1493,13 @@ StringRef sys::getHostCPUName() {
return "apple-a13";
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
return "apple-m1";
+ case CPUFAMILY_ARM_BLIZZARD_AVALANCHE:
+ return "apple-m2";
+ case CPUFAMILY_ARM_EVEREST_SAWTOOTH:
+ return "apple-m3";
default:
// Default to the newest CPU we know about.
- return "apple-m1";
+ return "apple-m3";
}
}
#elif defined(_AIX)
More information about the llvm-commits
mailing list