[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 14:06:11 PDT 2021


steven_wu added inline comments.


================
Comment at: llvm/lib/Support/Host.cpp:1407
 int computeHostNumPhysicalCores() { return sysconf(_SC_NPROCESSORS_ONLN); }
-#elif defined(__APPLE__) && defined(__x86_64__)
+#elif defined(__APPLE__)
 #include <sys/param.h>
----------------
dexonsmith wrote:
> dexonsmith wrote:
> > Should this be checking if the target is for macOS? Or does is the functionality below available on all platforms?
> Great -- I had assumed this was an intentional iOS-related carve out, but looking back:
> - 7943fecee8726 added it for linux (on x86)
> - db46b7d217ed4 added it for darwin (on x86)
> 
> and it seems like the "x86" part was probably just cargo-culted from the Linux side.
Let me see if I can turn on Host.cpp test for AS.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106012/new/

https://reviews.llvm.org/D106012



More information about the llvm-commits mailing list