[PATCH] D137836: [Support] Move getHostNumPhysicalCores to Threading.h
Tomas Matheson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 25 11:42:22 PST 2022
tmatheson accepted this revision.
tmatheson added a comment.
One thought about returning -1 but otherwise LGTM
================
Comment at: llvm/lib/Support/Threading.cpp:59
if (MaxThreadCount <= 0)
MaxThreadCount = 1;
if (ThreadsRequested == 0)
----------------
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`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137836/new/
https://reviews.llvm.org/D137836
More information about the cfe-commits
mailing list