10.5 HIgh-Level Optimization
Loveman(1977) describes the optimization phase as the "term given to the application
of a set of rules for manipulating various representations of a program by
exploiting local or global invariances within the program in order to improve the program
relative to some measure."
In what follows, we assume a tree-structured representation and that the optimizations
shown are really parttern-directed rearrangements of program text. As before, it
is easier for humans to see this in source form or as quadruples.
The transformations are not applied in a random order; the successful appliction
of one transformation suggests successor transformations. In fact, transformation
ordering and information gathering is a major part of this method.
In addition, some transformations may not improve the program, but may lead to
other transformations which do optimized. Similarly, some transformations may be
machine-independent, but the reason for applying one may depend on the target
machine.
|