Abstract
We present a transformation of intermediate code (EM code) for the equational programming language, that makes it possible for a partial evaluator to detect cases where boxing and unboxing of integer values can be eliminated. In many cases all box/unbox overhead is removed, with concomitant improvements to running time and memory use. The technique entails a modest modification to the call/return protocol used by the intermediate language; the modified call instruction can then be implemented in a regular architecture (such as the SPARC) at no additional cost compared to an ordinary call instruction. Our technique could also be used in functional languages to correctly handle arbitrary precision integer operations while still optimizing the common case where the operations are performed on machine integers.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Unité de Recherche Associée au Centre National de la Recherche Scientifique n.1304, Université Bordeaux 1, 351 cours de la Libération, 33405 Talence Cedex, France
Preview
Unable to display preview. Download preview PDF.
References
Cytron, Ferrante, Rosen, Wegman, and Zadeck. An efficient method of computing static single assignment forms. In Sixteenth Annual Symposium on Principles of Programming Languages, 1989.
Jacques Cohen. Garbage collection of linked data structures. ACM Computing Surveys, 13(3):342–367, September 1981.
Irène Durand and Robert Strandh. A decision procedure for forward-branching equational programs. Technical Report 05-90, GRECO Programmation, 1990.
I. Durand, D. Sherman, and R. Strandh. Fine-grain partial evaluation of intermediate code from equational programs. In M. Billaud et al., editors, Analyse Statique en Programmation Équationnelle, Fonctionnelle, et Logique, Bordeaux, France, Octobre 1991 (Bigre, vol. 74), pages 98–106. Rennes: IRISA, 1991.
Irène Durand. Bounded, strongly sequential and forward-branching term rewriting systems. Technical Report 92-23, LABRI, 1992. To appear in Journal of Symbolic Computation.
C.K. Gomard and N.D. Jones. A partial evaluator for the untyped lambda-calculus. Journal of Functional Programming, 1(1):21–69, January 1991.
Fritz Henglein and Jesper Jørgensen. formally optimal boxing. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Langages, pages 213–226, January 1994.
Christoph Hoffmann and Michael J. O'Donnell. Programming with equations. ACM Transactions on Programming Languages and Systems, pages 83–112, 1982.
C. Hoffmann, M. J. O'Donnell, and R. Strandh. Programming with equations. Software, Practice and Experience, 1985.
Simon L Peyton Jone and John Lauchbury. Unboxed values as first class citizens in a non-strict functional langage. In Functionnal Programming Langages and Computer Architecture, volume 523 of Lecture Notes in Computer Science, pages 636–66. Springer, August 1991.
N.D. Jones. Automatic program specialization: A re-examination from basic principles. In D. Bjørner, A.P. Ershov, and N.D. Jones, editors, Partial Evaluation and Mixed Computation, pages 225–282. Amsterdam: North-Holland, 1988.
J. Launchbury. Projections for specialisation. In D. Bjørner, A.P. Ershov, and N.D. Jones, editors, Partial Evaluation and Mixed Computation, pages 299–315. Amsterdam: North-Holland, 1988.
J. Launchbury. Projection Factorisations in Partial Evaluation. Cambridge: Cambridge University Press, 1991.
Xavier Leroy. Unboxed objects and polymorphic typing. In Proceedings of the ACM SIGPLAN Symposium on Principles of programming Langages (POPL), pages 177–188, Jan. 1992.
Timo Metzemakers. Ameliorations de bas niveau pour le compilateur eqc, 1994. Mémoire de DEA d'informatique, Université de BORDEAUX I.
Michael J. O'Donnell. Equational Logic as a Programming Language. MIT Press, 1985.
Martin Rudalics. Distributed copying garbage collection. In Proceedings of the 1986 ACM Symposium on Lisp and Functional Programming, pages 364–372, 1986.
David J. Sherman. EM code semantics, analysis, and optimization. Technical Report Rapport 94-1, Greco de Programmation du CNRS, 1994.
David J. Sherman. Run-Time and Compile-Time Improvements to Equational Programs. PhD thesis, University of Chicago, Chicago, Illinois, 1994.
SPARC International, Inc., Menlo Park, California. The SPARC architecture Manual, 1992. chapt. 7, appendix B.14 and D.4.
David J. Sherman and Robert I. Strandh. An abstract machine for efficient implementation of term rewriting. Technical Report 90-12, University of Chicago Department of Computer Science, 1990.
D. Sherman and R. Strandh. Call unfolding strategies for equational logic programs. In Partial Evaluation and Semantics-Based Program Manipulation, San Francisco, California, June 1992 (Technical Report YALEU/DCS/RR-909), pages 48–53. New Haven, CT: Yale University, 1992.
David J. Sherman and Robert I. Strandh. Call unfolding strategies for equational logic programs. In Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, 1992.
D. Sherman, R. Strandh, and I. Durand. Optimization of equational programs using partial evaluation. In Partial Evaluation and Semantics-Based Program Manipulation, New Haven, Connecticut (Sigplan Notices, vol. 26, no. 9, September 1991), pages 72–82. New York: ACM, 1991.
Robert I. Strandh. Classes of equational programs that compile into efficient machine code. In Proceedings of the Third International Conference on Rewrite Techniques and Applications, 1989.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Metzemakers, T., Miniussi, A., Sherman, D., Strandh, R. (1994). Improving arithmetic performance using fine-grain unfolding. In: Hermenegildo, M., Penjam, J. (eds) Programming Language Implementation and Logic Programming. PLILP 1994. Lecture Notes in Computer Science, vol 844. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58402-1_23
Download citation
DOI: https://doi.org/10.1007/3-540-58402-1_23
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-58402-5
Online ISBN: 978-3-540-48695-4
eBook Packages: Springer Book Archive