Abstract
We present a new technique for optimizing programs, based on data-flow analysis. The initial goal was to provide a simple way to improve on Leroy and Peyton-Jones' techniques for optimizing boxings (allocations) and unboxings (field selection) away in strongly-typed functional programs. Our techniques achieve this goal, while not needing types any more (so it applies to Lisp as well as to ML), and providing a finer analysis; moreover, our techniques also improve on classical common subexpression elimination. The methods are twofold: intraprocedurally, we use a data-flow analysis technique that propagates congruences on program variables and terms built on these variables; interprocedurally, we help the intraprocedural analysis by inlining, at least partially, all functions whose definitions are known at call sites.
Preview
Unable to display preview. Download preview PDF.
References
A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986.
B. Alpern, M. N. Wegman, and F. K. Zadeck. Detecting equality of variables in programs. In 15th PoPL, pages 1–11, 1988.
A. Appel. Compiling with Continuations. Cambridge University Press, 1992.
J. Cocke, and J. Schwartz. Programming languages and their compilers: preliminary notes. Technical report, Courant Institute of Mathematical Sciences, New York, 1970. second, revised version.
P. Cousot, and R. Cousot. A constructive version of Tarski's fixpoint theorems. Pacific J. Math., 82(1):43–57, 1979.
R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. An efficient method for computing static single assignment form. In 16th PoPL, pages 25–35, 1989.
K. De Bosschere, S. Debray, D. Gudeman, and S. Kannan. Call forwarding: A simple interprocedural optimization technique for dynamically typed languages. In 21st PoPL, pages 409–420, 1994.
A. Deutsch. A storeless model of aliasing and its abstractions using finite representations of right-regular equivalence relations. In ICCL'92, 1992.
P. K. Downey, R. Sethi, and R. E. Tarjan. Variations on the common subexpression problem. Journal of the ACM, 27(4):758–771, 1980.
J. H. Gallier. Logic for Computer Science — Foundations of Automatic Theorem Proving. John Wiley and Sons, 1987.
J. Goubault. Une implémentation efficace de structures de données ensemblistes, fondée sur le hash-consing. In JFLA '93, 1993.
J. Goubault. HimML: Standard ML with fast sets and maps. In ACM Workshop on ML, 1994.
F. Henglein and J. Jørgensen. Formally optimal boxing. In 21st PoPL, pages 213–226, 1994.
R. Johnson and K. Pingali. Dependence-based program analysis. In PLDI'93, pages 78–89, 1993.
K. W. Kennedy. Node listings applied to data flow analysis. In 3rd PoPL, pages 10–21, 1976.
P. J. Landin. The mechanical evaluation of expressions. Computer Journal, 6(4):308–320, 1964.
X. Leroy. Unboxed objects and polymorphic typing. In 19th PoPL, pages 177–188, 1992.
G. Nelson, and D. C. Oppen. Fast decision procedures based on congruence closure. Journal of the ACM, 27(2):356–364, April 1980.
J. Peterson. Untagged data in tagged environments: Choosing optimal representations at compile time. In FPCA '89, pages 89–99, 1989.
S. L. Peyton-Jones. Unboxed values as first-class citizens. In FPLCA'91. LNCS 523, Springer-Verlag, 1991.
B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Global value numbers and redundant computations. In 15th PoPL, pages 12–27, 1988.
G. L. Steele. Rabbit: A compiler for Scheme. Technical Report MIT AI TR 474, MIT, May 1978.
J.-P. Talpin and P. Jouvelot. The type and effect discipline. In LICS'92, 1992.
L. Trabb Pardo. Set representation and set intersection. Technical report, Stanford University, 1978. PhD thesis.
J. Vitter and P. Flajolet. Average-case analysis of algorithms and data structures. In J. v. Leeuwen, editor, Handbook of Theoretical Computer Science, chapter 9. Elsevier Science Publishers b.v., 1990.
P. Wadler. Deforestation: Transforming programs to eliminate trees. TCS, 73:231–248, 1990.
D. Weise, R. F. Crew, M. Ernst, and B. Steensgard. Value dependence graphs: Representation without taxation. In 21th PoPL, pages 297–310, 1994.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Goubault, J. (1994). Generalized boxings, congruences and partial inlining. In: Le Charlier, B. (eds) Static Analysis. SAS 1994. Lecture Notes in Computer Science, vol 864. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58485-4_38
Download citation
DOI: https://doi.org/10.1007/3-540-58485-4_38
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-58485-8
Online ISBN: 978-3-540-49005-0
eBook Packages: Springer Book Archive