At the time of writing, just the minimum set of optimization modules necessary to generate machine code exist. These include modules to perform:
Each of these optimization modules are used without change in all of the code generators. This is accomplished by factoring out all machine and application specific information as parameters to the optimization module. Most optimization modules will be functions from (cluster -> cluster) except the last one used in the chain that will be from (cluster -> unit). The last module will typically emit assembly language instructions or machine code.
This approach can be used to implement a wide range of traditional optimizations, like constant propagation, dead code elimination, induction variable elimination, and many others. It is to be expected that some very architecture specific optimizations cannot be implemented in this generic fashion. Instruction scheduling on the Intel x86 may be one such example. In such situations the last resort of implementing a machine specific optimization can be used.
Submit a comment on this page
Author: Lal George
Last Modified: October 29, 1996
Copyright © 1996 Bell Laboratories