diff options
author | Steven Wu <stevenwu@apple.com> | 2021-07-14 13:29:15 -0700 |
---|---|---|
committer | Steven Wu <stevenwu@apple.com> | 2021-07-14 13:29:54 -0700 |
commit | e23dce6c974477d3476bee5256a83a9aaea8eae4 (patch) | |
tree | 1df5e278d84914a5bb64e7422fd6c4be334c3973 /llvm/lib/Support/Host.cpp | |
parent | 7b47de774fd43eb5be7aee86c6f8c15999295b36 (diff) | |
download | llvm-e23dce6c974477d3476bee5256a83a9aaea8eae4.zip llvm-e23dce6c974477d3476bee5256a83a9aaea8eae4.tar.gz llvm-e23dce6c974477d3476bee5256a83a9aaea8eae4.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Support/Host.cpp')
-rw-r--r-- | llvm/lib/Support/Host.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp index 4783517..1ecfef9 100644 --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/Support/Host.cpp @@ -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> |