[PATCH] D156193: Fix thinLTO long compile time problem

Zhuohang Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 05:41:51 PDT 2023


JohnLee1243 updated this revision to Diff 548995.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156193/new/

https://reviews.llvm.org/D156193

Files:
  llvm/lib/Support/Unix/Threading.inc
  llvm/unittests/Support/Threading.cpp


Index: llvm/unittests/Support/Threading.cpp
===================================================================
--- llvm/unittests/Support/Threading.cpp
+++ llvm/unittests/Support/Threading.cpp
@@ -28,6 +28,7 @@
   // some systems.
   return (Host.isOSWindows() && llvm_is_multithreaded()) || Host.isOSDarwin() ||
          (Host.isX86() && Host.isOSLinux()) ||
+         (Host.isAArch64() && Host.isOSLinux()) ||
          (Host.isOSLinux() && !Host.isAndroid()) ||
          (Host.isSystemZ() && Host.isOSzOS());
 #else
Index: llvm/lib/Support/Unix/Threading.inc
===================================================================
--- llvm/lib/Support/Unix/Threading.inc
+++ llvm/lib/Support/Unix/Threading.inc
@@ -371,6 +371,14 @@
   }
   return CPU_COUNT(&Enabled);
 }
+#elif defined(__linux__) && defined(__aarch64__)
+static int computeHostNumPhysicalCores() {
+  cpu_set_t Affinity;
+  if (sched_getaffinity(0, sizeof(Affinity), &Affinity) == 0)
+    return CPU_COUNT(&Affinity);
+ 
+  return -1;
+}
 #elif defined(__linux__) && defined(__s390x__)
 static int computeHostNumPhysicalCores() {
   return sysconf(_SC_NPROCESSORS_ONLN);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156193.548995.patch
Type: text/x-patch
Size: 1140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230810/9a36c7cd/attachment.bin>


More information about the llvm-commits mailing list