Optimal code from flow graphs

  • Authors:
  • M. V. S. Ramanath;Marvin Solomon

  • Affiliations:
  • Department of Computer Science, University of Western Ontario, London, Ontario N6A 5B6, Canada;Computer Sciences Department, University of Wisconsin, 1210 W. Dayton St, Madison, WI 53706, U.S.A.

  • Venue:
  • Computer Languages
  • Year:
  • 1982

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper considers the problem of generating a linear sequence of instructions from a flow graph so as to minimize the number of jumps. We show that for programs constructed from atomic statements with semicolon, if-then, if-then-else, and repeat-until, the minimal number of unconditional jumps is bounded from above by e + 1 and from below by max {e - b + 1, @?(e + 1)/2@?}, where e is the number of if-then-else statements and b is the number of repeat-until statements. We show that these bounds are tight and present a linear-time algorithm for finding the optimal translation of such a program.