Constant propagation with conditional branches

Constant propagation is a well-known global flow analysis problem. The goal of constant propagation is to discover values that are constant on all possible executions of a program and to propagate these constant values as far forward through the program as possible. Expressions whose operands are all constants can be evaluated at compile time and the results propagated further. Using the algorithms presented in this paper can produce smaller and faster compiled programs. The same algorithms can be used for other kinds of analyses (e.g., type determination). We present four algorithms in this paper, all conservative in the sense that all constants may not be found, but each constant found is constant over all possible executions of the program. These algorithms are among the simplest, fastest, and most powerful global constant propagation algorithms known. We also present a new algorithm that performs a form of interprocedural data flow analysis in which aliasing information is gathered in conjunction with constant propagation. Several variants of this algorithm are considered.

[1]  K. J. Ottenstein,et al.  Data-flow graphs as an intermediate program form. , 1978 .

[2]  Eugene W. Myers,et al.  A precise inter-procedural data flow algorithm , 1981, POPL '81.

[3]  Frances E. Allen,et al.  Control-flow analysis , 2022 .

[4]  Gary A. Kildall,et al.  A unified approach to global program optimization , 1973, POPL.

[5]  William H. Harrison,et al.  Compiler Analysis of the Value Ranges for Variables , 1977, IEEE Transactions on Software Engineering.

[6]  Keith Daniel Cooper Interprocedural data flow analysis in a programming environment , 1983 .

[7]  Jeffrey M. Barth An interprocedural data flow analysis algorithm , 1977, POPL '77.

[8]  Etienne Morel,et al.  Global optimization by suppression of partial redundancies , 1979, CACM.

[9]  J. E. Ball,et al.  Predicting the effects of optimization on a procedure body , 1979, SIGPLAN '79.

[10]  Mark N. Wegman,et al.  Summarizing graphs by regular expressions , 1983, POPL '83.

[11]  M. Wegman General and efficient methods for global code improvement , 1981 .

[12]  Robert Scheifler,et al.  An analysis of inline substitution for a structured programming language , 1977, CACM.

[13]  Terrence W. Pratt,et al.  Kernel-control tailoring of sequential programs for parallel execution , 1982, ICPP.

[14]  Alfred V. Aho,et al.  Principles of Compiler Design (Addison-Wesley series in computer science and information processing) , 1977 .

[15]  Robert M. Shapiro,et al.  THE REPRESENTATION OF ALGORITHMS , 1969 .

[16]  Jeffrey D. Ullman,et al.  Global Data Flow Analysis and Iterative Algorithms , 1976, J. ACM.

[17]  Louise Trevillyan,et al.  The Experimental Compiling System , 1980, IBM J. Res. Dev..

[18]  Karl J. Ottenstein,et al.  A program form based on data dependency in predicate regions , 1983, POPL '83.

[19]  John H. Reif Symbolic program analysis in almost linear time , 1978, POPL '78.

[20]  John H. Reif,et al.  Symbolic evaluation and the global value graph , 1977, POPL.

[21]  John R. Ellis,et al.  Bulldog: A Compiler for VLIW Architectures , 1986 .

[22]  Mark N. Wegman,et al.  A Fast and Usually Linear Algorithm for Global Flow Analysis , 1976, J. ACM.

[23]  Barry K. Rosen Data Flow Analysis for Procedural Languages , 1979, JACM.

[24]  Ben Wegbreit,et al.  Property extraction in well-founded property sets , 1975, IEEE Transactions on Software Engineering.

[25]  Alfred V. Aho,et al.  Principles of Compiler Design , 1977 .

[26]  Frances E. Allen,et al.  Interprocedural Data Flow Analysis , 1974, IFIP Congress.

[27]  John Banning,et al.  : An Efficient , 2022 .

[28]  Andrei P. Ershov,et al.  On the Essence of Compilation , 1977, Formal Description of Programming Concepts.

[29]  Barry K. Rosen,et al.  Qualified Data Flow Problems , 1980, IEEE Transactions on Software Engineering.

[30]  John H. Reif,et al.  Efficient Symbolic Analysis of Programs , 1986, J. Comput. Syst. Sci..

[31]  F. Kenneth Zadeck,et al.  Incremental data flow analysis in a structured program editor , 1984, SIGPLAN '84.

[32]  Fred C. Chow,et al.  A portable machine-independent global optimizer--design and measurements , 1984 .