[llvm-dev] Multi-Threading Compilers
Chris Lattner via llvm-dev
llvm-dev at lists.llvm.org
Mon Mar 2 10:07:47 PST 2020
On Mar 1, 2020, at 1:29 AM, Neil Nelson via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> The point
> When the number of compiles exceeds the number of cores such that all the cores are utilized, nothing is gained by trying to multi-thread the individual compiles. In fact, loading up the cores with more threads or tasks than there are cores will reduce compiling efficiency because of time slicing. And sequencing through more tasks than less when the cores are not overloaded will reduce compiling efficiency because more tasks have to be loaded and unloaded to the cores.
That makes a lot of sense Neil. Two counterpoints though:
1) In development situations, it is common to rebuild one file (the one you changed) without rebuilding everything. Speeding that up is useful.
2) LLVM is a library that is used for a lot more than just C compilers. Many of its use cases are not modeled by bulk “compile all the code” workloads like you describe.
You’re right that multithreading isn’t a panacea, but in my opinion, it is important to be able to provide access to multicore compilation for use cases that do benefit from it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev