4 ms·
FWIW this particular optimization has been in GCC for about 15 years, though it was only enabled by default in GCC 8. It's not rocket science.
by bonzini 6y ago
FWIW this particular optimization has been in GCC for about 15 years, though it was only enabled by default in GCC 8. It's not rocket science.
- isatty 6y agoIdk, not learning compiler theory is one of my regrets from school and this does seem like rocket science to me.
- jjice 6y agoThere are a ton of great books out there! If you're looking for a bit of the whole shebang, check out Compilers: Principles, Techniques, and Tools (aka, The Dragon Book). It's an older book, but a lot of what is described in there is still very relevant and good info. If you want a more high level overview at first, I'd recommend Crafting Interpreters [0] and Writing a Compiler/Interpreter in Go [1]. The latter two focus more on lexing, parsing, and intermediate code generation. [0] https://craftinginterpreters.com/ https://craftinginterpreters.com/ [1] https://compilerbook.com/ https://compilerbook.com/
- isatty 6y agoI know I should get to it - maybe I should've done that during the COVID lockdown eh? Thanks for the links, I'll check them out.
- why_only_15 6y agoCommenters elsewhere in the thread are saying this optimization existed in LLVM as well, just that this is a more deep/efficient version of it.
- bonzini 6y agoYes, I'm referring to this particular version.