On the Complexity of Constant Propagation

  • Markus Müller-Olm
  • Oliver Rüthing
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2028)


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.


Constant Propagation Start Node Program Point Conditional Branch Polynomial Time Reduction 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques and Tools. Addison-Wesley, 1985.Google Scholar
  2. 2.
    C. Click and K. D. Cooper. Combining analyses, combining optimizations. ACM Transactions on Programming Languages and Systems, 17(2):181–196, 1995.CrossRefGoogle Scholar
  3. 3.
    M. R. Garey and D. S. Johnson. Computers and Intractability-A Guide to the Theory of NP-Completeness. W.H. Freeman & Co, San Francisco, 1979.zbMATHGoogle Scholar
  4. 4.
    M. S. Hecht. Flow Analysis of Computer Programs. Elsevier, North-Holland, 1977.zbMATHGoogle Scholar
  5. 5.
    N. D. Jones and S. S Muchnick. Complexity of flow analysis, inductive assertion synthesis, and a language due to Dijkstra. In [10], chapter 12, pages 380–393.Google Scholar
  6. 6.
    M. Karr. Affine relationships among variables of a program. Acta Informatica, 6:133–151, 1976.zbMATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    J. Knoop and O. Rüthing. Constant propagation on the value graph: simple constants and beyond. In CC’ 2000, LNCS 1781, pages 94–109, Berlin, Germany, 2000. Springer-Verlag.Google Scholar
  8. 8.
    W. Landi. Undecidability of static analysis. ACM Letters on Programming Languages and Systems, 1(4):323–337, 1992.CrossRefGoogle Scholar
  9. 9.
    S. S. Muchnick. Advanced Compiler Design & Implementation. Morgan Kaufmann, San Francisco, CA, 1997.Google Scholar
  10. 10.
    S. S. Muchnick and N. D. Jones, editors. Program Flow Analysis: Theory and Applications. Prentice Hall, Englewood Cliffs, NJ, 1981.zbMATHGoogle Scholar
  11. 11.
    M. Müller-Olm. The complexity of copy constant detection in parallel programs. In STACS’2001, LNCS, 2001. Springer-Verlag. To appear.Google Scholar
  12. 12.
    R. Muth and S. Debray. On the complexity of flow-sensitive dataflow analysis. In POPL’2000, pages 67–81, ACM, Boston, MA, 2000.Google Scholar
  13. 13.
    C. H. Papadimitriou. Computational Complexity. Addison-Wesley, 1994.Google Scholar
  14. 14.
    W. Pugh. The Omega Test: a fast and practical integer programming algorithm for dependence analysis. In IEEE, editor, Supercomputing’ 91, Albuquerque, NM, pages 4–13. IEEE Computer Society Press, 1991.Google Scholar
  15. 15.
    W. Pugh and D. Wonnacott. Constraint-based array dependence analysis. ACM Transactions on Programming Languages and Systems, 20(3):635–678, 1998.CrossRefGoogle Scholar
  16. 16.
    J. H. Reif and R. Lewis. Symbolic evaluation and the gobal value graph. POPL’77, pages 104–118, ACM, Los Angeles, CA, 1977.Google Scholar
  17. 17.
    M. Sagiv, T. Reps, and S. Horwitz. Precise interprocedural dataflow analysis with applications to constant propagation. Theoretical Computer Science, 167(1-2):131–170, 1996.zbMATHCrossRefMathSciNetGoogle Scholar
  18. 18.
    M. Sharir and A. Pnueli. Two approaches to interprocedural data flow analysis. In [10], chapter 7, pages 189–233.Google Scholar
  19. 19.
    B. Steffen and J. Knoop. Finite constants: Characterizations of a new decidable set of constants. Theoretical Computer Science, 80(2):303–318, 1991.Google Scholar
  20. 20.
    M. N. Wegman and F. K. Zadeck. Constant propagation with conditional branches. ACM Transactions on Programming Languages and Systems, 13(2), 1991.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Markus Müller-Olm
    • 1
  • Oliver Rüthing
    • 1
  1. 1.FB InformatikUniversität DortmundDortmundGermany

Personalised recommendations