Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

QBE – a new compiler back end

Name: Anonymous 2016-05-08 1:01

QBE aims to be a pure C embeddable backend that provides 70% of the performance of advanced compilers in 10% of the code. Its small size serves both its aspirations of correctness and our ability to understand, fix, and improve it. It also serves its users by providing trivial integration and great flexibility.

http://c9x.me/compile/

Name: Anonymous 2016-05-09 1:06

As far toy compilers go, looks pretty nice. Is there a particular reason for textual representation of the SSA IR (aside from debugging)?

Apparent x86 specificity is kinda meh, but I guess that will be refactored into pluggable codegen at some point.

Another wart is that it's already larger than TCC (which supports 4 target CPUs and gcc asm intrinsics).

Moreover, TCC performs surprisingly well on modern superscalar cpu, especially on "general", branchy benchmarks (it will perform much worse on tight loop code thanks to high cache footprint). Maybe it might help to publish debian shootout of the two.

One could also argue that compilers are this all or nothing situation. Either write simple, non-optimizing single pass compiler, and spend the complexity on compatibility with gcc.

Or write aggressively optimizing compiler competing with llvm/gcc. If QBE goal is really the latter, then godspeed to you - sane llvm alternative would be especially nice.

Name: Anonymous 2016-05-09 14:31

Another wart is that it's already larger than TCC (which supports 4 target CPUs and gcc asm intrinsics).
I was gonna call you out on that but I think you're actually right. QBE is ``less than 8 kloc'', while the main logic of TCC is like 4-5 kloc. Also, doesn't TCC retarget by just having you recompile the whole thing but with a different target (no 'plug-and-play')?
Still, TCC also has its set of issues (register alloc..?, only few warnings etc.); I've also noticed problems when passing/returning structs...
I still use it as my 'main' (read: hobby) compiler, though.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List