Can we expect Clang to implement the same trick in a few months time?
Can we expect Clang to implement the same trick in a few months time?
LLVM is not amenable to using multiple threads to compile a single TU. The use-lists of global values (such as functions, global variables, or constant expressions) include all uses from all functions, so parallelizing on a per-function basis requires acquiring locks (or some sort of lock-free data structure) to add, remove, or iterate these lists, which would considerable overhead on a relatively common operation.
If you want more details, you can read the recent thread on llvm-dev discussing this: http://lists.llvm.org/pipermail/llvm-dev/2020-March/139606.h...
LLVM can process multiple codegen units in parallel already, and many frontends split TUs into multiple codegen units.