Specialization of imperative programs through analysis of relational expressions

  • Alexander Sakharov
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1110)

Abstract

An inter-procedural data flow analysis operating on control flow graphs and collecting information about program expressions is described in this paper. The following relational and other expressions are analyzed: equivalences between program expressions and constants; linear-ordering inequalities between program expressions and constants; equalities originating from some program assignments; atomic constituents of controlling expressions of program branches. Analysis is executed by a worklist-based fixpoint algorithm which interprets conditional branches and incorporates a rule-based inference procedure. Two variants of the polyvariant program point specialization using results of the analysis are presented. The both specializations are done at the level of control flow graphs. The variants differ in terms of the size of residual programs.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    A.V. Aho, R. Sethi, J. D. Ullman, Compilers. Principles, Techniques, and Tools, Addison-Wesley, 1986.Google Scholar
  2. [2]
    L. O. Andersen. Partial Evaluation of C and Automatic Compiler Generation. Lecture Notes in Computer Science, v. 641, 1992, 251–257.Google Scholar
  3. [3]
    R. Baier, R. Glueck, R. Zochling. Partial Evaluation of Numerical Programs in Fortran. Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, 1994, 119–132.Google Scholar
  4. [4]
    S. Blazy, P. Facon. Partial Evaluation for The Understanding of Fortran Programs. International Journal of Software Engineering and Knowledge Engineering, v. 4, 1994, #4, 535–559.Google Scholar
  5. [5]
    F. Bourdoncle. Abstract Debugging of Higher-Order Imperative Languages. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, 1993, 47–55.Google Scholar
  6. [6]
    M. A. Bulyonkov. Polyvariant Mixed Computation for Analyzer Programs. Acta Informatica, v. 21, 1984, 473–484.Google Scholar
  7. [7]
    P.R. Carini, M. Hind. Flow-Sensitive Interprocedural Constant Propagation. Proceedings of the SIGPLAN Symposium on Programming Language Design and Implementation, 1995, 23–31.Google Scholar
  8. [8]
    C.-L. Chang, R. C.-T. Lee. Symbolic Logic and Mechanical Theorem Proving, Academic Press, 1973.Google Scholar
  9. [9]
    C. Consel, S.C. Khoo. Parameterized Partial Evaluation. ACM Transactions on Programming Languages and Systems, v. 15, 1993, #3, 463–493.Google Scholar
  10. [10]
    P. Cousot, R. Cousot. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. Proceedings of the ACM Symposium on Principles of Programming Languages, 1977, 238–252.Google Scholar
  11. [11]
    C.N. Fisher, R.J. LeBlanc, Jr. Crafting A Compiler, Benjamin/Cummings, 1988.Google Scholar
  12. [12]
    Y. Futamura, K. Nogi. Generalized partial computation. In: Partial Evaluation and Mixed Computation (D. Bjorner, A.P. Ershov, N.D. Jones, Eds.), North-Holland, 1988.Google Scholar
  13. [13]
    R. Glueck, A. V. Klimov. Occam's Razor in Metacomputation: the Notion of a Perfect Process Tree. Lecture Notes in Computer Science, v. 724, 1993, 112–123.Google Scholar
  14. [14]
    M.S. Hecht. Flow Analysis of Computer Programs, Elsevier North-Holland, 1977.Google Scholar
  15. [15]
    H. Johnson. Data Flow Analysis for ‘Intractable’ System Software. Proceedings of the ACM SICPLAN Conference on Programming Language Design and Implementation, 1986, 109–117.Google Scholar
  16. [16]
    N. Jones. The Essence of Program Transformation by Partial Evaluation and Driving. Lecture Notes in Computer Science, v. 792, 1994, 206–224.Google Scholar
  17. [17]
    N.D. Jones, C. K. Gomard, P. Sestoft. Partial Evaluation and Automatic Program Generation, Prentice Hall, 1993.Google Scholar
  18. [18]
    J.B. Kam, J.D. Ullman. Monotone Data Flow Analysis Frameworks. Acta Informatica, v. 7, 1977, 305–317.Google Scholar
  19. [19]
    D.E. Knuth, P.B. Bendix. Simple Word Problems in Universal Algebras. In: Computational Problems in Abstract Algebra (J. Leech, Ed.), Pergamon Press, 1970.Google Scholar
  20. [20]
    W. Landi, B.G. Ryder. A Safe Approximate Algorithm for Interprocedural Pointer Aliasing. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, 1992, 235–248.Google Scholar
  21. [21]
    U. Meyer. Techniques for Partial Evaluation of Imperative Languages. Proceedings of the ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, 1991, 94–105.Google Scholar
  22. [22]
    F. Mueller, D.B. Whalley. Avoiding Conditional Branches by Code Replication. Proceedings of the SIGPLAN Symposium on Programming Language Design and Implementation, 1995, 56–66.Google Scholar
  23. [23]
    S. Sagiv et al. A Logic-Based Approach to Data Flow Analysis Problems. Lecture Notes in Computer Science, v. 456, 1990, 52–65.Google Scholar
  24. [24]
    A. Sakharov. Propagation of Constants and Assertions. SIGPLAN Notices, v. 29, 1994, #5, 3–6.Google Scholar
  25. [25]
    B. Wegbreit. Property Extraction in Well-Founded Property Sets. IEEE Transactions on Software Engineering, v. 1, 1977, #3, 270–285.Google Scholar
  26. [26]
    M.N. Wegman, F.K. Zadeck. Constant Propagation with Conditional Branches. ACM Transactions on Programming Languages and Systems, v. 13, 1991, #2, 181–210.Google Scholar

Copyright information

© Springer-Verlag 1996

Authors and Affiliations

  • Alexander Sakharov
    • 1
  1. 1.MotorolaArlington HeightsUSA

Personalised recommendations