There's a longer paragraph on that topic in Section 8. We also previously built an LLVM back-end using that approach [1]. While that approach leads to even faster compilation, run-time performance is much worse (2.5x slower than LLVM -O0) due to more-or-less impossible register allocation for the snippets.[1]: https://home.cit.tum.de/~engelke/pubs/2403-cc.pdf
debugnik|6 months ago
How come? The Copy-and-Patch Compilation paper reports:
> The generated code runs [...] 14% faster than LLVM -O0.
I don't have time right now to compare your approach and benchmark to theirs, but I would have expected comparable performance from what I had read back then.
aengelke|6 months ago
The fact that they don't do a comparison against LLVM on larger benchmarks/functions or any other code they haven't written themselves makes that single number rather questionable for a general claim of being faster than LLVM -O0.
t0b1|6 months ago
When used in a C/C++ compiler the stencils correspond to individual (or a few) LLVM-IR instructions which then leads to bad runtime performance. Also as mentioned, on larger functions register allocation becomes a problem for the Copy-and-Patch approach.
procrast33|6 months ago
Your work is greatly appriciated. With unit tests everywhere, faster compiling is more important than ever.
PoignardAzur|6 months ago
I thought they used the same technique (pre-generating machine code snippets in a high-level language)?