Index: llvm/lib/Support/Host.cpp =================================================================== --- llvm/lib/Support/Host.cpp +++ llvm/lib/Support/Host.cpp @@ -1271,6 +1271,12 @@ } return CPU_COUNT(&Enabled); } +#elif (defined(__linux__) && \ + (defined(__ppc__) || defined(__powerpc__) || defined(__s390x__))) +#include + +// Gets the number of *physical cores* on the machine. +int computeHostNumPhysicalCores() { return sysconf(_SC_NPROCESSORS_ONLN); } #elif defined(__APPLE__) && defined(__x86_64__) #include #include Index: llvm/unittests/Support/Host.cpp =================================================================== --- llvm/unittests/Support/Host.cpp +++ llvm/unittests/Support/Host.cpp @@ -40,7 +40,9 @@ // x86_64 Linux and Darwin. return (Host.isOSWindows() && llvm_is_multithreaded()) || (Host.isX86() && - (Host.isOSDarwin() || Host.getOS() == Triple::Linux)); + (Host.isOSDarwin() || Host.getOS() == Triple::Linux)) || + (Host.getOS() == Triple::Linux && + (Host.isPPC64() || Host.isSystemZ())); } HostTest() : Host(Triple::normalize(sys::getProcessTriple())) {}