[clang] [flang] [lld] [llvm] [mlir] [RFC] Use pre-compiled headers to speed up LLVM build (~1.5-2x) (PR #173868)
Martin Storsjö via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 8 03:03:18 PST 2026
mstorsjo wrote:
FWIW, some test feedback on this patchset:
On Ubuntu 20.04, with the stock system libstdc++ 9, I get this:
```
In file included from <built-in>:1:
In file included from llvm-project/llvm/build-clang/third-party/unittest/CMakeFiles/llvm_gtest.dir/cmake_pch.hxx:6:
In file included from llvm-project/llvm/include/llvm/Support/pch.h:74:
In file included from /usr/lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/execution:32:
In file included from /usr/lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/pstl/glue_execution_defs.h:52:
In file included from /usr/lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/pstl/algorithm_impl.h:25:
In file included from /usr/lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/pstl/parallel_backend.h:14:
/usr/lib/gcc/aarch64-linux-gnu/9/../../../../include/c++/9/pstl/parallel_backend_tbb.h:19:10: fatal error: 'tbb/blocked_range.h' file not found
19 | #include <tbb/blocked_range.h>
| ^~~~~~~~~~~~~~~~~~~~~
```
On Ubuntu 24.04 with GCC, I get lots of these warnings, and no measurable speedup:
```
[581/5825] Building CXX object utils/T...leGenCommon.dir/CodeGenRegisters.cpp.o
cc1plus: warning: llvm-project/llvm/build/lib/Support/CMakeFiles/LLVMSupport.dir/cmake_pch.hxx.gch: not used because `LLVM_BUILD_STATIC' is defined [-Winvalid-pch]
```
On Ubuntu 24.04 with Clang, I do see something of a speedup though.
https://github.com/llvm/llvm-project/pull/173868
More information about the cfe-commits
mailing list