Some Topics in Code Optimization

  • Authors:
  • Christopher Earnest

  • Affiliations:
  • Computer Sciences Corporation, 650 North Sepulveda Boulevard, El Segundo, California

  • Venue:
  • Journal of the ACM (JACM)
  • Year:
  • 1974

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many compilers for higher order languages attempt to translate the source code into “good” object code. Cocke and Schwartz have described an algorithm for discovering when the computation of an expression is redundant (common), and when it can be moved to a less frequently executed region of the program. The present paper includes a tutorial presentation of their basic methods, along with a number of improvements and extensions. These include simplification of the solution method, to save a pass; extension of it to treat the safety constraint, handle multi-entry regions directly, detect additional commonality and code motion after unsafe code motion, and decide where moved code should be put; and combination of the algorithms for commonality and the dead condition, making use of important work of Ken Kennedy.The methods here applied to collecting information for use in code optimization include general algorithms for solving a set of linear equations in Boolean algebra. The algorithms are most useful when the coefficient matrix is sparse.