[Support][X86] Change getHostNumPhsicalCores() to return number of physical cores...
authorFangrui Song <maskray@google.com>
Thu, 16 Apr 2020 19:05:53 +0000 (12:05 -0700)
committerFangrui Song <maskray@google.com>
Fri, 17 Apr 2020 14:45:04 +0000 (07:45 -0700)
commitd441188c15183c9496e44169966112304a1fc915
treefaa8da5e65484c9d6eac98a750a0fdbbea1581b2
parent55e3a7c6b21fb21d88896a9548b95384d2bd97dd
[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
llvm/lib/Support/Host.cpp