Finding Dominators in Practice

  • Loukas Georgiadis
  • Renato F. Werneck
  • Robert E. Tarjan
  • Spyridon Triantafyllis
  • David I. August
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3221)

Abstract

The computation of dominators in a flowgraph has applications in program optimization, circuit testing, and other areas. Lengauer and Tarjan [17] proposed two versions of a fast algorithm for finding dominators and compared them experimentally with an iterative bit vector algorithm. They concluded that both versions of their algorithm were much faster than the bit-vector algorithm even on graphs of moderate size. Recently Cooper et al. [9] have proposed a new, simple, tree-based iterative algorithm. Their experiments suggested that it was faster than the simple version of the Lengauer-Tarjan algorithm on graphs representing computer program control flow. Motivated by the work of Cooper et al., we present an experimental study comparing their algorithm (and some variants) with careful implementations of both versions of the Lengauer-Tarjan algorithm and with a new hybrid algorithm. Our results suggest that, although the performance of all the algorithms is similar, the most consistently fast are the simple Lengauer-Tarjan algorithm and the hybrid algorithm, and their advantage increases as the graph gets bigger or more complicated.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    The IMPACT compiler, http://www.crhc.uiuc.edu/IMPACT
  2. 2.
    The Standard Performance Evaluation Corp., http://www.spec.org/
  3. 3.
    Aho, V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)Google Scholar
  4. 4.
    Aho, V., Ullman, J.D.: Principles of Compilers Design. Addison-Wesley, Reading (1977)Google Scholar
  5. 5.
    Allen, F.E., Cocke, J.: Graph theoretic constructs for program control flow analysis. Technical Report IBM Res. Rep. RC 3923, IBM T.J. Watson Research Center (1972)Google Scholar
  6. 6.
    Alstrup, S., Harel, D., Lauridsen, P.W., Thorup, M.: Dominators in linear time. SIAM Journal on Computing 28(6), 2117–2132 (1999)MATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Amyeen, M.E., Fuchs, W.K., Pomeranz, I., Boppana, V.: Fault equivalence identification using redundancy information and static and dynamic extraction. In: Proceedings of the 19th IEEE VLSI Test Symposium (March 2001)Google Scholar
  8. 8.
    Buchsbaum, L., Kaplan, H., Rogers, A., Westbrook, J.R.: A new, simpler linear-time dominators algorithm. ACM Transactions on Programming Languages and Systems 20(6), 1265–1296 (1998) Corrigendum to appearGoogle Scholar
  9. 9.
    Cooper, K.D., Harvey, T.J., Kennedy, K.: A simple, fast dominance algorithm. Available online at http://www.cs.rice.edu/~keith/EMBED/dom.pdf
  10. 10.
    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 (1991)CrossRefGoogle Scholar
  11. 11.
    Gabow, H.N.: Data structures for weighted matching and nearest common ancestors with linking. In: Proceedings of the first annual ACM-SIAM symposium on Discrete algorithms, pp. 434–443 (1990)Google Scholar
  12. 12.
    Georgiadis, L., Tarjan, R.E.: Finding dominators revisited. In: Proc. 15th ACM-SIAM Symp. on Discrete Algorithms, pp. 862–871 (2004)Google Scholar
  13. 13.
    Hecht, M.S., Ullman, J.D.: Characterizations of reducible flow graphs. Journal of the ACM 21(3), 367–375 (1974)MATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    Holloway, G., Young, C.: The flow analysis and transformation libraries of Machine SUIF. In: Proceedings of the 2nd SUIF Compiler Workshop (1997)Google Scholar
  15. 15.
    Kam, J.B., Ullman, J.D.: Global data flow analysis and iterative algorithms. Journal of the ACM 23, 158–171 (1976)MATHCrossRefMathSciNetGoogle Scholar
  16. 16.
    Knuth, D.E.: An empirical study of FORTRAN programs. Software Practice and Experience 1, 105–133 (1971)MATHCrossRefGoogle Scholar
  17. 17.
    Lengauer, T., Tarjan, R.E.: A fast algorithm for finding dominators in a flowgraph. ACM Transactions on Programming Languages and Systems 1(1), 121–141 (1979)MATHCrossRefGoogle Scholar
  18. 18.
    Purdom Jr., P.W., Moore, E.F.: Algorithm 430: Immediate predominators in a directed graph. Communications of the ACM 15(8), 777–778 (1972)CrossRefGoogle Scholar
  19. 19.
    Ramalingam, G., Reps, T.: An incremental algorithm for maintaining the dominator tree of a reducible flowgraph. In: Proceedings of the 21st ACM SIGPLANSIGACT symposium on Principles of programming languages, pp. 287–296 (1994)Google Scholar
  20. 20.
    Sharir, M.: Structural analysis: A new approach to flow analysis in optimizing compilers, vol. 5, pp. 141–153 (1980)Google Scholar
  21. 21.
    Sleator, D.D., Tarjan, R.E.: A data structure for dynamic trees. Journal of Computer and System Sciences 26, 362–391 (1983)MATHCrossRefMathSciNetGoogle Scholar
  22. 22.
    Sweany, P.H., Beaty, S.J.: Dominator-path scheduling: A global scheduling method. In: Proceedings of the 25th International Symposium on Microarchitecture, pp. 260–263 (1992)Google Scholar
  23. 23.
    Tarjan, R.E.: Finding dominators in directed graphs. SIAM Journal on Computing 3(1), 62–89 (1974)MATHCrossRefMathSciNetGoogle Scholar
  24. 24.
    Tarjan, R.E.: Applications of path compression on balanced trees. Journal of the ACM 26(4), 690–715 (1979)MATHCrossRefMathSciNetGoogle Scholar
  25. 25.
    Tarjan, R.E., van Leeuwen, J.: Worst-case analysis of set union algorithms. Journal of the ACM 31(2), 245–281 (1984)MATHCrossRefGoogle Scholar
  26. 26.
    The CAD Benchmarking Lab, North Carolina State University. ISCAS 1989 benchmark information, http://www.cbl.ncsu.edu/www/CBL_Docs/iscas89.html

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Loukas Georgiadis
    • 1
  • Renato F. Werneck
    • 1
  • Robert E. Tarjan
    • 1
    • 2
  • Spyridon Triantafyllis
    • 1
  • David I. August
    • 1
  1. 1.Dept. of Computer SciencePrinceton UniversityPrincetonUSA
  2. 2.Hewlett-PackardPalo Alto

Personalised recommendations