aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Unix/Threading.inc
diff options
context:
space:
mode:
authorQiongsi Wu <274595+qiongsiwu@users.noreply.github.com>2023-09-29 10:23:20 -0400
committerGitHub <noreply@github.com>2023-09-29 10:23:20 -0400
commit2cac95ba2bd91adb4dad552993d589770ec6996d (patch)
treee6d5f54a968844d1756644231551988bf2367a83 /llvm/lib/Support/Unix/Threading.inc
parentab9cd27fa4338b76c0288802d97e261cf3e966b7 (diff)
downloadllvm-2cac95ba2bd91adb4dad552993d589770ec6996d.zip
llvm-2cac95ba2bd91adb4dad552993d589770ec6996d.tar.gz
llvm-2cac95ba2bd91adb4dad552993d589770ec6996d.tar.bz2
[AIX][PowerPC] Teach the Threading Library About the Number of Physical Cores on AIX (#67683)
The threading library does not recognize AIX and always returns `-1` for number of physical cores on AIX. This PR teaches the library to recognize AIX and obtain the correct value for the number of physical cores.
Diffstat (limited to 'llvm/lib/Support/Unix/Threading.inc')
-rw-r--r--llvm/lib/Support/Unix/Threading.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc
index 819748d..55e7dcf 100644
--- a/llvm/lib/Support/Unix/Threading.inc
+++ b/llvm/lib/Support/Unix/Threading.inc
@@ -371,7 +371,7 @@ static int computeHostNumPhysicalCores() {
}
return CPU_COUNT(&Enabled);
}
-#elif defined(__linux__) && defined(__s390x__)
+#elif (defined(__linux__) && defined(__s390x__)) || defined(_AIX)
static int computeHostNumPhysicalCores() {
return sysconf(_SC_NPROCESSORS_ONLN);
}