
6 An Introduction to Compiler Construction in a Java World
1.3.3 “Middle End”
Sometimes, a compiler will have an optimizer, which sits between the front end and the
back end. Because of its location in the compiler architecture, we often call it the “middle
end,” with a little tongue-in-cheek.
FIGURE 1.6 The “middle end”: Optimization.
The purpose of the optimizer (Figure 1.6) is both to improve the IR program and to
collect information that the back end may use for producing better code. The optimizer
might do any number of the following:
• It might organize the program into what are called basic blocks: blocks of code from
which there are no branc