IT lexicon › Programming › QBE

QBE

Programming På svenska → Updated: 2026-11-07
More info
Creator
Quentin Carbonneaux
Type
Compiler backend
License
MIT
Website

A small compiler backend written in C that promises 70 percent of an industrial compiler's performance in 10 percent of the code.

Quentin Carbonneaux started QBE around 2015, in response to LLVM having grown far too large for anyone who just wants machine code out of their own language. The input is a textual intermediate representation in SSA form; the output is assembly for amd64, arm64 and riscv64. In between sits what you need and a bit more: constant propagation, dead code elimination, a register allocator, and enough of the calling conventions to talk to C libraries.

The whole codebase can be read over a weekend, which is rather the point. The Hare language and the cproc C compiler both sit on top of QBE. The price is the absence of anything heavy: no auto-vectorisation, no link-time optimisation, a handful of targets. For a hobby language that rarely matters; for anyone chasing the last few percent, it is the entire problem.

← Back to the lexicon