4 ms·
Shameless plug: I've been writing a series that's WIP about writing a tiny optimising compiler - https://github.com/bollu/tiny-optimising-compiler https://githu
by bollu 9y ago
Shameless plug: I've been writing a series that's WIP about writing a tiny optimising compiler - https://github.com/bollu/tiny-optimising-compiler https://github.com/bollu/tiny-optimising-compiler. It tries to model as much as possible, and the aim is to show off the power that modern compiler ideas bring: SSA and polyhedral compilation.
- chubot 9y agoThis looks cool, thanks for pointing it out. I'm somewhat familiar witih SSA, but I don't know anything about polyhedral compilation. What does it buy you? Is there a concise intro you could point to? (I thought I had heard someone say it makes your compiler slower for marginal benefit, but they/I could be wrong about that.) FWIW I found this introduction to the new Go SSA back end pretty useful as an overview: https://www.youtube.com/watch?v=uTMvKVma5ms https://www.youtube.com/watch?v=uTMvKVma5ms One thing that was interesting is that they seemed to have an LLVM TableGen-like "rules" DSL for both architecture-independent and -dependent optimizations / code gen. I don't think polyhedral compilation was mentioned and I don't think they use it.
- bollu 9y agoIn fact, LLVM does use polyhedral compilation :) it's just disabled by default. There's a module called Polly in LLVM which performs polyhedral optimisations! Yep, tableGen is nice but would be overkill for this tutorial project.
- gone35 9y agoSee: https://en.m.wikipedia.org/wiki/Polytope_model https://en.m.wikipedia.org/wiki/Polytope_model https://www.cs.indiana.edu/~achauhan/Teaching/B629/2010-Fall/StudentPresns/PolyhedralModelOverview.pdf https://www.cs.indiana.edu/~achauhan/Teaching/B629/2010-Fall... http://web.cs.ucla.edu/~pouchet/lectures/doc/888.11.5.pdf http://web.cs.ucla.edu/~pouchet/lectures/doc/888.11.5.pdf