Generalized boxings, congruences and partial inlining

  • Jean Goubault
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 864)


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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986.Google Scholar
  2. 2.
    B. Alpern, M. N. Wegman, and F. K. Zadeck. Detecting equality of variables in programs. In 15th PoPL, pages 1–11, 1988.Google Scholar
  3. 3.
    A. Appel. Compiling with Continuations. Cambridge University Press, 1992.Google Scholar
  4. 4.
    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.Google Scholar
  5. 5.
    P. Cousot, and R. Cousot. A constructive version of Tarski's fixpoint theorems. Pacific J. Math., 82(1):43–57, 1979.Google Scholar
  6. 6.
    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.Google Scholar
  7. 7.
    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.Google Scholar
  8. 8.
    A. Deutsch. A storeless model of aliasing and its abstractions using finite representations of right-regular equivalence relations. In ICCL'92, 1992.Google Scholar
  9. 9.
    P. K. Downey, R. Sethi, and R. E. Tarjan. Variations on the common subexpression problem. Journal of the ACM, 27(4):758–771, 1980.CrossRefGoogle Scholar
  10. 10.
    J. H. Gallier. Logic for Computer Science — Foundations of Automatic Theorem Proving. John Wiley and Sons, 1987.Google Scholar
  11. 11.
    J. Goubault. Une implémentation efficace de structures de données ensemblistes, fondée sur le hash-consing. In JFLA '93, 1993.Google Scholar
  12. 12.
    J. Goubault. HimML: Standard ML with fast sets and maps. In ACM Workshop on ML, 1994.Google Scholar
  13. 13.
    F. Henglein and J. Jørgensen. Formally optimal boxing. In 21st PoPL, pages 213–226, 1994.Google Scholar
  14. 14.
    R. Johnson and K. Pingali. Dependence-based program analysis. In PLDI'93, pages 78–89, 1993.Google Scholar
  15. 15.
    K. W. Kennedy. Node listings applied to data flow analysis. In 3rd PoPL, pages 10–21, 1976.Google Scholar
  16. 16.
    P. J. Landin. The mechanical evaluation of expressions. Computer Journal, 6(4):308–320, 1964.Google Scholar
  17. 17.
    X. Leroy. Unboxed objects and polymorphic typing. In 19th PoPL, pages 177–188, 1992.Google Scholar
  18. 18.
    G. Nelson, and D. C. Oppen. Fast decision procedures based on congruence closure. Journal of the ACM, 27(2):356–364, April 1980.CrossRefGoogle Scholar
  19. 19.
    J. Peterson. Untagged data in tagged environments: Choosing optimal representations at compile time. In FPCA '89, pages 89–99, 1989.Google Scholar
  20. 20.
    S. L. Peyton-Jones. Unboxed values as first-class citizens. In FPLCA'91. LNCS 523, Springer-Verlag, 1991.Google Scholar
  21. 21.
    B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Global value numbers and redundant computations. In 15th PoPL, pages 12–27, 1988.Google Scholar
  22. 22.
    G. L. Steele. Rabbit: A compiler for Scheme. Technical Report MIT AI TR 474, MIT, May 1978.Google Scholar
  23. 23.
    J.-P. Talpin and P. Jouvelot. The type and effect discipline. In LICS'92, 1992.Google Scholar
  24. 24.
    L. Trabb Pardo. Set representation and set intersection. Technical report, Stanford University, 1978. PhD thesis.Google Scholar
  25. 25.
    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.Google Scholar
  26. 26.
    P. Wadler. Deforestation: Transforming programs to eliminate trees. TCS, 73:231–248, 1990.CrossRefGoogle Scholar
  27. 27.
    D. Weise, R. F. Crew, M. Ernst, and B. Steensgard. Value dependence graphs: Representation without taxation. In 21th PoPL, pages 297–310, 1994.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Jean Goubault
    • 1
  1. 1.Bull Corporate Research CenterFrance

Personalised recommendations