ThinLTO is run using a single thread on Linux on Power. The compute_thread_count() routine calls getHostNumPhysicalCores which returns -1 by default, and so `MaxThreadCount is set to 1.
unsigned llvm::ThreadPoolStrategy::compute_thread_count() const {
int MaxThreadCount = UseHyperThreads ? computeHostNumHardwareThreads()
: sys::getHostNumPhysicalCores();
if (MaxThreadCount <= 0)
MaxThreadCount = 1;
…
}Fix: provide custom implementation of getHostNumPhysicalCores for Linux on Power and Linux on Z.
defined(__ppc__) || defined(__powerpc__) is redundant.
You could just use defined(__powerpc__)