Producing compilers that generate good object code is difficult. The early phases of the compiler, syntactical and lexical analysis, have been automated. The latter phases, code generation and optimization, are more difficult because of the wide range of machine architectures. This dissertation describes a technique for the rapid implementation of production-quality compilers though the use of a machine-independent retargetable peephole optimizer, PO. PO is retargeted by providing a description of the new machine.PO simplifies many of the tasks associated with developing compilers. It simplifies code generation by eliminating most of the case-analysis typically necessary to produce good code. It simplifies the optimization phase by collecting several disparate optimizations and generalizing them as peephole optimizations. PO also demonstrates the traditional optimizations, such as register allocation, common subexpression elimination, and removal of unreachable code, may be done more thoroughly and completely when information about the target machine is available.
Cited By
- Davidson J and Fraser C (2004). Automatic generation of peephole optimizations, ACM SIGPLAN Notices, 39:4, (104-111), Online publication date: 1-Apr-2004.
- Ramsey N (2019). Pragmatic aspects of reusable program generators, Journal of Functional Programming, 13:3, (601-646), Online publication date: 1-May-2003.
- Davidson J and Fraser C Automatic generation of peephole optimizations Proceedings of the 1984 SIGPLAN symposium on Compiler construction, (111-116)
- Davidson J and Fraser C (1984). Automatic generation of peephole optimizations, ACM SIGPLAN Notices, 19:6, (111-116), Online publication date: 1-Jun-1984.
- Graham S, Henry R and Schulman R An experiment in table driven code generation Proceedings of the 1982 SIGPLAN symposium on Compiler construction, (32-43)
- Graham S, Henry R and Schulman R (1982). An experiment in table driven code generation, ACM SIGPLAN Notices, 17:6, (32-43), Online publication date: 1-Jun-1982.
Recommendations
Automatic generation of peephole superoptimizers
Proceedings of the 2006 ASPLOS ConferencePeephole optimizers are typically constructed using human-written pattern matching rules, an approach that requires expertise and time, as well as being less than systematic at exploiting all opportunities for optimization. We explore fully automatic ...