[llvm] [CMake][LIT] Add option to run lit testsuites in parallel (PR #82899)
Patrick Dougherty via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 8 09:01:25 PST 2024
patrickdoc wrote:
Running the test targets in parallel can result in faster build times depending on your build graph + available resources on your machine. For example, individual targets can be started earlier or you can get increased cpu usage if threads are paused on I/O.
Here's a simple example of a handful of test targets being:
```
ninja -C build check-llvm-analysis-aliasset check-llvm-analysis-assumptioncache check-llvm-analysis-basicaa check-llvm-analysis-blockfrequencyinfo check-llvm-analysis-branchprobabilityinfo check-llvm-analysis-callgraph check-llvm-analysis-costmodel
```
Ninja trace for parallelism disabled (pre-existing behavior and current default):
![Screenshot 2024-03-08 at 10 36 45 AM](https://github.com/llvm/llvm-project/assets/1808626/05857ae6-1495-4abc-b940-999592ccd043)
Ninja trace for parallelism enabled (by enabling the new flag):
![Screenshot 2024-03-08 at 10 47 46 AM](https://github.com/llvm/llvm-project/assets/1808626/45d342e7-770b-41e9-8c0a-a369a7607fc7)
I would summarize it as: if you have multiple lit targets and idle cpu during your builds, try enabling this.
It greatly depends on your setup, but in my case it cut build times in half.
https://github.com/llvm/llvm-project/pull/82899
More information about the llvm-commits
mailing list