BURS (bottom-up rewrite system)
A technique for generating instruction selectors that find the cheapest cover of an expression tree by dynamic programming.
The target machine is described as a grammar of tree patterns, each with a cost. A first pass walks bottom-up and records, for every node, the cheapest rule for each nonterminal; a second pass walks top-down, picks the winners and emits instructions. Unlike maximal munch, the result is optimal for the tree.
The theory came from Eduardo Pelegrí-Llopart and Susan Graham in 1988. Christopher Fraser, Robert Henry and Todd Proebsting built BURG in 1992, which precomputes everything into tables when the generator runs. The same year brought iburg from Fraser, David Hanson and Proebsting, which does the work at compile time instead and fits in a few hundred lines of C — it drove the lcc compiler. The catch is that it all works on trees: values reused in a DAG have to be split apart first.