skip to main content
article
Free access

A practical interprocedural data flow analysis algorithm

Published: 01 September 1978 Publication History

Abstract

A new interprocedural data flow analysis algorithm is presented and analyzed. The algorithm associates with each procedure in a program information about which variables may be modified, which may be used, and which are possibly preserved by a call on the procedure, and all of its subcalls. The algorithm is sufficiently powerful to be used on recursive programs and to deal with the sharing of variables which arises through reference parameters. The algorithm is unique in that it can compute all of this information in a single pass, not requiring a prepass to compute calling relationships or sharing patterns. The algorithm is asymptotically optimal in time complexity. It has been implemented and is practical even on programs which are quite large.

References

[1]
Allen, F.E. Interprocedural data flow analysis. Information Processing 74, North-Holland Pub. Co., Amsterdam, 1974, pp. 398--402.
[2]
Allen, F.E., and Schwartz, J.T. Determining the data relationships in a collection of procedures (unpublished detailed summary).
[3]
Ammann, U. Compiler for PASCAL 6000--3.4. ETH, Institut fiir Informatik, Zurich, Switzerland, 1974.
[4]
Barth, J.M. An interprocedural data flow analysis algorithm. Conf. Rec. Fourth ACM Symp, Principles of Programming Languages, Los Angeles, Calif., Jan. 1977, pp. 119-13 I.
[5]
Barth, J.M. A practical interprocedural data flow analysis algorithm and its applications. Ph.D. Diss., Comptr. Sci. Tech. Rep. No. 770520, U. of California, Berkeley, May 1977.
[6]
Graham, S.L., and Wegrnan, M. A fast and usually linear algorithm for global flow analysis. J. ACM 23, I (Jan. 1976), 172-202.
[7]
Hecht, M.S., and Shaffer, J.B. Ideas on the design of a "quad improver" for SIMPL-T, Pt. I: Overview and intersegment analysis. Comptr. Sci. Tech, Rcp. TR-405, U. of Maryland, CoUege Park, Md., Aug. 1975. This report is superceded by {8}, but contains some information not in the latter paper.
[8]
Hecht, M.S., and Shaffer, J.B. A modest quad improver for SIMPL-T, Dept. Comptr. Sci., U. of Maryland, CoUegc Park, Md., April 1977.
[9]
Hecht, M.S., and UUman, J.D. A simple algorithm for global flow problems. SIAM J. Comptng. 4, 4 (Dec. 1975), 519-532.
[10]
Jensen, K., Wirth, N. PASCAL User Manual and Report. Leciure Notes in Computer Science No. 18, Springer-Verlag, Berlin, 1974.
[11]
Lomet, D.B. Data flow analysis in the presence of procedure calls. Res. Rep. RC5728 IBM T.J. Watson Res. Ctr., Yorktown Heights, N.Y., Nov. 1975.
[12]
Nanr, P. Ed. Revised report on the algorithmic language Algol- 60. Comm. ACM 6, 1 (Jan. 1963), 1-17.
[13]
Rosen, B.K. Data flow analysis for recursive PL/I programs. Res, Rep. RC5211, IBM T.J. Watson Res. Ctr., Yorktown Heights, N.Y., Jan. 1975. This report is superceded by {16}.
[14]
Rosen, B.K. High level data flow analysis, Pt. 1 (classical structured programming). Res. Rep. RC5598, IBM, T.J. Watson Res. Ctr., Yorktown Heights, N.Y., Aug. 1975.
[15]
Rosen, B.K. High level data flow analysis, Pt. 2 (escapes and jumps). Res. Rep. RC5744, IBM T.J. Watson Res. Ctr., Yorktown Heights, N.Y. Dec. 1975.
[16]
Rosen, B.K. Data flow analysis for procedural languages. T.J. Watson Res. Ctr., Yorktown Heights, N.Y., 1976.
[17]
Spillman, T.C. Exposing side effects in a PL/I optimizing compiler. Proceedings IFIP Conference 1971, North Holland Publishing Company, Amsterdam (1971), 376-381.
[18]
Tarjan, R.E. Solving path problems on directed graphs. Tech. Rep. STAN-CS-75-528, Comptr. Sci. Dept., Stanford U., Stanford, Calif., Nov. 1975.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Communications of the ACM
Communications of the ACM  Volume 21, Issue 9
Sept. 1978
82 pages
ISSN:0001-0782
EISSN:1557-7317
DOI:10.1145/359588
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 September 1978
Published in CACM Volume 21, Issue 9

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. data flow analysis
  2. global flow analysis
  3. incarnations
  4. optimization
  5. reference parameters
  6. relations
  7. side effects

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)136
  • Downloads (Last 6 weeks)11
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