HomePhabricator

Fix computeHostNumPhysicalCores() for Linux on POWER and Linux on Z

Authored by etiotto on Jul 30 2020, 8:36 AM.

Description

Fix computeHostNumPhysicalCores() for Linux on POWER and Linux on Z

ThinLTO is run using a single thread on Linux on Power. The
compute_thread_count() routine calls getHostNumPhysicalCores which
returns -1 by default, and so `MaxThreadCount is set to 1.

unsigned llvm::ThreadPoolStrategy::compute_thread_count() const {

 int MaxThreadCount = UseHyperThreads
       ? computeHostNumHardwareThreads()
       : sys::getHostNumPhysicalCores();
  if (MaxThreadCount <= 0)
     MaxThreadCount = 1;
…

}
Fix: provide custom implementation of getHostNumPhysicalCores for
Linux on Power and Linux on Z.

Reviewed By: Kai, uweigand

Differential Revision: https://reviews.llvm.org/D84764

Details

Committed
etiottoJul 30 2020, 11:05 AM
Reviewer
Kai
Differential Revision
D84764: Fix computeHostNumPhysicalCores() for Linux on POWER and Linux on Z
Parents
rGce1eb7af9dc1: [WebAssembly] Fixed 64-bit indices in br_table
Branches
Unknown
Tags
Unknown