Optimal code generation for expression trees

  • Authors:
  • A. V. Aho;S. C. Johnson

  • Affiliations:
  • -;-

  • Venue:
  • STOC '75 Proceedings of seventh annual ACM symposium on Theory of computing
  • Year:
  • 1975

Quantified Score

Hi-index 0.00

Visualization

Abstract

We discuss the problem of generating code for a wide class of machines, restricting ourselves to the computation of expression trees. After defining a broad class of machines and discussing the properties of optimal programs on these machines, we derive a necessary and sufficient condition which can be used to prove the optimality of any code generation algorithm for expression trees on this class. We then present a dynamic programming algorithm which produces optimal code for any machine in the class; this algorithm runs in time which is linearly proportional to the number of vertices in an expression tree.