Abstract
We describe how to implement strength reduction, loop-invariant code motion and loop quasi-invariant code motion by specializing instrumented interpreters. To curb code duplication intrinsic to such specialization, we introduce a new program transformation, rewinding, which uses Moore-automata minimization to remove duplicated code.
Similar content being viewed by others
References
Benton, N.: Simple relational correctness proofs for static analyses and program transformations. In: POPL ’04: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 14–25. ACM Press, New York (2004). DOI http://doi.acm.org/10.1145/964001.964003
Debois, S.: Imperative program optimization by partial evaluation. In: PEPM ’04: Proceedings of the 2004 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 113–122. ACM Press, New York (2004). DOI http://doi.acm.org/10.1145/1014007.1014019
Denning, P.J., Dennis, J.B., Qualitz, J.E.: Machines, Languages, and Computation. Prentice-Hall, Englewood Cliffs (1978)
Glück, R., Jørgensen, J.: Generating optimizing specializers. In: Proceedings of the 1994 IEEE International Conference on Computer Languages, pp. 183–194. IEEE Computer Society Press, New York (1994)
Glück, R., Jørgensen, J.: Generating transformers for deforestation and supercompilation. In: SAS ’94: Proceedings of the 1st International Static Analysis Symposium. Lecture Notes in Computer Science, vol. 864, pp. 432–448. Springer, New York (1994)
Gomard, C.K., Jones, N.D.: Compiler generation by partial evaluation: a case study. Struct. Program. 12, 123–144 (1991)
Hopcroft, J.E., Ullman, J.D.: Introduction to Automata Theory, Languages and Computation. Addison-Wesley, Reading (1979)
Jones, N.D.: Transformation by interpreter specialisation. Sci. Comput. Program. 52, 307–339 (2004)
Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)
Lacey, D., Jones, N.D., Wyk, E.V., Frederiksen, C.C.: Proving correctness of compiler optimizations by temporal logic. In: POPL ’02: Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 283–294. ACM Press, New York (2002). DOI http://doi.acm.org/10.1145/503272.503299
Lerner, S., Millstein, T., Chambers, C.: Automatically proving the correctness of compiler optimizations. In: PLDI ’03: Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation, pp. 220–231. ACM Press, New York (2003). DOI http://doi.acm.org/10.1145/781131.781156
Muchnick, S.S.: Advanced Compiler Design & Implementation. Morgan Kaufmann, San Mateo (1997)
Song, L., Futamura, Y., Glück, R., Hu, Z.: Loop quasi-invariance code motion. IEICE Trans. Inf. Syst. E83-D(10), 1841–1850 (2000)
Sperber, M., Thiemann, P.: Realistic compilation by partial evaluation. In: PLDI ’96: Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation, pp. 206–214. ACM Press, New York (1996)
Thibault, S., Consel, C., Lawall, J.L., Marlet, R., Muller, G.: Static and dynamic program compilation by interpreter specialization. Higher-Order Symb. Comput. 13(3), 161–178 (2000)
Author information
Authors and Affiliations
Corresponding author
Additional information
This paper is a revised and extended version of the conference paper [2].
Rights and permissions
About this article
Cite this article
Debois, S. Imperative-program transformation by instrumented-interpreter specialization. Higher-Order Symb Comput 21, 37–58 (2008). https://doi.org/10.1007/s10990-008-9027-3
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10990-008-9027-3