[llvm] [CMake] Factor check- target deps to reduce build.ninja size by 45% (PR #223592)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 09:46:12 PDT 2026


aengelke wrote:

> Is the expense just driven by large static links?

No, it comes from (re)compiling all the unit tests (~800 CUs). Everything that includes gtest.h is super expensive to compile, especially due to parsing and many template instantiations (PCH is also of limited use there). Linking is fine (and I personally use dylib builds anyway). I'd still like to have a way to "check tests/IR and rebuild all required executables for that" without building unit tests and without listing all hundred or whatever executables we currently build.

> The other cost mitigation here is the dylib build, which we've [covered extensively before](https://discourse.llvm.org/t/rfc-llvm-link-llvm-dylib-should-default-to-on-on-posix-platforms/85908?page=2). I should get fresh fall 2026 data on that idea.

In June, check-llvm was still ~10% slower, and a primary cause seemed to be the larger amount of global ctors. I'd like the dylib build to be the default.

https://github.com/llvm/llvm-project/pull/223592


More information about the llvm-commits mailing list