Simple code optimizations
- 1 August 1983
- journal article
- Published by Wiley in Software: Practice and Experience
- Vol. 13 (8) , 745-763
- https://doi.org/10.1002/spe.4380130808
Abstract
Program optimization has received a great deal of attention for many years, which has resulted in numerous advances in compiler technology. The effectiveness of various simple optimizations has received comparably little attention during the same time period. The simplicity of most programs suggests that straightforward optimizations pay the greatest dividends. This paper describes three such optimizations suitable for one‐pass compilers. The optimizations involve expression rearrangement, instruction selection, and the use of a cache for the allocation of resources. The cost of these optimizations is low; none require major changes to the size or structure of the compiler or reduce compilation speed by more than 10%. The benefits are high; each optimization results in at least a 10% average reduction in object code size and a corresponding reduction in execution time. Examples and implementation details are also described.Keywords
This publication has 25 references indexed in Scilit:
- Control flow aspects of semantics directed compiling (Summary)ACM SIGPLAN Notices, 1982
- A contextual analysis of Pascal programsSoftware: Practice and Experience, 1982
- Compiling short-circuit boolean expressions in one passSoftware: Practice and Experience, 1981
- Construction of a peephole optimizerSoftware: Practice and Experience, 1981
- The Y programming languageACM SIGPLAN Notices, 1981
- Programming toolsACM SIGPLAN Notices, 1978
- The best simple code generation technique for WHILE, FOR, and DO loopsACM SIGPLAN Notices, 1978
- Implications of structured programming for machine architectureCommunications of the ACM, 1978
- On code generation in a PASCAL compilerSoftware: Practice and Experience, 1977
- Software toolsACM SIGSOFT Software Engineering Notes, 1976