[all-commits] [llvm/llvm-project] 36a4f1: Fix computeHostNumPhysicalCores() for Linux on POW...

etiotto via All-commits all-commits at lists.llvm.org
Thu Jul 30 11:06:22 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 36a4f1037628683f2a10c0f3a84904f0463432ff
      https://github.com/llvm/llvm-project/commit/36a4f1037628683f2a10c0f3a84904f0463432ff
  Author: Ettore Tiotto <etiotto at ca.ibm.com>
  Date:   2020-07-30 (Thu, 30 Jul 2020)

  Changed paths:
    M llvm/lib/Support/Host.cpp
    M llvm/unittests/Support/Host.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list