Middle end

From Compiler writing

Jump to: navigation, search

Lexical analysis and parsing have long been referred to as the front-end of a compiler and code generation as the back-end. For want of a better name those phases that occur between the two that have not traditionally been considered part of either of them are lumped together as the middle-end.

High powered optimizers don't do storage allocation until after some kind of pass through code generation. This enables them to figure out which variables don't need storage allocated (because they only every exist in registers) and how to order the relative locations of variables in storage (to maximize the likelihood that a value will be in cache when accessed and other optimizations).

Doing storage allocation first, assuming it has to be done at all, is simple and unless a very significant effort is put into optimization infrastructure nothing is to be gained by delaying it.

Personal tools