←back to thread

164 points mpweiher | 1 comments | | HN request time: 0s | source
Show context
procrast33 ◴[] No.45114870[source]
I am curious why the TPDE paper does not mention the Copy-And-Patch paper. That is a technique that uses LLVM to generate a library of patchable machine code snippets, and during actual compilation those snippets are simply pasted together. In fairness, it is just a proof of concept: they could compile WASM to x64 but not C or C++.

I have no relation to the authors.

https://fredrikbk.com/publications/copy-and-patch.pdf

replies(1): >>45114950 #
aengelke ◴[] No.45114950[source]
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

replies(3): >>45115197 #>>45115594 #>>45124559 #
1. PoignardAzur ◴[] No.45124559[source]
Wait, so what's the difference between TDPE and Copy-and-Patch?

I thought they used the same technique (pre-generating machine code snippets in a high-level language)?