skip to main content
10.1145/512927.512945acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free Access

A unified approach to global program optimization

Published:01 October 1973Publication History

ABSTRACT

A technique is presented for global analysis of program structure in order to perform compile time optimization of object code generated for expressions. The global expression optimization presented includes constant propagation, common subexpression elimination, elimination of redundant register load operations, and live expression analysis. A general purpose program flow analysis algorithm is developed which depends upon the existence of an "optimizing function." The algorithm is defined formally using a directed graph model of program flow structure, and is shown to be correct. Several optimizing functions are defined which, when used in conjunction with the flow analysis algorithm, provide the various forms of code optimization. The flow analysis algorithm is sufficiently general that additional functions can easily be defined for other forms of global code optimization.

References

  1. Aho, A., Sethi, R., and Ullman, J. A formal approach to code optimization. Proceedings of a Symposium on Compiler Optimization. University of Illinois at Urbana-Champaign, July, 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Allen, F. Program optimization. In Annual Review in Automatic Programming, Pergamon Press, 5(1969), 239-307.Google ScholarGoogle Scholar
  3. ____ A basis for program optimization. IFIP Congress 71, Ljubljana, August, 1971, 64-68.Google ScholarGoogle Scholar
  4. ____ Control flow analysis. Proceedings of a Symposium on Compiler Optimization, University of Illinois at Urbana-Champaign, July, 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Anderson, J. A note on some compiling algorithms. Comm. ACM 7, 3 (March 1964), 149-150. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Arden, B. Galler, B., and Graham, R. An algorithm for translating boolean expressions. Jour. ACM 9, 2(April 1962), 222-239. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Bachmann, P. A contribution to the problem of the optimization of programs. IFIP Congress 71, Ljubljana, August, 1971, 74-78.Google ScholarGoogle Scholar
  8. Ballard, A., and Tsichritzis, D. Transformations of programs. IFIP Congress 71, Ljubljana, August, 1971, 89-93.Google ScholarGoogle Scholar
  9. Breuer, M. Generation of optimal code for expressions via factorization. Comm. ACM 12, 6(June 1970), 333-340. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Busam, V., and Englund, D. Optimization of expressions in FORTRAN. Comm. ACM 12, 12(Dec. 1969), 666-674. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Cocke, J. Global common subexpression elimination. Proceedings of a Sybposium on Compiler Optimization. University of Illinois at Urbana-Champaign, July, 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. ____, and Miller, R. Some analysis techniques for optimizing computer programs. Proc. Second International Conference of System Sciences, Hawaii, January, 1969, 143-146.Google ScholarGoogle Scholar
  13. ____, and Schwartz, J. Programming Languages and Their Compilers: Preliminary Notes. Courant Institute of Mathematical Sciences, New York University, 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Day, W. Compiler assignment of data items to registers. IBM Systems Journal, 8, 4(1970), 281-317.Google ScholarGoogle Scholar
  15. Earnest, C., Balke, K., and Anderson, J. Analysis of graphs by ordering nodes. Jour. ACM 19, 1(Jan. 1972), 23-42. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Elson, M., and Rake, S. Code generation technique for large language compilers. IBM Systems Journal 3(1970), 166-188.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Fateman, R. Optimal code for serial and parallel computation. Comm. ACM 12, 12(Dec. 1969), 694-695. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Finkelstein, M. A compiler optimization technique. The Computer Review (Feb. 1968), 22-25.Google ScholarGoogle Scholar
  19. Floyd, R. An algorithm for coding efficient arithmetic operations. Comm. ACM 4, 1(Jan. 1961), 42-51. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Frailey, D. Expression Optimization using unary complement operators. Proceedings of a Symposium on Compiler Optimization, University of Illinois at Urbana-Champaign, July, 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. ____, A study of optimization using a general purpose optimizer. (PhD Thesis) Purdue University, Lafayette, Ind., January 1971. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Freiburghouse, R. The MULTICS PL/I compiler. AFIPS Conf. Proc. FJCC (1969), 187-199.Google ScholarGoogle Scholar
  23. Gear, C. High speed compilation of efficient object code. Comm. ACM 8, 8(Aug. 1965), 483-488. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Gries, D. Compiler Construction for Digital Computers. John Wiley and Sons, Inc., New York, 1971. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Hill, V., Langmaack, H., Schwartz, H., and Seegumuller, G. Efficient handling of subscripted variables in ALGOL-60 compilers. Proc. Symbolic Languages in Data Processing, Gordon and Breach, New York, 1962, 331-340.Google ScholarGoogle Scholar
  26. Hopkins, M. An optimizing compiler design. IFIP Congress 71, Ljubljana, August, 1971, 69-73.Google ScholarGoogle Scholar
  27. Horowitz, L., Karp, R., Miller, R., and Winograd, S. Index register allocation. Jour. ACM 13, 1(Jan. 1966), 43-61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Huskey, H., and Wattenberg, W. Compiling techniques for boolean expressions and conditional statements in ALGOL-60. Comm. ACM 4, 1(Jan. 1961), 70-75. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Huskey, H. Compiling techniques for algebraic expressions. Computer Journal 4, 4(April 1961), 10-19.Google ScholarGoogle ScholarCross RefCross Ref
  30. Huxtable, D. On writing an optimizing translator for ALGOL-60. In Introduction to System Programming, Academic Press, Inc., New York, 1964.Google ScholarGoogle Scholar
  31. IBM System/360 Operating System, FORTRAN IV (G and H) Programmer's Guide. c28-6817-1, International Business Machines, 1967, 174-179.Google ScholarGoogle Scholar
  32. Kennedy, K. A global flow analysis algorithm. Intern. J. of Computer Mathematics, Section A, Vol. 3, 1971, 5-15.Google ScholarGoogle Scholar
  33. Kildall, G. Global expression optimization during compilation. Technical Report No. TR# 72-06-02, University of Washington Computer Science Group, University of Washington, Seattle, Washington, June, 1972.Google ScholarGoogle Scholar
  34. ____ A code synthesis filter for basic block optimization. Technical Report No. TR# 72-01-01, University of Washington Computer Science Group, University of Washington, Seattle, Washington, January, 1972.Google ScholarGoogle Scholar
  35. Lowry, E., and Medlock, C. Object code optimization. Comm. ACM 12, 1(Jan. 1969), 13-22. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Luccio, F. A comment on index register allocation. Comm. ACM 10,9 (Sept. 1967), 572-572-574. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Maurer, W. Programming-An Introduction to Computer Language Technique. Holden-Day, San Francisco, 1968, 202-203.Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. McKeeman, W. Peephole optimization. Comm. ACM 8, 7(July 1965), 443-444. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Nakata, I. On compiling algorithms for arithmetic expressions. Comm. ACM 19, 8(Aug. 1967), 492-494. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Nievergelt, J. On the automatic simplification of computer programs. Comm. ACM 8, 6(June 1965), 366-370. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Painter, J. Compiler effectiveness. Proceedings of a Symposium on Compiler Optimization, University of Illinois at Urbana-Champaign, July, 1970.Google ScholarGoogle Scholar
  42. Randell, B., and Russell, L. ALGOL 60 Implementation. Academic Press, Inc., New York, 1964. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Redziejowski, R. On arithmetic expressions and trees. Comm. ACM 12, 2(Feb. 1969), 81-84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Ryan, J. A direction-independent algorithm for determining the forward and backward compute points for a term or subscript during compilation. Computer Journal 9, 2(Aug. 1966), 157-160.Google ScholarGoogle ScholarCross RefCross Ref
  45. Schnieder, V. On the number of registers needed to evaluate arithmetic expressions. BIT 11(1971), 84-93.Google ScholarGoogle ScholarCross RefCross Ref
  46. Sethi, R., and Ullman, J. The generation of optimal code for arithmetic expressions. Jour. ACM 17, 4(Oct. 1970), 715-728. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Wagner, R. Some techniques for algebraic optimization with application to matrix arithmetic expressions. Thesis, Carnegie-Mellon University, June, 1968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Yershov, A. On programming of arithmetic operations. Comm. ACM 1, 8(Aug. 1958), 3-6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. ____ ALPHA-an automatic programming system of high efficiency. Jour. ACM 13, 1(Jan. 1966), 17-24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  1. A unified approach to global program optimization

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      POPL '73: Proceedings of the 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages
      October 1973
      242 pages
      ISBN:9781450373494
      DOI:10.1145/512927

      Copyright © 1973 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 October 1973

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      POPL '73 Paper Acceptance Rate22of100submissions,22%Overall Acceptance Rate824of4,130submissions,20%

      Upcoming Conference

      POPL '25

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader