next up previous contents
Next: Static Single-Assignment Form Up: Optimizer Previous: Optimizer

Quadruples

The first step of the optimization phase is conversion of the IR tree to quadruples , simple statements computing an operation of no more than two operands. The conversion to quadruples involves flattening the IR tree through the introduction of new temporary variables. The converted IR tree is a list consisting of only nine types of simple statements:

MOVE $a \leftarrow b$   $a \leftarrow b\;binop\;c$ BINOP
LOAD $a \leftarrow M\lbrack b\rbrack$   $M\lbrack a\rbrack \leftarrow b$ STORE
CALLSUB $f(a_1,\ldots,a_n)$   $a \leftarrow f(b_1,\ldots,b_n) $ CALLFUN
LABEL L:   goto L GOTO
COND. 2lif $a\;relop\;b$ goto L1 else goto L2      

Once the quadruples have been generated, the code is converted to Static Single-Assignment (SSA) form [C+91] for optimization.



C. Scott Ananian
10/11/1997