aganea added a comment.

@thakis I think this is a side-effect of implementing 
`computeHostNumPhysicalCores()` for Windows, which previously returned -1, 
which in turn made `llvm::heavyweight_hardware_concurrency()` previously behave 
like `llvm::hardware_concurrency()` (on Windows only).
At first sight, Linux seems to report the same thing as Windows (2 cores per 
"module"). If I read this 
<https://askubuntu.com/questions/240235/identical-cores-in-proc-cpuinfo> 
correctly, the behavior on Linux for a AMD Opteron is/was the same as it is 
currently on Windows after this patch, that is, only one core out of two would 
be used for `llvm::heavyweight_hardware_concurrency()`.

I think this is a wider problem outside the scope of this patch, which is, some 
users want to use 100% of the cores/hyper-threads when using ThinLTO. Currently 
there's no way. An algorithm using `llvm::heavyweight_hardware_concurrency()` 
explicitly states "I only want one core out of two". It'd be nice if we had a 
cmd-line flag to override this, to say "I want to use all 
hyper-threads/cores/modules". `/opt:lldltojobs=all`? The impact is small on a 
modern Intel Skylake CPU, but it might be better depending on the CPU (AMD 
Bulldozer).

F11420112: image.png <https://reviews.llvm.org/F11420112>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71775



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to