Abstract Compiler Optimizations Should Pay for Themselves Applying the Spirit of Oberon to Code Optimization by Compiler
SVM HeaderParse 0.1
AUTHOR NAME
Michael Franz
SVM HeaderParse 0.1
AUTHOR AFFIL
Institut für Computersysteme
SVM HeaderParse 0.2
AUTHOR ADDR
ETH Zürich, CH_8092 Zürich, Switzerland
SVM HeaderParse 0.1
ABSTRACT
Optimizing compilers tend to be much larger and much slower than their straightforward counterparts. Their designers usually do not follow Oberon's maxim of making things "as simple as possible", but are inclined to completely disregard cost (in terms of compiler size, compilation speed, and maintainability) in favor of code_quality benefits that often turn out to be relatively marginal. Trying to make an optimizing compiler as simple as possible and yet as powerful as necessary requires, before all else, a measurement standard, by which both simplicity and power can be judged. For a compiler that is written in the language it compiles, two such standards are easily found by considering first the time required for self_compilation, and then the size of the resulting object program. With the help of these benchmarks, one may pit simplicity against power, requiring that every new capability added to the compiler "pays its own way " by creating more benefit than cost on account of at least one of the measures. This paper reports of a project for adding an optimization phase to an existing Oberon compiler, resulting in a higher object_code density and an improved run_time performance of compiled code. The beneficial effects of the optimization are greater than the costs, so that the improved compiler is smaller than its predecessor when compiled by itself, while it runs almost as fast.