Advertisement

Effective specialization of realistic programs via use sensitivity

  • Luke Hornof
  • Charles Consel
  • Jacques Noyé
Procedural Programming II
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1302)

Abstract

In order to exploit specialization opportunities that exist in programs written by researchers outside of the programming language community, a partial evaluator needs to effectively treat existing realistic applications. Our empirical studies have demonstrated that real-sized applications extensively use non-liftable values such as pointers and data structures. Therefore, it is essential that the binding-time analysis accurately treats nonliftable values. To achieve this accuracy, we introduce the notion of use sensitivity, and present a use-sensitive binding-time analysis for C programs which is obtained by a forward analysis followed by a backward analysis. This analysis has been implemented and integrated into our partial evaluator for C, called Tempo. To validate the effectiveness of our analysis and demonstrate that use sensitivity is critical to obtain highly-specialized programs, we have conducted experimental studies on various components of existing operating systems code. Our results clearly demonstrate that, as opposed to use insensitivity, use sensitivity drastically increases the static computations detected by the analysis which, in practice, leads to successful specialization.

Keywords

Partial Evaluation Dynamic Context Program Point Subsequent Specialization Binding Time 
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.
    S.M. Abramov and N.V. Kondratjev. A compiler based on partial evaluation. In Problems of Applied Mathematics and Software Systems, pages 66–69. Moscow State University, Moscow, USSR, 1982. (In Russian).Google Scholar
  2. 2.
    A.V. Aho, R. Sethi, and J.D. Ullman. Compilers Principles, Techniques, and Tools. Addison-Wesley, 1986.Google Scholar
  3. 3.
    L.O. Andersen. Self-applicable C program specialization. In Partial Evaluation and Semantics-Based Program Manipulation, pages 54–61, San Francisco, CA, USA, June 1992. Yale University, New Haven, CT, USA. Technical Report YALEU/DCS/RR-909.Google Scholar
  4. 4.
    L.O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, Computer Science Department, University of Copenhagen, May 1994. DIKU Technical Report 94/19.Google Scholar
  5. 5.
    P.H. Andersen. Partial evaluation applied to ray tracing. DIKU Research Report 95/2, DIKU, University of Copenhagen, Denmark, 1995.Google Scholar
  6. 6.
    R. Baier, R. Chick, and R. Zöchling. Partial evaluation of numerical programs in Fortran. In Partial Evaluation and Semantics-Based Program Manipulation, Orlando, Florida, June 1994 (Technical Report 94/9, Department of Computer Science, University of Melbourne), pages 119–132, 1994.Google Scholar
  7. 7.
    A.A. Berlin. Partial evaluation applied to numerical computation. In 1990 ACM Conference on Lisp and Functional Programming, Nice, France, pages 139–150. New York: ACM, 1990.Google Scholar
  8. 8.
    C. Consel. Polyvariant binding-time analysis for applicative languages. In PEPM93 [37], pages 145–154.Google Scholar
  9. 9.
    C. Consel. A tour of Schism. In PEPM93 [37], pages 66–77.Google Scholar
  10. 10.
    C. Consel and O. Danvy. Tutorial notes on partial evaluation. In Conference Record of the Twentieth Annual ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, pages 493–501, Charleston, SC, USA, January 1993. ACM Press.Google Scholar
  11. 11.
    C. Consel, L. Hornof, F. Noël, J. Noyé, and E.N. Volanschi. A uniform approach for compile-time and run-time specialization. In Danvy et al. [17], pages 54–72.Google Scholar
  12. 12.
    C. Consel and S.C. Khoo. Semantics-directed generation of a Prolog compiler. In J. Maluszyński and M. Wirsing, editors, Proceedings of the 3 rd International Symposium on Programming Language Implementation and Logic Programming, number 528 in Lecture Notes in Computer Science, pages 135–146, Passau, Germany, August 1991. Springer-Verlag.Google Scholar
  13. 13.
    C. Consel and F. Noel. A general approach for run-time specialization and its application to C. In POPL96, St. Petersburg Beach, FL, USA, January 1996. ACM Press, pages 145–156.Google Scholar
  14. 14.
    C. Consel, C. Pu, and J. Walpole. Incremental specialization: The key to high performance, modularity and portability in operating systems. In PEPM93, Copenhagen, Denmark, June 1993. ACM Press pages 44–46. Invited paper.Google Scholar
  15. 15.
    C. Consel, C. Pu, and J. Walpole. Making production OS kernel adaptive: Incremental specialization in practice. Technical report, Department of Computer Science and Engineering, Oregon Graduate Institute of Science & Technology, 1994.Google Scholar
  16. 16.
    O. Danvy. Type-directed partial evaluation. In POPL96, St. Petersburg Beach, FL, USA, January 1996. ACM Press, pages 242–257.Google Scholar
  17. 17.
    O. Danvy, R. Glück, and P. Thiemann, editors. Partial Evaluation, International Seminar, Dagstuhl Castle, number 1110 in Lecture Notes in Computer Science, February 1996.Google Scholar
  18. 18.
    O. Danvy, K. Malmkjaer, and J. Palsberg. The essence of eta-expansion in partial evaluation. Lisp and Symbolic Computation, 8(3):209–228, September 1995.Google Scholar
  19. 19.
    M. Das, T. Reps, and P. Van Hentenryck. Semantic foundations of binding-time analysis for imperative programs. In ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 100–110, La Jolla, CA, USA, 1995. ACM Press.Google Scholar
  20. 20.
    A.M. Erosa and L.J. Hendren. Taming control flow: A structured approach to eliminating goto statements. In Proceedings of the IEEE 1994 International Conference on Computer Languages, May 1994.Google Scholar
  21. 21.
    R. Glück, R. Nakashige, and R. Zöchling. Binding-time analysis applied to mathematical algorithms. In J. Dolevzal and J. Fidler, editors, System Modelling and Optimization, pages 137–146. Chapman and Hall, 1995.Google Scholar
  22. 22.
    C. Goad. Automatic construction of special purpose programs. In D.W. Loveland, editor, 6th Conference on Automated Deduction, New York, USA Lecture Notes in Computer Science, vol. 188), pages 194–208. Berlin: Springer-Verlag, 1982.Google Scholar
  23. 23.
    C. K. Gomard and N. D. Jones. Compiler generation by partial evaluation. In G. X. Ritter, editor, Information Processing '89. Proceedings of the IFIP 11th World Computer Congress, pages 1139–1144. IFIP, Amsterdam: North-Holland, 1989.Google Scholar
  24. 24.
    L. Hornof. Static Analyses for the Effective Specialization of Realistic Applications. PhD thesis, Université de Rennes I, June 1997.Google Scholar
  25. 25.
    L. Hornof and J. Noyé. Accurate binding-time analysis for imperative languages: Flow, context, and return sensitivity. In PEPM97, Amsterdam, The Netherlands, June 1997. ACM Press.Google Scholar
  26. 26.
    N.D. Jones. An introduction to partial evaluation. ACM Computing Surveys, 28(3):480–503, sep 1996.Google Scholar
  27. 27.
    N.D. Jones, C. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation International Series in Computer Science. Prentice-Hall, June 1993.Google Scholar
  28. 28.
    N.D. Jones and D.A. Schmidt. Compiler generation from denotational semantics. In N.D. Jones, editor, Semantics-Directed Compiler Generation, Aarhus, Denmark Lecture Notes in Computer Science, vol. 94), pages 70–93. Berlin: Springer-Verlag, 1980.Google Scholar
  29. 29.
    J. Jørgensen. Compiler generation by partial evaluation. Master's thesis, DIKU, University of Copenhagen, Denmark, 1992. Student Project 92-1-4.Google Scholar
  30. 30.
    P. Kleinrubatscher, A. Kriegshaber, R. Zöchling, and R. Chick. Fortran program specialization. In U. Meyer and G. Snelting, editors, Workshop Semantikgestützte Analyse, Entwicklung and Generierung van Programmer, pages 45–54. Justus-Liebig-Universät, Giessen, Germany, 1994. Report No. 9402.Google Scholar
  31. 31.
    T.J. Marlowe and B.G. Ryder. Properties of data flow frameworks. Acta Informatica, 28(2):121–163, December 1990.Google Scholar
  32. 32.
    R. Metzger and S. Stroud. Interprocedural constant propagation: An empirical study. ACM Letter on Programming Languages and Systems, 2(1-4):213–232, March–December 1993.Google Scholar
  33. 33.
    T. Mogensen. The application of partial evaluation to ray-tracing. Master's thesis, DIKU, University of Copenhagen, Denmark, 1986.Google Scholar
  34. 34.
    G. Muller, R. Marlet, E.N. Volanschi, C. Consel, C. Pu, and A. Goel. Fast, optimized Sun RPC using automatic program specialization. Publication interne 1094, IRISA, Rennes, France, March 1997.Google Scholar
  35. 35.
    G. Muller, E.N. Volanschi, and R. Marlet. Scaling up partial evaluation for optimizing the Sun commercial RPC protocol. In PEPM97, Amsterdam, The Netherlands, June 1997. ACM Press.Google Scholar
  36. 36.
    H.R. Nielson and F. Nielson. Semantics with Applications: A Formal Introduction. Wiley Professional Computing. John Wiley & Sons, 1991.Google Scholar
  37. 37.
    Partial Evaluation and Semantics-Based Program Manipulation, Copenhagen, Denmark, June 1993. ACM Press.Google Scholar
  38. 38.
    ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, Amsterdam, The Netherlands, June 1997. ACM Press.Google Scholar
  39. 39.
    Conference Record of the 23rdAnnual ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, St. Petersburg Beach, FL, USA, January 1996. ACM Press.Google Scholar
  40. 40.
    C. Pu, T. Autrey, A. Black, C. Consel, C. Cowan, J. Inouye, L. Kethana, J. Walpole, and K. Zhang. Optimistic incremental specialization: Streamlining a commercial operating system. In Proceedings of the 1995 ACM Symposium on Operating Systems Principles, pages 314–324, Copper Mountain Resort, CO, USA, December 1995. ACM Operating Systems Reviews, 29(5),ACM Press.Google Scholar
  41. 41.
    T. Reps and T. Turnidge. Program specialization via program slicing. In Danvy et al. [17], pages 409–429.Google Scholar
  42. 42.
    S.A. Romanenko. Arity raiser and its use in program specialization. In N. Jones, editor, ESOP'90 — Third European Symposium on Programming, number 432 in Lecture Notes in Computer Science, pages 340–360, Copenhagen, Denmark, May 1990. Springer-Verlag.Google Scholar
  43. 43.
    Sun Microsystems. Network Programming Guide, March 1990.Google Scholar
  44. 44.
    A.S. Tanenbaum. Operating Systems: Design and Implementation. Prentice-Hall, 1987.Google Scholar
  45. 45.
    F. Tip. A survey of program slicing techniques. Report CS-R9438, Computer Science, Centrum voor Wiskunde en Informatica, 1994.Google Scholar
  46. 46.
    E.N. Volanschi, G. Muller, and C. Consel. Safe operating system specialization: the RPC case study. In Workshop Record of WCSSS'96-The Inaugural Workshop on Compiler Support for Systems Software, pages 24–28, Tucson, AZ, USA, February 1996.Google Scholar
  47. 47.
    E.N. Volanschi, G. Muller, C. Consel, L. Hornof, J. Noyé, and C. Pu. A uniform automatic approach to copy elimination in system extensions via program specialization. Research Report 2903, INRIA, Rennes, France, June 1996.Google Scholar
  48. 48.
    D. Weise, R. Conybeare, E. Ruf, and S. Seligman. Automatic online partial evaluation. In J. Hughes, editor, Functional Programming Languages and Computer Architecture, volume 523 of Lecture Notes in Computer Science, pages 165–191, Cambridge, MA, USA, August 1991. Springer-Verlag.Google Scholar
  49. 49.
    R.P. Wilson, R.S. French, C.S. Wilson, S.P. Amarasinghe, J.M. Anderson, S.W.K. Tjiang, S. W. Liao, C. W. Tseng, M.W. Hall, M.S. Lam, and J.L. Hennessy. SUIF: An infrastructure for research on parallelizing and optimizing compilers. ACM SIGPLAN Notices, 29(12):31–37, December 94.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1997

Authors and Affiliations

  • Luke Hornof
    • 1
  • Charles Consel
    • 1
  • Jacques Noyé
    • 2
  1. 1.Irisa Campus Universitaire de BeaulieuRennes CedexFrance
  2. 2.École des Mines de NantesNantes Cedex 03France

Personalised recommendations