[all-commits] [llvm/llvm-project] d44118: [Support][X86] Change getHostNumPhsicalCores() to ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Apr 17 07:45:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d441188c15183c9496e44169966112304a1fc915
      https://github.com/llvm/llvm-project/commit/d441188c15183c9496e44169966112304a1fc915
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-04-17 (Fri, 17 Apr 2020)

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

  Log Message:
  -----------
  [Support][X86] Change getHostNumPhsicalCores() to return number of physical cores enabled by affinity

Fixes https://bugs.llvm.org/show_bug.cgi?id=45556

While here, make the x86-64 code available for x86-32.

The output has been available and stable since
https://git.kernel.org/linus/3dd9d514846cdca1dcef2e4fce666d85e199e844 (2005)
```
processor:
...
physical id:
siblings:
core id:
```

Don't check HAVE_SCHED_GETAFFINITY/HAVE_CPU_COUNT. The interface is
simply available in every libc which can build LLVM.

Reviewed By: aganea

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




More information about the All-commits mailing list