skip to main content
article
Free Access

A Fast and Usually Linear Algorithm for Global Flow Analysis

Authors Info & Claims
Published:01 January 1976Publication History
Skip Abstract Section

Abstract

A new algorithm for global flow analysis on reducible graphs is presented. The algorithm is shown to treat a very general class of function spaces. For a graph of e edges, the algorithm has a worst-case time bound of O(e log e) function operations. It is also shown that in programming terms, the number of operations is proportional to e plus the number of exits from program loops. Consequently a restriction to one-entry one-exit control structures guarantees linearity. The algorithm can be extended to yet larger classes of function spaces and graphs by relaxing the time bound. Examples are given of code improvement problems which can be solved using the algorithm.

References

  1. 1 AHO, A.V., AND ULLMAN, J.D The Theory of Parsing, Translation, and Comp~hng" Vol. II, Compiling. Prentice-Hall, Englewood Cliffs, N.J., 1973, Ch. 11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2 AHO, A.V., AND ULLMAN, J.D Node listings for reducible flow graphs. Proc Seventh Annual ACM Symposium on Theory of Computing, May 1975, pp. 177-185 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3 ALLEN, F.E. Control flow analysis. ACM SIGPLAN Notices (newsletter) 5, 7 (July 1970), 1-19. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4 ANGLUXN, D. Private communicatmn, July 1974Google ScholarGoogle Scholar
  5. 5 COCKE, J. Global common subexpression elimination. ACM SIGPLAN Notices (newsletter) 5, 7 (July 1970), 20-24 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6 COCKE, J., AND SCHWARTZ, J.T. Programm~n9 Languages and Thew Compilers, second rev version. Courant institute of Mathematmal Sciences, New York University, New York, 1970, CA. 6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7 FLOYD, R W. Asslgmng meanings to programs. Proc American Mathematical Society Symposia in Apphed Mathematics, Vol. 19, 1967, pp. 19-32.Google ScholarGoogle ScholarCross RefCross Ref
  8. 8 FONG, A., ~AM, J., AND ULLMAN, J D. Applications of lattace algebra to loop optimization Conf. Record of the Second ACM Symposium on Principles of Programming Languages, jan. 1975, pp. 1-9. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9 HA~RY, F., NORMAN, R.Z., AND CARTWRIGHT, D. Structural Models Wiley, New York, 1966, pp. 64-65.Google ScholarGoogle Scholar
  10. 10 HECHT, M.S, AND ULLMAN, J.D Flow graph reducibility. SIAM J. Comput. 1, 2 (June 1972), 188-202Google ScholarGoogle ScholarCross RefCross Ref
  11. 11 HECHT, M.S., AND ULLMAN, J.D. Analysis of a simple algorithm for global flow problems. Conf. Record of the ACM Symposium on Principles of Programming Languages, Oct. 1973, pp. 207-217. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12 HECHT, M.S, AND ULLMAN, J.D Characterizations of reducible flow graphs J. ACM 21, 3 (July 1974), 367-375. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13 HOARE, C.A.R. An axiomatic basis for computer programming. Comm. ACM 12, 10 (Oct. 1969), 576-580, 583. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14 KAM, J, AND ULLMAN, J D Global optimization problems and iterative algorithms. TR-146, Dep. of Elec. Eng., Princeton U., Princeton, N.J., Jan. 1974.Google ScholarGoogle Scholar
  15. 15 KENNEDY, K. A global flow analysis algorithm lnt. J. of Computer Math. 8 (Dec. 1971),5-15Google ScholarGoogle Scholar
  16. 16 KENNEDY, K A comparison of algorithms for global flow analysis. Rice Tech. Rep. 476-093-1, Rice U., Houston, Texas, Feb. 1974.Google ScholarGoogle Scholar
  17. 17 KENNEDY, K W. Node listings applied to data flow analysis. Conf. Record of the Second ACM Symposium on Principles of Programming Languages, Jan. 1975, pp. 10-21. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18 KILDALL, G.A. A umfied approach to global program optamization. Conf. Record of the ACM Symposmm on Principles of Programming Languages, Oct. 1973, pp. 194-206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 19 PATERSON, M Unpublished memorandum U of Warwick, Coventry, England, Aprd 1972. See also {25}.Google ScholarGoogle Scholar
  20. 20 PETERSON, W W., KASAMI, T., AND TOKURA, N. On the capabflitms of while, repeat, and exit statements. Comm. ACM 16, 8 (Aug. 1973), 503-512. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 21 SCHAEFER, M. A Mathematical Theory of Global Program Optimization. Prentme-Hall, Englewood Cliffs, N.J, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 22 TARJAN, R.E. Depth-first search and hnear graph algorithms. ~IAM J. Comput 1, 2 (Sept 1972), 146-160.Google ScholarGoogle ScholarCross RefCross Ref
  23. 23 TAttJAN, R.E. Testing flow graph reducibility. Proc. 5th Annual ACM Symposium on Theory of Computing, May 1973, pp. 96-107. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 24 TARJAN, R.E. Finding dominators in directed graphs. SIAM J. Comput. 8, 1 (March 1974), 62-89.Google ScholarGoogle Scholar
  25. 25 TAnZAN, R.E. Efficiency of a good but not linear set union algorithm. J. ACM 22, 2 (April 1975), 215-225 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 26 ULLMAN, j.D. Fast algorithms for the elimination of common subexpressions. Acta Informa~ca 2, 3 (Dec. 1973), 191-213.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. 27 WmG~A~, M. Ph.D. Dissertation, in preparation.Google ScholarGoogle Scholar
  28. 28 WIRTH, N. The programming language PASCAL. Acta Informatwa 1, 1 (1971), 35-63.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 29 WULV, W A. A case against the GOTO. ACM SIGPLAN Notices (newsletter) 7, 11 (Nov. 1972), 63--69. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A Fast and Usually Linear Algorithm for Global Flow Analysis

        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

        Full Access

        • Published in

          cover image Journal of the ACM
          Journal of the ACM  Volume 23, Issue 1
          Jan. 1976
          220 pages
          ISSN:0004-5411
          EISSN:1557-735X
          DOI:10.1145/321921
          Issue’s Table of Contents

          Copyright © 1976 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 January 1976
          Published in jacm Volume 23, Issue 1

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader