Advertisement

Finite constants: Characterizations of a new decidable set of constants

  • Bernhard Steffen
  • Jens Knoop
Communications
Part of the Lecture Notes in Computer Science book series (LNCS, volume 379)

Abstract

Constant propagation — the replacement of program terms which represent a unique value at run time by their values — is a classical program optimization method. In spite of being treated for years, constant propagation still has been in the unsatisfactory phase of heuristics. We enhance the known constant propagation techniques to obtain an algorithm which is optimal for programs without loops. Fundamental is the introduction of a new decidable set of constants, the finite constants. This set has two different characterizations: a denotational one, which directly specifies our iterative algorithm and an operational one, which delivers the completeness or optimality of this algorithm for programs without loops. The algorithm is implemented in a commercial compiler project.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    A. V. Aho and J. D. Ullman. Principles of Compiler Design. Addison-Wesley, 1977.Google Scholar
  2. [2]
    F. E. Allen. Control flow analysis. ACM Sigplan Notices, July 1970.Google Scholar
  3. [3]
    B. Alpern, M. N. Wegman, and F. K. Zadeck. Detecting equality of variables in programs. In 15th POPL, pages 1–11, San Diego, 1988.Google Scholar
  4. [4]
    J. Cocke and J. T. Schwartz. Programming languages and their compilers. Preliminary notes, Courant Institute of Mathematical Sciences, New York University, April 1970.Google Scholar
  5. [5]
    V. Donzeau-Gouge. Denotational definition of properties of program computations. In St. S. Muchnick and N. D. Jones, editors, Program Flow Analysis: Theory and Applications. Prentice Hall, New Jersey, 1981.Google Scholar
  6. [6]
    J. Ferrante and K. J. Ottenstein. A program form based on data dependency in predicate regions. In 10th POPL, pages 217–236, Austin, Texas, 1983.Google Scholar
  7. [7]
    J. B. Kam and J. D. Ullman. Monotone data flow analysis frameworks. Acta Informatica, 7:309–317, 1975.Google Scholar
  8. [8]
    J. B. Kam and J. D. Ullman. Global data flow analysis and iterative algorithms. Journal of the ACM, 23(1):158–171, January 1976.Google Scholar
  9. [9]
    K. W. Kennedy. Variable subsumption with constant folding. SETL Newsletter 112, Courant Institute of Mathematical Sciences, New York University, August 1973.Google Scholar
  10. [10]
    G. A. Kildall. Global expression optimization during compilation. Technical Report 72-06-02, University of Washington, Computer Science Group, Seattle, Washington, 1972.Google Scholar
  11. [11]
    G. A. Kildall. A unified approach to global program optimization. In 1st POPL, pages 194–206, Boston, Massachusetts, 1973.Google Scholar
  12. [12]
    F. Nielson. A bibliography on abstract interpretations. ACM Sigplan Notices, 21:31–38, 1986.Google Scholar
  13. [13]
    J. H. Reif and R. Lewis. Symbolic evaluation and the global value graph. In 4th POPL, pages 104–118, Los Angeles, California, 1977.Google Scholar
  14. [14]
    J. H. Reif and R. Lewis. Efficient symbolic analysis of programs. Technical Report 37–82, Harvard University, Aiken Computation Laboratory, 1982.Google Scholar
  15. [15]
    B. Steffen. Abstrakte Interpretationen beim Optimieren von Programmlaufzeiten. Ein Optimalitätskonzept und seine Anwendung. PhD thesis, Christian-Albrechts-Universität Kiel, 1987.Google Scholar
  16. [16]
    B. Steffen. Optimal run time optimization — proved by a new look at abstract interpretations. In TAPSOFT '87, pages 52–68. LNCS 249, 1987.Google Scholar
  17. [17]
    B. Steffen. Optimal data flow analysis via observational equivalence. In MFCS '89, Lecture Notes in Computer Science. Springer Verlag, 1989.Google Scholar
  18. [18]
    B. Steffen and J. Knoop. Term closures for optimal program optimization. To appear.Google Scholar
  19. [19]
    B. Steffen and J. Knoop. Ein optimales interpretationsunabhängiges Datenflußanalyseverfahren. Technical Report 8711: Programmspezifikation — Midlum/Föhr, 1987, Christian-Albrechts-Universität Kiel, Institut für Informatik, West-Germany, 1987.Google Scholar
  20. [20]
    B. Steffen and J. Knoop. Finite constants: Characterizations of a new decidable set of constants. LFCS Report Series 8979, LFCS, Edinburgh Univ., Dept. of Comp. Sci., 1989.Google Scholar
  21. [21]
    R. E. Tarjan. Fast algorithms for solving path problems. Journal of the ACM, 28(3):594–614, July 1981.Google Scholar
  22. [22]
    B. Wegbreit. Property extraction in well-founded property sets. IEEE Transactions on Software Engineering, 1(3):270–285, September 1975.Google Scholar
  23. [23]
    M. N. Wegman and F. K. Zadeck. Constant propagation with conditional branches. In 12th POPL, pages 291–299, New Orleans, Lousiana, 1985.Google Scholar
  24. [24]
    R. Wilhelm. Global flow analysis and optimization in the MUG2 compiler generating system. In St. S. Muchnick and N. D. Jones, editors, Program Flow Analysis: Theory and Applications. Prentice Hall, New Jersey, 1981.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1989

Authors and Affiliations

  • Bernhard Steffen
    • 1
  • Jens Knoop
    • 2
  1. 1.Laboratory for Foundations of Computer ScienceUniversity of EdinburghUK
  2. 2.Institut für Informatik und Praktische MathematikChristian-Albrechts-UniversitätKiel 1

Personalised recommendations