Skip to main content

A Polynomial-Time Algorithm for Global Value Numbering

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3148))

Abstract

We describe a polynomial-time algorithm for global value numbering, which is the problem of discovering equivalences among program sub-expressions. We treat all conditionals as non-deterministic and all program operators as uninterpreted. We show that there are programs for which the set of all equivalences contains terms whose value graph representation requires exponential size. Our algorithm discovers all equivalences among terms of size at most s in time that grows linearly with s. For global value numbering, it suffices to choose s to be the size of the program. Earlier deterministic algorithms for the same problem are either incomplete or take exponential time.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting equality of variables in programs. In: 15th Annual ACM Symposium on Principles of Programming Languages, pp. 1–11. ACM, New York (1988)

    Chapter  Google Scholar 

  2. Click, C.: Global code motion/global value numbering. In: Proccedings of the ACM SIGPLAN 1995 Conference on Programming Language Design and Implementation, June 1995, pp. 246–257 (1995)

    Google Scholar 

  3. Cousot, P., Cousot, R.: Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: 4th Annual ACM Symposium on Principles of Programming Languages, pp. 234–252 (1977)

    Google Scholar 

  4. Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems 13(4), 451–490 (1990)

    Article  Google Scholar 

  5. Gargi, K.: A sparse algorithm for predicated global value numbering. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, June 17-19, vol. 37(5), pp. 45–56. ACM Press, New York (2002)

    Chapter  Google Scholar 

  6. Gulwani, S., Necula, G.C.: Global value numbering using random interpretation. In: 31st Annual ACM Symposium on POPL, January 2004, ACM, New York (2004)

    Google Scholar 

  7. Kildall, G.A.: A unified approach to global program optimization. In: 1st ACM Symposium on Principles of Programming Language, October 1973, pp. 194–206 (1973)

    Google Scholar 

  8. Muchnick, S.S.: Advanced Compiler Design and Implementation. Morgan Kaufmann, San Francisco (2000)

    Google Scholar 

  9. Necula, G.C.: Translation validation for an optimizing compiler. In: Proceedings of the ACM SIGPLAN ’00 Conference on Programming Language Design and Implementation, June 2000. ACM SIGPLAN, pp. 83–94 (2000)

    Google Scholar 

  10. Pnueli, A., Siegel, M., Singerman, E.: Translation validation. In: Steffen, B. (ed.) TACAS 1998. LNCS, vol. 1384, pp. 151–166. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  11. Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Global value numbers and redundant computations. In: 15th Annual ACM Symposium on Principles of Programming Languages, pp. 12–27. ACM, New York (1988)

    Chapter  Google Scholar 

  12. Rüthing, O., Knoop, J., Steffen, B.: Detecting equalities of variables: Combining efficiency with precision. In: Cortesi, A., Filé, G. (eds.) SAS 1999. LNCS, vol. 1694, pp. 232–247. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  13. Wegman, M.N., Zadeck, F.K.: Constant propagation with conditional branches. ACM Transactions on Programming Languages and Systems 13(2), 181–210 (1991)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Gulwani, S., Necula, G.C. (2004). A Polynomial-Time Algorithm for Global Value Numbering. In: Giacobazzi, R. (eds) Static Analysis. SAS 2004. Lecture Notes in Computer Science, vol 3148. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-27864-1_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-27864-1_17

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22791-5

  • Online ISBN: 978-3-540-27864-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics