On the Complexity of Constant Propagation

Constant propagation (CP) is one of the most widely used optimizations in practice (cf. [9]). Intuitively, it addresses the problem of statically detecting whether an expression always evaluates to a unique constant at run-time. Unfortunately, as proved by different authors [4, 16], CP is in general undecidable even if the interpretation of branches is completely ignored. On the other hand, it is certainly decidable in more restricted settings, like on loop-free programs (cf. [7]). In this paper, we explore the complexity of CP for a three-dimensional taxonomy. We present an almost complete complexity classification, leaving only two upper bounds open.

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

[2]  Mark N. Wegman,et al.  Constant propagation with conditional branches , 1985, POPL.

[3]  William Landi,et al.  Undecidability of static analysis , 1992, LOPL.

[4]  Thomas W. Reps,et al.  Precise Interprocedural Dataflow Analysis with Applications to Constant Propagation , 1995, TAPSOFT.

[5]  Jens Knoop,et al.  Constant Propagation on the Value Graph: Simple Constants and Beyond , 2000, CC.

[6]  Saumya K. Debray,et al.  On the complexity of flow-sensitive dataflow analyses , 2000, POPL '00.

[7]  William Pugh,et al.  Constraint-based array dependence analysis , 1998, TOPL.

[8]  William Pugh,et al.  The Omega test: A fast and practical integer programming algorithm for dependence analysis , 1991, Proceedings of the 1991 ACM/IEEE Conference on Supercomputing (Supercomputing '91).

[9]  David S. Johnson,et al.  Computers and Intractability: A Guide to the Theory of NP-Completeness , 1978 .

[10]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[11]  Keith D. Cooper,et al.  Combining analyses, combining optimizations , 1995, TOPL.

[12]  Bernhard Steffen,et al.  Finite Constants: Characterizations of a New Decidable Set of Constants , 1991, Theor. Comput. Sci..

[13]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[14]  Matthew S. Hecht Flow Analysis of Computer P-OP , 1977 .

[15]  Markus Müller-Olm,et al.  The Complexity of Copy Constant Detection in Parallel Programs , 2001, STACS.

[16]  Neil D. Jones,et al.  Program Flow Analysis: Theory and Application , 1981 .

[17]  Matthew S. Hecht,et al.  Flow Analysis of Computer Programs , 1977 .

[18]  Neil D. Jones,et al.  Program flow analysis - theory and applications , 1981, Prentice Hall software series.

[19]  Neil D. Jones,et al.  Complexity of flow analysis, inductive assertion synthesis and a language due to Dijkstra , 1980, 21st Annual Symposium on Foundations of Computer Science (sfcs 1980).