VOOZH about

URL: https://www.phoronix.com/news/LLVM-PCH-Consideration

⇱ Pre-Compiled Headers Being Debated For LLVM/Clang To Speed-Up Build By 1.5~2x - Phoronix


👁 Phoronix

Pre-Compiled Headers Being Debated For LLVM/Clang To Speed-Up Build By 1.5~2x

Written by Michael Larabel in LLVM on 6 January 2026 at 09:05 AM EST. 27 Comments
LLVM developers and other stakeholders have begun debating the use of pre-compiled headers "PCH" as a means of speeding up the compiulation of the LLVM compiler infrastructure by 1.5x to 2x than with non-PCH builds.

A request for comments (RFC) pull request was opened last week over using pre-compiled headers to speed-up the LLVM build. Due to most time in LLVM builds being spent repeatedly parsing headers, PCH is being considered for frequently used header files like the C++ standard library, IR, and code generation headers. C++ modules didn't help build times and destroyed parallelism performance and thus pre-compiled headers are being considered to allow for more quickly building LLVM. With pre-compiled headers you are basically archiving the parsed header files already lowered into an intermediate representation (IR) for quicker re-use during the build process.

👁 LLVM PCH pull request


Leveraging pre-compiled headers for building LLVM has been found to speed-up the build time by 1.5~2x. That's significant time savings considering LLVM Discourse thread was started for discussing whether to use pre-compiled headers by LLVM and if so whether it should be the default or not, among other topics. At this point it isn't clear how this discussion will end for LLVM's proposed use of pre-compiled headers.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.