Skip to main content

1979 | OriginalPaper | Buchkapitel

Code Optimisation

verfasst von : Richard Bornat

Erschienen in: Understanding and Writing Compilers

Verlag: Macmillan Education UK

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

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.

Metadaten
Titel
Code Optimisation
verfasst von
Richard Bornat
Copyright-Jahr
1979
Verlag
Macmillan Education UK
DOI
https://doi.org/10.1007/978-1-349-16178-2_11