skip to main content
article
Open access

A practical framework for demand-driven interprocedural data flow analysis

Published: 01 November 1997 Publication History

Abstract

The high cost and growing importance of interprocedural data flow analysis have led to an increased interest in demand-driven algorithms. In this article, we present a general framework for developing demand-driven interprocedural data flow analyzers and report our experience in evaluating the performance of this approach. A demand for data flow information is modeled as a set of queries. The framework includes a generic demand-driven algorithm that determines the response to query by iteratively applying a system of query propagation rules. The propagation rules yield precise responses for the class of distributive finite data flow problems. We also describe a two-phase framework variation to accurately handle nondistributive problems. A performance evaluation of our demand-driven approach is presented for two data flow problems, namely, reaching-definitions and copy constant propagation. Our experiments show that demand-driven analysis performs well in practice, reducing both time and space requirements when compared with exhaustive analysis.

References

[1]
BABICH, W. AND JAZAYERI, ik/{. 1978. The method of attributes for data flow analysis: Part II. Demand analysis. Acta Inf. 10, 3 (Oct.), 265-272.
[2]
BLUME, W. AND EIGENMANN, R. 1995. Demand-driven symbolic range propagation. In Proceedings of the Workshop on Languages and Compilers for Parallelism. Lecture Notes in Computer Science, vol. 1033. Springer Verlag, Berlin, 141-160.
[3]
BOURDONCLE, F. 1993. Abstract debugging of high-order imperative languages. In Proceedings of the SIGPLAN 1993 Conference on Programming Language Design and Implementation. ACM, New York, 46-55.
[4]
BURKE, M. 1987. An interval analysis approach toward exhaustive and incremental data flow analysis. Tech. Rep. RC 12702, IBM Thomas J. Watson Research Center, Yorktown Heights, N.Y.
[5]
CHOI, J., CYTRON, R., AND FERRANTE, J. 1992. On the efficient engineering of ambitious program analysis. IEEE Trans. Softw. Eng. 20, 2 (Feb.), 105-114.
[6]
CHOI, J.-D., BURKE, M., AND CARINI, P. 1993. Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects. In Proceedings of the 20th A CM SIGACT- SIGPLAN Symposium on Principles of Programming Languages. ACM, New York, 232-245.
[7]
COOPER, K. 1985. Analyzing aliases of reference formal parameters. In Proceedings of the 12th ACM Symposium on Principles of Programming Languages. ACM, New York, 281-290.
[8]
COOPER, K., HALL, M., AND KENNEDY, K. 1992. Procedure cloning. In Proceedings of the IEEE 1992 International Conference on Computer Languages. IEEE, New York, 96-105.
[9]
COOPER, K. AND KENNEDY, K. 1988. Interprocedural side-effect analysis in linear time. In Proceedings of the SIGPLAN 1988 Symposium on Compiler Construction. ACM, New York, 57-66.
[10]
COUSOT, P. 1981. Semantic foundations of program analysis. In Program Flow Analysis: Theory and Applications, S. Muchnick and N. Jones, Eds. Prentice-Hall, Englewood Cliffs, N.J., 303- 342.
[11]
COUSOT, P. AND COUSOT, R. 1978. Static determination of dynamic properties of recursive procedures. In Proceedings of the IFIP Conference on Programming Concepts, E. Neuhold, Ed. North-Holland, Amsterdam, 237-277.
[12]
CYTRON, R. AND GERSHBEIN, R. 1993. Efficient accommodation of may-alias information in SSA form. In Proceedings of the SIGPLAN 1993 Conference on Programming Language Design and Implementation. ACM, New York, 36-45.
[13]
DUESTERWALD, E. 1996. A demand-driven approach for efficient interprocedural data flow analysis. Ph.D. thesis, Univ. of Pittsburgh, Pittsburgh, Pa.
[14]
DUESTERWALD, E., GUPTA, R., AND SOFFA, M. 1992. Rigorous data flow testing through output influences. In Proceedings of the 2rid Irvine Software Symposium. 131-145.
[15]
DUESTERWALD, E., GUPTA, R., AND SOFFA, M. 1995. Demand-driven computation of interprocedural data flow. In Proceedings of the 22rid A CM Symposium on Principles of Programming Languages. ACM, New York, 37-48.
[16]
EMAMI, M., GHIYA, R., AND HENDREN, L. 1994. Context-sensitive interprocedural points-to analysis on the presence of function pointers. In Proceedings of the SIGPLAN 199g Conference on Programming Language Design and Implementation. ACM, New York, 242-256.
[17]
FRANKL, P. AND WEYUKER, E. 1988. An applicable family of data flow testing criteria. IEEE Trans. Softw. Eng. SE-lg, 10 (Oct.), 1483-1498.
[18]
GRISWOLD, W. AND NOTKIN, D. 1993. Automated assistance for program restructuring. ACM Trans. Softw. Eng. Methodol. 2, 3 (July), 228-269.
[19]
HANKIN, C. AND LEMETAYER, D. 1994. A type-based framework for program analysis. In Proceedings of the 1st International Static Analysis Symposium. 380-394.
[20]
HORWITZ, S., REPS, T., AND SAGIV, M. 1995a. Demand interprocedural dataflow analysis. In Proceedings of the 3rd A CM SIGSOFT Symposium on the Foundations of Software Engineering. ACM, New York, 104-115.
[21]
HORWlTZ, S., REPS, T., AND SAGIV, M. 1995b. Demand interprocedural dataflow analysis. Tech. Rep. 1283, Computer Science Dept., Univ. of Wisconsin, Madison, Wisc. Aug.
[22]
HUGHES, J. AND LAUNCHBURY, J. 1992. Reversing abstract interpretations. In Proceedings of the gth European Symposium on Programming. Lecture Notes in Computer Science, vol. 582. Springer Verlag, Berlin, 269-286.
[23]
JONES, N. AND MYCROFT, t. 1986. Data flow analysis of applicative programs using minimal function graphs. In Proceedings of the 13th A CA//Symposium on Principles of Programming Languages. ACM, New York, 296-306.
[24]
KAM, J. AND ULLMAN, J. 1977. Monotone data flow analysis frameworks. Acta Inf. 7, 3 (July), 305-317.
[25]
KNOOP, J. AND STEFFEN, B. 1992. The interprocedural coincidence theorem. In Proceedings of the gth International Conference on Compiler Construction. Lecture Notes in Computer Science, vol. 641. Springer Verlag, Berlin, 125-140.
[26]
LANDI, W. AND RYDER, B. 1992. A safe approximate algorithm for interprocedural pointer aliasing. In Proceedings of the SIGPLAN 1992 Conference on Programming Language Design and Implementation. ACM, New York, 235-248.
[27]
MARLOWE, T. AND RYDER, B. 1990a. An efficient hybrid algorithm for incremental data flow analysis. In Proceedings of the 17th A CM Symposium on Principles of Programming Languages. ACM, New York, 184-196.
[28]
MARLOWE, T. AND RYDER, B. 1990b. Properties of data flow frameworks, a unified model. Acta Inf. 28, 2 (Dec.), 121-163.
[29]
POLLOCK, L. AND SOFFA, M. 1989. An incremental version of iterative data flow analysis. IEEE Trans. Softw. Eng. 15, 12 (Dec.), 1537-1549.
[30]
REPS, T. 1994. Solving demand versions of interprocedural analysis problems. In Proceedings of the 5th International Conference on Compiler Construction. Lecture Notes in Computer Science, vol. 786. Springer Verlag, Berlin, 389-403.
[31]
REPS, T., HORWITZ, S., AND SAGIV, M. 1995. Precise interprocedural dataflow analysis via graph teachability. In Proceedings of the 22nd A CM Symposium on Principles of Programming Languages. ACM, New York, 49-61.
[32]
REPS, T., TEITELBAUM, T., AND DEMERS, t. 1983. Incremental context-dependent analysis for language-based editors. ACM Trans. Program. Lang. Syst. 5, 3 (July), 449-477.
[33]
ROSEN, B., WEGMAN, M., AND ZADECK, F. 1988. Global value numbers and redundant computations. In the 15th A CM Symposium on Principles of Programming Languages. ACM, New York, 12-27.
[34]
RYDER, B. 1983. Incremental data flow analysis. In Proceedings of the 9th A CM Symposium on Principles of Programming Languages. ACM, New York, 167-176.
[35]
SAGIV, M., REPS, T., AND HORWITZ, S. 1995. Precise interprocedural dataflow analysis with applications to constant propagation. In FASE 95: Colloquium on Formal Approaches in Software Engineering. Lecture Notes in Computer Science, vol. 915. Springer Verlag, Berlin, 651-665.
[36]
SHARIR, M. AND PNUELI, t. 1981. Two approaches to interprocedural data flow analysis. In Program Flow Analysis: Theory and Applications, S. Muchnick and N. Jones, Eds. Prentice- Hall, Englewood Cliffs, N.J., 189-234.
[37]
STEENSGAARD, B. 1996. Points-to analysis in almost linear time. In Proceedings of the 23rd ACM Symposium on Principles of Programming Languages. ACM, New York, 32-41.
[38]
STOYENKO, A., MARLOWE, T., HALANG, W., AND YOUNIS, M. 1993. Enabling efficient schedulability analysis through conditional linking and program transformations. Control Eng. Pract. 1, 1, 85-105.
[39]
STROM, R. AND YELLIN, D. 1993. Extending typestate checking using conditional liveness analysis. IEEE Trans. Softw. Eng. 19, 5 (May), 478-485.
[40]
WEISER, M. 1984. Program slicing. IEEE Trans. Softw. Eng. Methodol. 10, 4 (July), 352-357.
[41]
WILSON, R. AND LAM, M. 1995. Efficient context-sensitive pointer analysis for C programs. In Proceedings of the SIGPLAN 1995 Conference on Programming Language Design and Implementation. ACM, New York, 1-12.
[42]
ZADECK, F. 1984. Incremental data flow analysis in a structured program editor. In Proceedings of the 1984 SIGPLAN Symposium on Compiler Construction. ACM, New York, 132-143.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 19, Issue 6
Nov. 1997
235 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/267959
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 November 1997
Published in TOPLAS Volume 19, Issue 6

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. copy constant propagation
  2. data flow analysis
  3. def-use chains
  4. demand-driven algorithms
  5. distributive data flow frameworks
  6. interprocedural data flow analysis
  7. program optimizations

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)83
  • Downloads (Last 6 weeks)7
Reflects downloads up to 23 Dec 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media