skip to main content
article
Free Access

Using static single assignment form in a code optimizer

Published:01 June 1992Publication History
Skip Abstract Section

Abstract

Static single assignment form represents data dependences elegantly and provides a basis for powerful optimizations. Table-driven techniques for peephole optimization and code generation are straightforward and effective. it is natural to want to use both together in a code optimizer. However, doing so reveals that static single assignment form does not remove all antidependences, and that it conflicts with table-driven code generation for 2-address machines. This paper describes these problems and how to solve them.

References

  1. 1 AHO, A. V., GANAPATHI, M., AND TJIANG, S. W.K. Code generation using tree matching and dynamic programming. ACM Trans. Program. Lang. Syst. 11, 4 (1989), 491-516. Google ScholarGoogle Scholar
  2. 2 ALPERN, B., WEGMAN, M. N., AND ZADECK, F.K. Detecting equality of variables in programs. In Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages (1988), ACM, New York, 1-11. Google ScholarGoogle Scholar
  3. 3 CHAITIN, G. J., AUSLANDER, M. A., CHANDRA, A. K., COCKE, J., HOPKINS, M. E., AND MARKSTEIN, P.W. Register allocation via coloring. Comput. Lang. 6, 1 (1981), 47-57.Google ScholarGoogle Scholar
  4. 4 CHOI, J., CYTRON, R., AND FERRANTE, J. Automatic construction of sparse data flow evaluation graphs, in Conference Record of the Seventeenth Annual ACM Symposium on Principles of Programming Languages (1991), ACM, New York. Google ScholarGoogle Scholar
  5. 5 CYTRON, R., FERRANTE, J., ROSEN, B., WEGMAN, M., AND ZADECK, K. Efficiently computing static single assignment form and the control dependence graph. ACM Trans. Program. Lang. Syst. 13, 4 (1991), 451-490. Google ScholarGoogle Scholar
  6. 6 CYTRON, R., LOWRY, A., AND ZADECK, K. Code motion of control structures in high-level languages. In Conference Record of the Thirteenth Annual ACM Symposium on Principles of Programming Languages (1986), 70-85. Google ScholarGoogle Scholar
  7. 7 DAVIDSON, J.W. Simplifying code generation through peephole optimizations. Ph.D. dissertation, Dept. of Computer Science, Univ. of Arizona, 1981. Google ScholarGoogle Scholar
  8. 8 DAVIDSON, J. W., AND FRASER, C.W. Code selection through object code optimization. ACM Trans. Program. Lang. Syst. 6 4 (1984), 505-526. Google ScholarGoogle Scholar
  9. 9 DAVIDSON, J. W., AND FRASER, C.W. The design and application of a retargetable peephole optimizer. ACM Trans. Program. Lang. Syst. 2 2 (1980), 191-202. Google ScholarGoogle Scholar
  10. 10 GANAPATHI, M., AND FISCHER, C.N. Integrating code generation and peephole optimization. Acta Inf. 25 (1988), 85-109. Google ScholarGoogle Scholar
  11. 11 GANAPATHI, M., FISCHER, C. N., AND HENNESSY, J.a. Retargetable compiler code generation. ACM Comput. Surv. 14, 4 (1982), 573-592. Google ScholarGoogle Scholar
  12. 12 GLANVILLE, R. S., AND GRAHAM, S. L. A new method for compiler code generation. In Conference Record of the Fifth Annual ACM Symposium on Principles of Programming Languages (1978), ACM, New York, 509-514. Google ScholarGoogle Scholar
  13. 13 GRAHAM, S.L. Table-driven code generation. IEEE Comput. 13, 8 (1980), 25-34.Google ScholarGoogle Scholar
  14. 14 GRAHAM, S. L., HENRY, R. R., AND SCHULMAN, R. A. An experiment in table-driven code generation. In Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, SIGPLAN Not. 17, 16 (1982), 32-43. Google ScholarGoogle Scholar
  15. 15 HEBEL, K.J. An environment for the development of digital signal processing software. Ph.D. dissertation, Dept. of Electrical Engineering, Univ. of Illinois at Urbana-Champaign, 1989. Google ScholarGoogle Scholar
  16. 16 JOHNSON, R. E., GRAVER, J. O., AND ZURAWSKI, L. W. TS: An optimizing compiler for Smalltalk. In Proceedings of OOPSLA "88, Object-Oriented Programming Systems, Languages and Applications, SIGPLAN Not. 23, 11 (1988), 18-26. Google ScholarGoogle Scholar
  17. 17 JOHNSON, R. E., MCCONNELL, C., AND LAKE, J.M. The RTL system: A framework for code optimization. Tech. Rep. UIUCDCS-R-9-1698, Dept. of Computer Science, Univ. of Illinois at Urbana-Champaign, 1991.Google ScholarGoogle Scholar
  18. 18 KUCK, D.J. The Structure of Computers and Computations. Wiley, New York, 1978. Google ScholarGoogle Scholar
  19. 19 PADUA, D. A., AND WOLFE, M J. Advanced compiler optimizations for supercomputers. Commun. ACM 29, 12 (1986), 1184-1201. Google ScholarGoogle Scholar
  20. 20 ROSEN, B. K., WEGMAN, M. N., AND ZADECK, F. K. Global value numbers and redundant computations. In Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages (1988), ACM, New York, 12-27. Google ScholarGoogle Scholar
  21. 21 WEGMAN, M. N., AND ZADECK, F.K. Constant propagation with conditional branches. ACM Trans. Program. Lang. Syst. 13, 2 (1991), 181-210. Google ScholarGoogle Scholar

Index Terms

  1. Using static single assignment form in a code optimizer

    Recommendations

    Reviews

    Pani N. Chakrapani

    Static single assignment (SSA) form is an alternative representation for any program. It enables one to view the data dependencies, thus providing an opportunity for power ful optimizations. Since this form does not allow multiple assignments to the same variable, however, all assignments have to be three-address, conflicting with table-driven techniques for code generation that use two-address templates. The SSA form also does not completely eliminate all antidependencies. This paper presents the strategies adopted by the authors in successfully bringing together the SSA form and table-driven code generation in a code optimizer in the register transfer language (RTL) S ystem. Following a description of how the SSA form is being used at the intermediate code level, the authors present the strategies of handling three kinds of data dependencies, namely flow dependency, antidependency, and output dependency. The handling of the conflict between instruction recognition and SSA form is considered in the next section of the paper with specific examples. This paper on successful construction of a working code optimizer using SSA form is well written and will be useful to anyone working on compiler design.

    Access critical reviews of Computing literature here

    Become a reviewer for Computing Reviews.

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!