Code Optimisation
Abstract
In this book I argue that for a modern, well-designed programming language a compiler which includes a tree-walking simple translation phase can produce acceptable object code, particularly when careful attention is paid to the ‘crucial code fragments’ discussed in chapters 5, 6, 7 and 9 and in section III. No matter how carefully the individual code fragments are designed, though, the code produced by such a compiler can rarely be ‘optimal’ and it is always easy to spot redundant instructions in the object program or to think of ways in which a particular source construct could be better translated in a particular setting. Code optimisation techniques attempt systematically to reduce the disparity between the code produced by a compiler and the code which might be generated by a very careful hand-translation of the source program. The simpler techniques, discussed in this chapter, merely re-order and merge code fragments which might be produced by simple translation, but more advanced techniques can go so far as to replace the source program’s algorithm with a more efficient algorithm of equivalent effect.
Related Papers
- → Compiling with code-size constraints(2004)19 cited
- → Compiling with code-size constraints(2002)27 cited
- → An Efficient Code Generation Algorithm for Code Size Reduction Using 1-Offset P-Code Queue Computation Model(2007)5 cited
- → Compiling with code-size constraints(2002)
- → Compiling with code-size constraints(2002)