[Support] Get correct number of physical cores on Apple Silicon

Fix a bug that `computeHostNumPhysicalCores` is fallback to default
unknown when building for Apple Silicon macs.

rdar://80533675

Reviewed By: arphaman

Differential Revision: https://reviews.llvm.org/D106012
This commit is contained in:
Steven Wu 2021-07-14 13:29:15 -07:00
parent 7b47de774f
commit e23dce6c97
1 changed files with 1 additions and 1 deletions

View File

@ -1404,7 +1404,7 @@ int computeHostNumPhysicalCores() {
}
#elif defined(__linux__) && defined(__s390x__)
int computeHostNumPhysicalCores() { return sysconf(_SC_NPROCESSORS_ONLN); }
#elif defined(__APPLE__) && defined(__x86_64__)
#elif defined(__APPLE__)
#include <sys/param.h>
#include <sys/sysctl.h>