skip to main content
article
Free Access

Lazy code motion

Published:01 July 1992Publication History
Skip Abstract Section

Abstract

We present a bit-vector algorithm for the optimal and economical placement of computations within flow graphs, which is as efficient as standard uni-directional analyses. The point of our algorithm is the decomposition of the bi-directional structure of the known placement algorithms into a sequence of a backward and a forward analysis, which directly implies the efficiency result. Moreover, the new compositional structure opens the algorithm for modification: two further uni-directional analysis components exclude any unnecessary code motion. This laziness of our algorithm minimizes the register pressure, which has drastic effects on the run-time behaviour of the optimized programs in practice, where an economical use of registers is essential.

References

  1. AU Aho, A. V., and Ullman, J.D. Node listings for reducible flow graphs. In Proceedings ?~h STOC, 1975, 177- 185. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Ch Chow, F. A portable machine independent optimizer- Design and measurements. Ph.D. dissertation, Dept. of Electrical Engineering, Stanford University, Stanford, Calif., and Tech. Rep. 83-254, Computer Systems Lab., Stanford University, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Dh1 Dhamdhere, D.M. Characterization of program loops in code optimization. Comp. Lang. 8, 2 (1983), 69- 76.Google ScholarGoogle Scholar
  4. Dh2 Dhamdhere, D.M. A fast algorithm for code movement optimization. S~GPLAN Not. 23, 10 (xgss), 172- is0 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Dh3 Dhamdhere, D.M. Practical adaptation of the global optimization algorithm of Morel and Renvoise. A CM Trans. Program. Lang. Syst. ~3, 2 (~99~), 29~- 294. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. DS Drechsler, K. H., and Stadel, M.P. A solution to a problem with Morel and Renvoise's "Global optimization by suppression of partial redundancies". A CM Trans. Program. Lang. Syst. 10, 4 (1988), 635 - 640. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. GW Graham, S. L., and Wegman, M. A fast and usually linear algorithm for global flow analysis. Journal of the ACM 23, 1 (1976), 172- 202. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. He Itecht, M.S. Flow analysis of computer programs. Elsevier, North-Holland, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. HU1 Hecht, M. S., and Ullman, J.D. Analysis of a simple algorithm for global flow problems. In Proceedings 1st POPL, Boston, Massachusetts, 1973, 207- 217. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. HU2 Hecht, M. S., and Ullman, J.D. A simple algorithm for global data flow analysis problems. In SIAM J. Comput. d, 4 (1977), 519- 532.Google ScholarGoogle Scholar
  11. JD1 Joshi, S. M., and Dhamdhere, D.M. A composite hoisting-strength reduction transformation for global program optimization- part I. Internat. J. Computer Maih. 11, (1982), 21 - 41.Google ScholarGoogle ScholarCross RefCross Ref
  12. JD2 Joshi, S. M., and Dhamdhere, D.M. A composite hoisting-strength reduction transformation for global program optimization- part II. Internat. J. Computer Math. 11, (1982), 111- 126.Google ScholarGoogle ScholarCross RefCross Ref
  13. Ke Kennedy, K. Node listings applied to data flow analysis. In Proceedings ~d POPL, Palo Alto, California, 1975, 10- 21. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. KRS Knoop, J., Riithing, O., and Steffen, B. Lazy strength reduction. To appear.Google ScholarGoogle Scholar
  15. KS1 Knoop, J., and Steffen, B. The interprocedurM coincidence theorem. Aachener Informafik- Berichte Nr. 9127, Rheinisch-Westfiilische Technische Hochschule Aachen, Aachen, 1991.Google ScholarGoogle Scholar
  16. KS2 Knoop, J., and Steffen, B. Efficient and optimal interprocedural bit-vector data flow analyses: A uniform interprocedural framework. To appear.Google ScholarGoogle Scholar
  17. KU1 Kam, J. B., and Ullman, J.D. Global data flow analysis and iterative algorithms, journal o/the ACM 23, 1 (1976), 158- 171. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. KU2 Kam, J. B., and Ullman, j.D. Monotone data flow analysis frameworks. Acta Informatica 7, (1977), 309- 317.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Mo Morel, E. Data flow analysis and global optimization. In: Lorho, B. (Ed.). Methods and tools for compiler construction, Cambridge University Press, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. MR1 Morel, E., and Renvoise, C. Global{ optimization by suppression of partial redundancies. Commun. of the A CM 22, 2 (1979), 96- 103. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. MR2 Morel, E., and Renvoise, C. Interprocedural elimination of partial redundancies. In: Muchnick, St. S., and Jones, N. D. (Eds.). Program flow analysis: Theory and applications. Prentice Hall, Englewood Cliffs, NJ, 1981.Google ScholarGoogle Scholar
  22. RWZ Rosen, B. K., Wegman, M. N., and Zadeck,F. K. Global value numbers and redundant computations. In Proceedings 15th POPL, San Diego, California, 1988, 12- 27. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. So Sorkin, A. Some comments on A solution to a problem with Morel and Renvoise's "Global optimization by suppression of partial redundancies''. A CM Trans. Program. Lang. $yst. 11,4 (1989), 666- 668. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. St Steffen, B. Data flow analysis as model checking. In Proceedings TACS'91, Sendai, Japan, Springer-Verlag, LNCS 526 (1991), 346 .-364. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. SKR1 Steffen, B., Knoop, J., and Riithing, O. The value flow graph: A program representation for optimal program transformations. In Proceedings 3~d E$OP, Copenhagen, Denmark, Springer-Verlag, LNCS 432 (1990), 389 .-405. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. SKR2 Steffen, B., Knoop, J., and Riithing, O. Efficient code motion and an adaption to strength reduction. In Proceedings ~ta TAP- SOFT, Brighton, United Kingdom, Springer- Verlag, LNCS 494 (1991), 394- 415. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Ta1 Tarjan, R.E. Applications of path compression on balanced trees. Journal of lhe A CM 26, 4 (1979), 690- 715. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Ta2 Tarjan, R.E. A unified approach to path problems. Journal of the A CM 28, 3 (1981), 577- 593. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Ta3 Tarjan, R.E. Fast algorithms for solving path problems. Journal of the A CM 28, 3 (:1981), 594- 614. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Ull Ullman, J.D. Fast algorithms for the elimination of common subexpressions. Acia Informaiica 2, 3 (1973), 191- 213.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Lazy code motion

            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 ACM SIGPLAN Notices
              ACM SIGPLAN Notices  Volume 27, Issue 7
              July 1992
              352 pages
              ISSN:0362-1340
              EISSN:1558-1160
              DOI:10.1145/143103
              Issue’s Table of Contents
              • cover image ACM Conferences
                PLDI '92: Proceedings of the ACM SIGPLAN 1992 conference on Programming language design and implementation
                July 1992
                352 pages
                ISBN:0897914759
                DOI:10.1145/143095

              Copyright © 1992 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 July 1992

              Check for updates

              Qualifiers

              • article

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader