Advertisement

Code motion and code placement: Just synonyms?

  • Jens Knoop
  • Oliver Rüthing
  • Bernhard Steffen
Regular Papers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1381)

Abstract

We prove that there is no difference between code motion (CM) and code placement (CP) in the traditional syntactic setting, however, a dramatic difference in the semantic setting. We demonstrate this by re-investigating semantic CM under the perspective of the recent development of syntactic CM. Besides clarifying and highlighting the analogies and essential differences between the syntactic and the semantic approach, this leads as a side-effect to a drastical reduction of the conceptual complexity of the value-flow based procedure for semantic CM of [20], as the original bidirectional analysis is decomposed into purely unidirectional components. On the theoretical side, this establishes a natural semantical understanding in terms of the Herbrand interpretation (transparent equivalence), and thus eases the proof of correctness; moreover, it shows the frontier of semantic CM, and gives reason for the lack of algorithms going beyond. On the practical side, it simplifies the implementation and increases the efficiency, which, like for its syntactic counterpart, can be the catalyst for its migration from academia into industrial practice.

Keywords

Program optimization data-flow analysis code motion code placement partial redundancy elimination transparent equivalence Her-brand interpretation 

References

  1. 1.
    B. Alpern, M. N. Wegman, and F. K. Zadeck. Detecting equality of variables in programs. In Conf. Rec. 15th Symp. Principles of Prog. Lang. (POPL'88), pages 1–11. ACM, NY, 1988.Google Scholar
  2. 2.
    F. Chow. A Portable Machine Independent Optimizer-Design and Measurements. PhD thesis, Stanford Univ., Dept. of Electrical Eng., Stanford, CA, 1983. Publ. as Tech. Rep. 83-254, Comp. Syst. Lab., Stanford Univ.Google Scholar
  3. 3.
    C. Click. Global code motion/global value numbering. In Proc. ACM SIGPLAN Conf. Prog. Lang. Design and Impl. (PLDI'95), volume 30,6 of ACM SIGPLAN Not, pages 246–257, 1995.Google Scholar
  4. 4.
    J. Cocke and J. T. Schwartz. Programming languages and their compilers. Courant Inst. Math. Sciences, NY, 1970.Google Scholar
  5. 5.
    D. M. Dhamdhere. A fast algorithm for code movement optimization. ACM SIGPLAN Not, 23(10):172–180, 1988.CrossRefGoogle Scholar
  6. 6.
    D. M. Dhamdhere. Practical adaptation of the global optimization algorithm of Morel and Renvoise. ACM Trans. Prog. Lang. Syst., 13(2):291–294, 1991. Tech. Corr.CrossRefGoogle Scholar
  7. 7.
    D. M. Dhamdhere, B. K. Rosen, and F. K. Zadeck. How to analyze large programs efficiently and informatively. In Proc. ACM SIGPLAN Conf. Prog. Lang. Design and Impl. (PLDI'92), volume 27,7 of A CM SIGPLAN Not, pages 212–223, 1992.Google Scholar
  8. 8.
    K.-H. Drechsler and M. P. Stadel. A solution to a problem with Morel and Renvoise's“Global optimization by suppression of partial redundancies”. ACM Trans. Prog. Lang. Syst., 10(4):635–640, 1988. Tech. Corr.CrossRefGoogle Scholar
  9. 9.
    A. Fong, J. B. Kam, and J. D. Ullman. Application of lattice algebra to loop optimization. In Conf. Rec. 2nd Symp. Principles of Prog. Lang. (POPL'75), pages 1–9. ACM, NY, 1975.Google Scholar
  10. 10.
    G. A. Kildall. A unified approach to global program optimization. In Conf. Rec. 1st Symp. Principles of Prog. Lang. (POPL'73), pages 194–206. ACM, NY, 1973.Google Scholar
  11. 11.
    J. Knoop, D. Koschützki, and B. Steffen. Basic-block graphs: Living dinosaurs? In Proc. 7th Int. Conf. on Compiler Constr. (CC'98), LNCS, Springer-V., 1998.Google Scholar
  12. 12.
    J. Knoop, O. Rüthing, and B. Steffen. Lazy code motion. In Proc. ACM SIGPLAN Conf. Prog. Lang. Design and Impl. DI'92), volume 27,7 of ACM SIGPLAN Not, pages 224–234, 1992.Google Scholar
  13. 13.
    J. Knoop, O. Rüthing, and B. Steffen. Optimal code motion: Theory and practice. ACM Trans. Prog. Lang. Syst., 16(4):1117–1155, 1994.CrossRefGoogle Scholar
  14. 14.
    J. Knoop, O. Rüthing, and B. Steffen. Code Motion and Code Placement: Just Synonyms? Technical Report MIP-9716, Fakultät für Mathematik und Informatik, Universität Passau, Germany, 1997.Google Scholar
  15. 15.
    E. Morel and C. Renvoise. Global optimization by suppression of partial redundancies. Comm. ACM, 22(2):96–103, 1979.MathSciNetCrossRefGoogle Scholar
  16. 16.
    J. H. Reif and R. Lewis. Symbolic evaluation and the global value graph. In Conf. Rec. 4th Symp. Principles of Prog. Lang. (POPL'77), pages 104–118. ACM, NY, 1977.Google Scholar
  17. 17.
    B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Global value numbers and redundant computations. In Conf. Rec. 15th Symp. Principles of Prog. Lang. (POPL'88), pages 2–27. ACM, NY, 1988.Google Scholar
  18. 18.
    A. Sorkin. Some comments on a solution to a problem with Morel and Renvoise's“Global optimization by suppression of partial redundancies”. ACM Trans. Prog. Lang. Syst., 11(4):666–668, 1989. Tech. Corr.CrossRefGoogle Scholar
  19. 19.
    B. Steffen. Property-oriented expansion. In Proc. 3rd Stat Analysis Symp. (SAS'96), LNCS 1145, pages 22–41. Springer-V., 1996.Google Scholar
  20. 20.
    B. Steffen, J. Knoop, and O. Rüthing. The value flow graph: A program representation for optimal program transformations. In Proc. 3rd Europ. Symp. Programming (ESOP'90), LNCS 432, pages 389–405. Springer-V., 1990.Google Scholar
  21. 21.
    B. Steffen, J. Knoop, and O. Rüthing. Efficient code motion and an adaption to strength reduction. In Proc. 4th Int. Conf. Theory and Practice of Software Development (TAPSOFT'91), LNCS 494, pages 394–415. Springer-V., 1991.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1998

Authors and Affiliations

  • Jens Knoop
    • 1
  • Oliver Rüthing
    • 2
  • Bernhard Steffen
    • 2
  1. 1.Universität PassauPassauGermany
  2. 2.Universität DortmundDortmundGermany

Personalised recommendations