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.
An extended version is available as [14].
The work of the author was funded in part by the Leibniz Programme of the German Research Council (DFG) under grant 01 98/1-1.
Chapter PDF
References
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.
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.
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.
J. Cocke and J. T. Schwartz. Programming languages and their compilers. Courant Inst. Math. Sciences, NY, 1970.
D. M. Dhamdhere. A fast algorithm for code movement optimization. ACM SIGPLAN Not, 23(10):172–180, 1988.
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.
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.
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.
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.
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.
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.
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.
J. Knoop, O. Rüthing, and B. Steffen. Optimal code motion: Theory and practice. ACM Trans. Prog. Lang. Syst., 16(4):1117–1155, 1994.
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.
E. Morel and C. Renvoise. Global optimization by suppression of partial redundancies. Comm. ACM, 22(2):96–103, 1979.
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.
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.
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.
B. Steffen. Property-oriented expansion. In Proc. 3rd Stat Analysis Symp. (SAS'96), LNCS 1145, pages 22–41. Springer-V., 1996.
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.
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.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Knoop, J., Rüthing, O., Steffen, B. (1998). Code motion and code placement: Just synonyms?. In: Hankin, C. (eds) Programming Languages and Systems. ESOP 1998. Lecture Notes in Computer Science, vol 1381. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0053569
Download citation
DOI: https://doi.org/10.1007/BFb0053569
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-64302-9
Online ISBN: 978-3-540-69722-0
eBook Packages: Springer Book Archive