A Polynomial-Time Algorithm for Global Value Numbering
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.
Unable to display preview. Download preview PDF.
- 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
- 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