Advertisement

Value-Based Partial Redundancy Elimination

  • Thomas VanDrunen
  • Antony L. Hosking
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2985)

Abstract

Partial redundancy elimination (PRE) is a program transformation that identifies and eliminates expressions that are redundant on at least one (but not necessarily all) execution paths. Global value numbering (GVN) is a program analysis and transformation that identifies operations that compute the same value and eliminates operations that are redundant. A weakness of PRE is that it traditionally considers only expressions that are lexically equivalent. A weakness of GVN is that it traditionally considers only operations that are fully redundant. In this paper, we examine the work that has been done on PRE and GVN and present a hybrid algorithm that combines the strengths of each. The contributions of this work are a framework for thinking about expressions and values without source-level lexical constraints, a system of data-flow equations for determining insertion points, and a practical algorithm for extending a simple hash-based GVN for PRE. Our implementation subsumes GVN statically and, on most benchmarks, in terms of performance.

Keywords

Basic Block Program Point Program Language Design Code Motion Program Exit 
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.

References

  1. 1.
    Aho, A.V., Sethi, R., Ullman, J.D.: Compilers—principles, techniques, and tools. Addison Wesley, Reading (1986)Google Scholar
  2. 2.
    Alpern, B., Attanasio, C.R., Barton, J.J., Burke, M.G., Cheng, P., Choi, J.D., Cocchi, A., Fink, S.J., Grove, D., Hind, M., Hummel, S.F., Lieber, D., Litvinov, V., Mergen, M.F., Ngo, T., Russell, J.R., Sarkar, V., Serrano, M.J., Shepherd, J.C., Smith, S.E., Sreedhar, V.C., Srinivasan, H., Whaley, J.: The Jalapeño virtual machine. IBM System Journal 39(1) (February 2000)Google Scholar
  3. 3.
    Alpern, B., Wegman, M., Zadeck, K.: Detecting equality of variables in programs. In: Proceedings of the Symposium on Principles of Programming Languages, San Diego, California, January 1988, pp. 1–11 (1988)Google Scholar
  4. 4.
    Bodík, R., Anik, S.: Path-sensitive value-flow analysis. In: Proceedings of the Symposium on Principles of Programming Languages [26], pp. 237–251Google Scholar
  5. 5.
    Briggs, P., Cooper, K.D.: Effective partial redundancy elimination. In: Proceedings of the Conference on Programming Language Design and Implemenation, Orlando, FL, June 1994, pp. 159–170. SIGPLAN (1994)Google Scholar
  6. 6.
    Briggs, P., Cooper, K.D., Taylor Simpson, L.: Value numbering. Software—Practice and Experience 27(6), 701–724 (1997)CrossRefGoogle Scholar
  7. 7.
    Burke, M.G., Choi, J.-D., Fink, S., Grove, D., Hind, M., Sarkar, V., Serrano, M., Sreedhar, V., Srinvasan, H., Whaley, J.: The Jalapeño dynamic optimizing compiler for Java. In: ACM 1999 Java Grande Conference, June 1999, pp. 129–141 (1999)Google Scholar
  8. 8.
    Chow, F., Chan, S., Kennedy, R., Liu, S.-M., Lo, R., Tu, P.: A new algorithm for partial redundancy elimination based on SSA form. In: Proceedings of the Conference on Programming Language Design and Implemenation, Las Vegas, Nevada, June 1997, pp. 273–286 (1997)Google Scholar
  9. 9.
    Click, C.: Global code motion, global value numbering. In: Proceedings of the Conference on Programming Language Design and Implemenation, La Jolla, CA, June 1995. SIGPLAN Notices, vol. 30(6), pp. 246–257 (1995)Google Scholar
  10. 10.
    Standard Performance Evalution Counsil. SPEC JVM 98 benchmarks (1998), http://www.spec.org/osg/jvm98/
  11. 11.
    Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Kenneth Zadeck, F.: Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems 13(4), 451–490 (1991)CrossRefGoogle Scholar
  12. 12.
    Dhamdhere, D.M.: E-path pre—partial redundancy elimination made easy. ACM SIGPLAN Notices 37(8), 53–65 (2002)CrossRefGoogle Scholar
  13. 13.
    Drechsler, K.-H., Stadel, M.P.: A variation of Knoop, Rüthing, and Steffen’s lazy code motion. ACM SIGPLAN Notices 28(5), 29–38 (1993)CrossRefGoogle Scholar
  14. 14.
    EPCC. The java grande forum benchmark suite, http://www.epcc.ed.ac.uk/javagrande/index_1.html
  15. 15.
    Fink, S., Knobe, K., Sarkar, V.: Unified analysis of array and object references in strongly typed languages. In: Proceedings of the Static Analysis Symposium, Santa Barbara, California, July 2000, pp. 155–174 (2000)Google Scholar
  16. 16.
    Gargi, K.: A sparse algorithm for predicated global value numbering. In: Proceedings of the Conference on Programming Language Design and Implemenation, Berlin, Germany, June 2002, pp. 45–56 (2002)Google Scholar
  17. 17.
    Kennedy, R., Chan, S., Liu, S.-M., Lo, R., Tu, P., Chow, F.: Partial redundancy elimination. ACM Transactions on Programming Languages and Systems 21(3), 627–676 (1999)CrossRefGoogle Scholar
  18. 18.
    Knobe, K., Sarkar, V.: Array SSA form and its use in Parallelizaiton. In: Proceedings of the Symposium on Principles of Programming Languages [26], pp. 107–120Google Scholar
  19. 19.
    Knoop, J., Rüthing, O., Steffen, B.: Lazy code motion. In: Proceedings of the Conference on Programming Language Design and Implemenation, San Francisco, CA, July 1992. SIGPLAN Notices, vol. 27(7), pp. 224–234 (1992)Google Scholar
  20. 20.
    Knoop, J., Rüthing, O., Steffen, B.: Optimal code motion: Theory and practice. ACM Transactions on Programming Languages and Systems 16(4), 1117–1155 (1994)CrossRefGoogle Scholar
  21. 21.
    Knoop, J., Rüthing, O., Steffen, B.: Code motion and code placement: Just synonyms? In: Hankin, C. (ed.) ESOP 1998. LNCS, vol. 1381, pp. 154–169. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  22. 22.
    Knoop, J., Rüthing, O., Steffen, B.: Expansion-based removal of semantic partial redundancies. In: Jähnichen, S. (ed.) CC 1999. LNCS, vol. 1575, pp. 91–107. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  23. 23.
    Lee, H., Diwan, A., Eliot, J., Moss, B.: Understanding the behavior of compiler optimizations (submitted)Google Scholar
  24. 24.
    Morel, E., Renvoise, C.: Global optimization by supression of partial redundancies. Communications of the ACM 22(2), 96–103 (1979)zbMATHCrossRefMathSciNetGoogle Scholar
  25. 25.
    Muchnick, S.: Advanced Compiler Design and Implementation. Morgan Kaufmann, San Francisco (1997)Google Scholar
  26. 26.
    Proceedings of the Symposium on Principles of Programming Languages, San Diego, California (January 1998)Google Scholar
  27. 27.
    IBM Research. The Jikes Research Virtual Machine, http://www-124.ibm.com/developerworks/oss/jikesrvm/
  28. 28.
    Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Global value numbers and redundant computations. In: Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 12–27. ACM Press, New York (1988)CrossRefGoogle Scholar
  29. 29.
    Rüthing, O., Steffen, B., Knoop, J.: 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)CrossRefGoogle Scholar
  30. 30.
    Simpson, L.T.: Value-driven redundancy elimination. PhD thesis, Rice University (1996)Google Scholar
  31. 31.
    Steffen, B.: Optimal run-time optimization—proved by a new look at abstract interpretation. In: Ehrig, H., Levi, G., Montanari, U. (eds.) CAAP 1987 and TAPSOFT 1987. LNCS, vol. 249, pp. 52–68. Springer, Heidelberg (1987)Google Scholar
  32. 32.
    Steffen, B., Knoop, J., Rüthing, O.: The value flow graph—a program representation for optimal program transformations. In: Jones, N.D. (ed.) ESOP 1990. LNCS, vol. 432, pp. 389–405. Springer, Heidelberg (1990)Google Scholar
  33. 33.
    Steffen, B., Knoop, J., Rüthing, O.: Efficient code motion and an adaptation to strength reduction. In: Abramsky, S. (ed.) TAPSOFT 1991, CCPSD 1991, and ADC-Talks 1991. LNCS, vol. 494. Springer, Heidelberg (1991)Google Scholar
  34. 34.
    VanDrunen, T., Hosking, A.L.: Anticipation-based partial redundancy elimination for static single assignment form (submitted, 2003)Google Scholar
  35. 35.
    VanDrunen, T., Hosking, A.L.: Corner cases in value-based partial redundancy elimination. Technical Report CSD-TR#03-032, Purdue University Department of Computer Sciences (2003)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Thomas VanDrunen
    • 1
  • Antony L. Hosking
    • 1
  1. 1.Purdue University 

Personalised recommendations