Advertisement

Effective flow analysis for avoiding run-time checks

  • Suresh Jagannathan
  • Andrew Wright
Contributed Papers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 983)

Abstract

This paper describes a general purpose program analysis that computes global control-flow and data-flow information for higher-order, call-by-value programs. This information can be used to drive global program optimizations such as inlining and run-time check elimination, as well as optimizations like constant folding and loop invariant code motion that are typically based on special-purpose local analyses.

The analysis employs a novel approximation technique called polymorphic splitting that uses let-expressions as syntactic clues to gain precision. Polymorphic splitting borrows ideas from Hindley-Milner polymorphic type inference systems to create an analog to polymorphism for flow analysis.

Experimental results derived from an implementation of the analysis for Scheme indicate that the analysis is extremely precise and has reasonable cost. In particular, it eliminates significantly more run-time checks than simple flow analyses (i.e. 0CFA) or analyses based on type inference.

Keywords

Flow Analysis Type Inference Program Point Type Check Primitive Operation 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Alexander Aiken and Wimmers, Edward and T.K Lakshman. Soft Typing with Conditional Types. In 21th ACM Symposium on Principles of Programming Languages, pages 163–173, 1994.Google Scholar
  2. 2.
    Henk Barendregt. The Lambda Calculus. North-Holland, Amsterdam, 1981.Google Scholar
  3. 3.
    William Clinger and Jonathan Rees, editors. Revised4 Report on the Algorithmic Language Scheme. ACM Lisp Pointers, 4(3), July 1991.Google Scholar
  4. 4.
    Kent Dybvig. The Scheme Programming Language. Prentice-Hall, Inc., 1987.Google Scholar
  5. 5.
    Marc Feeley, Marc Turcotte, and Guy Lapalme. Using MultiLisp for Solving Constraint Satistfaction Problems: An Application to Nucleic Acid 3D Structure Determination. Lisp and Symbolic Computation, 7(2/3):231–248, 1994.Google Scholar
  6. 6.
    Leslie Greengard. The Rapid Evaluation of Potential Fields in Particle Systems. ACM Press, 1987.Google Scholar
  7. 7.
    Nevin Heintze. Set-Based Analysis of ML Programs. In Proceedings of the ACM Symposium on Lisp and Functional Programming, pages 306–317, 1994.Google Scholar
  8. 8.
    Fritz Henglein. Global Tagging Optimization by Type Inference. In Proceedings of the ACM Symposium on Lisp and Functional Programming, pages 205–215, 1992.Google Scholar
  9. 9.
    R. Hindley. The Principal Type-Scheme of an Object in Combinatory Logic. Transactions of the American Mathematical Society, 146:29–60, December 1969.Google Scholar
  10. 10.
    Suresh Jagannathan and Stephen Weeks. A Unified Treatment of Flow Analysis in Higher-Order Languages. In 22th ACM Symposium on Principles of Programming Languages, pages 392–401, January 1995.Google Scholar
  11. 11.
    Neil Jones and Stephen Muchnick. Flow Analysis and Optimization of Lisp-like Structures. In 6th ACM Symposium on Principles of Programming Languages, pages 244–256, January 1979.Google Scholar
  12. 12.
    Robin Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences, 17:348–375, 1978.Google Scholar
  13. 13.
    Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, 1990.Google Scholar
  14. 14.
    John Mitchell. Handbook of Theoretical Computer Science: Volume B, chapter Type Systems for Programming Languages, pages 367–453. MIT Press, 1990.Google Scholar
  15. 15.
    Jens Palsberg. Global Program Analysis in Constraint Form. In Proceedings of the 1994 Colloquium on Trees in Algebra and Programming, pages 276–290. Springer-Verlag, 1994. Appears as LNCS 787.Google Scholar
  16. 16.
    Jens Palsberg and Patrick O'Keefe. A Type System Equivalent to Flow Analysis. In 22th ACM Symposium on Principles of Programming Languages, pages 367–378, January 1995.Google Scholar
  17. 17.
    Jens Palsberg and Michael Schwartzbach. Safety Analysis versus Type Inference. Information and Computation, to appear.Google Scholar
  18. 18.
    Gordon D. Plotkin. Call-by-name, call-by-value and the lambda-calculus. Theoretical Computer Science, 1:125–159, 1975.Google Scholar
  19. 19.
    Olin Shivers. Data-flow Analysis and Type Recovery in Scheme. In Topics in Advanced Language Implementation. MIT Press, 1990.Google Scholar
  20. 20.
    Olin Shivers. Control-Flow Analysis of Higher-Order Languages or Taming Lambda. PhD thesis, School of Computer Science, Carnegie-Mellon University, 1991.Google Scholar
  21. 21.
    Peter Steenkiste and John Hennessy. Tags and type checking in lisp. In Proceedings of the Second Architectural Support for Programming Languages and Systems Symposium, pages 50–59, 1987.Google Scholar
  22. 22.
    Andrew Wright and Robert Cartwright. A Practical Soft Type System for Scheme. In Proceedings of the ACM Symposium on Lisp and Functional Programming, pages 250–262, 1994.Google Scholar
  23. 23.
    Feng Zhao. An O(N) Algorithm for Three-Dimensional N-Body Simulations. Master's thesis, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, 1987.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1995

Authors and Affiliations

  • Suresh Jagannathan
    • 1
  • Andrew Wright
    • 1
  1. 1.NEC Research InstitutePrinceton

Personalised recommendations