Skip to content

Commit 6f846c8

Browse files
committed
Improve comments after 8404aeb.
1 parent 89ab5c6 commit 6f846c8

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

llvm/include/llvm/Support/ThreadPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ThreadPool {
4343
/// Construct a pool using the hardware strategy \p S for mapping hardware
4444
/// execution resources (threads, cores, CPUs)
4545
/// Defaults to using the maximum execution resources in the system, but
46-
/// excluding any resources contained in the affinity mask.
46+
/// accounting for the affinity mask.
4747
ThreadPool(ThreadPoolStrategy S = hardware_concurrency());
4848

4949
/// Blocking destructor: the pool will wait for all the threads to complete.

llvm/include/llvm/Support/Threading.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ void llvm_execute_on_thread_async(
148148
class ThreadPoolStrategy {
149149
public:
150150
// The default value (0) means all available threads should be used,
151-
// excluding affinity mask. If set, this value only represents a suggested
152-
// high bound, the runtime might choose a lower value (not higher).
151+
// taking the affinity mask into account. If set, this value only represents
152+
// a suggested high bound, the runtime might choose a lower value (not
153+
// higher).
153154
unsigned ThreadsRequested = 0;
154155

155156
// If SMT is active, use hyper threads. If false, there will be only one
@@ -172,7 +173,7 @@ void llvm_execute_on_thread_async(
172173
/// be less efficient. Avoid this strategy if doing lots of I/O. Currently
173174
/// based on physical cores, if available for the host system, otherwise falls
174175
/// back to hardware_concurrency(). Returns 1 when LLVM is configured with
175-
/// LLVM_ENABLE_THREADS = OFF
176+
/// LLVM_ENABLE_THREADS = OFF.
176177
inline ThreadPoolStrategy
177178
heavyweight_hardware_concurrency(unsigned ThreadCount = 0) {
178179
ThreadPoolStrategy S;
@@ -219,7 +220,7 @@ void llvm_execute_on_thread_async(
219220

220221
/// Returns a mask that represents on which hardware thread, core, CPU, NUMA
221222
/// group, the calling thread can be executed. On Windows, threads cannot
222-
/// cross CPU boundaries.
223+
/// cross CPU sockets boundaries.
223224
llvm::BitVector get_thread_affinity_mask();
224225

225226
/// Returns how many physical CPUs or NUMA groups the system has.

llvm/lib/LTO/ThinLTOCodeGenerator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ extern cl::opt<std::string> RemarksFormat;
8080

8181
namespace {
8282

83-
// Default to using one job per hardware core in the system
83+
// Default to using all available threads in the system, but using only one
84+
// thred per core, as indicated by the usage of
85+
// heavyweight_hardware_concurrency() below.
8486
static cl::opt<int> ThreadCount("threads", cl::init(0));
8587

8688
// Simple helper to save temporary files for debug.

llvm/tools/llvm-lto2/llvm-lto2.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ static cl::opt<bool>
6565
"import files for the "
6666
"distributed backend case"));
6767

68-
// Default to using all hardware cores in the system.
68+
// Default to using all available threads in the system, but using only one
69+
// thread per core, as indicated by the usage of
70+
// heavyweight_hardware_concurrency() in the InProcessThinBackend constructor.
6971
static cl::opt<int> Threads("thinlto-threads", cl::init(0));
7072

7173
static cl::list<std::string> SymbolResolutions(

0 commit comments

Comments
 (0)