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

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 14 13:26:45 PDT 2021


steven_wu created this revision.
steven_wu added reviewers: arphaman, dexonsmith.
Herald added subscribers: ributzka, hiraditya.
steven_wu requested review of this revision.
Herald added a project: LLVM.

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

rdar://80533675


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106012

Files:
  llvm/lib/Support/Host.cpp


Index: llvm/lib/Support/Host.cpp
===================================================================
--- llvm/lib/Support/Host.cpp
+++ llvm/lib/Support/Host.cpp
@@ -1404,7 +1404,7 @@
 }
 #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>
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106012.358721.patch
Type: text/x-patch
Size: 437 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210714/b37c2c8c/attachment.bin>


More information about the llvm-commits mailing list