[PATCH] D137836: [Support] Move getHostNumPhysicalCores to Threading.h

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 01:50:42 PST 2022


lenary marked 3 inline comments as done.
lenary added a comment.

Going to attempt to land this again today.



================
Comment at: llvm/lib/Support/Threading.cpp:59
   if (MaxThreadCount <= 0)
     MaxThreadCount = 1;
   if (ThreadsRequested == 0)
----------------
tmatheson wrote:
> It looks like this is the only place `get_physical_cores` is used, and if the number is unknown or threading is disabled `MaxThreadCount` is just set to 1. Would it not make sense to change `get_physical_cores` to return 1, like `compute_thread_count`?
I'd rather keep the unknown semantic, so it's clearer why someone is getting the answer they are.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137836



More information about the llvm-commits mailing list