Skip to content

Update host CPU detection for Apple M2 and Apple M3 #82100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion llvm/lib/TargetParser/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,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;
Expand All @@ -1490,9 +1492,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)
Expand Down