The advantages of machine-dependent global optimization

  • Manuel E. Benitez
  • Jack W. Davidson
Session Papers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 782)


Using an intermediate language is a well-known, effective technique for constructing interpreters and compilers. This paper describes a retargetable, optimizing compilation system centered around the use of two intermediate languages (IL): one relatively high level, the other a low level corresponding to target machine instructions. The high-level IL (HIL) models a stack-based, hypothetical RISC machine. The low-level IL (LIL) models target machines at the instruction-set architecture level. All code improvements are applied to the LIL representation of a program. This is motivated by the observation that most optimizations are machine dependent, and the few that are truly machine independent interact with the machine-dependent ones. This paper describes several ‘machine-independent’ code improvements and shows that they are actually machine dependent. To illustrate how code improvements can be applied to a LIL, an algorithm for induction variable elimination is presented. It is demonstrated that this algorithm yields better code than traditional implementations that are applied machine-independently to a high-level representation.


Constant Propagation Basic Block Induction Expression Machine Instruction Abstract Machine 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aho, A. V., Sethi, R., and Ullman, J. D., Compilers Principles, Techniques and Tools, Addison-Wesley, Reading, MA, 1986.Google Scholar
  2. 2.
    Benitez, M. E., and Davidson, J. W., “Code Generation for Streaming: an Access/ Execute Mechanism”, Proceedings of the Fourth International Symposium on Architectural Support for Programming Languages and Operating Systems, Santa Clara, CA, April 1991, pp. 132–141.Google Scholar
  3. 3.
    Chow, F. C, A Portable Machine-Independent Global Optimizer—Design and Measurements, Ph.D. Dissertation, Stanford University, 1983.Google Scholar
  4. 4.
    Cytron, R., Ferrante, J., Rosen, B. K., Wegman, M. N., and Zadeck, F. K., “Efficiently Computing Static Single Assignment Form and the Control Dependence Graph”, ACM Transactions on Programming Languages and Systems, 13(4), October 1991, pp. 451–490.Google Scholar
  5. 5.
    Davidson, J. W. and Fraser, C. W., “Register Allocation and Exhaustive Peephole Optimization”, Software-Practice and Experience, 14(9), September 1984, pp. 857–866.Google Scholar
  6. 6.
    Davidson, J. W. and Fraser, C. W., “Code Selection Through Peephole Optimization”, Transactions on Programming Languages and Systems, 6(4), October 1984, pp. 7–32.Google Scholar
  7. 7.
    Davidson, J. W., “A Retargetable Instruction Reorganizer”,Proceedings of the '86 Symposium on Compiler Construction, Palo Alto, CA, June 1986, pp. 234–241.Google Scholar
  8. 8.
    Davidson, J. W. and Gresh, J. V., “Cint: A RISC Interpreter for the C Programming Language”, Proceedings of the ACM SIGPLAN '87 Symposium on Interpreters and Interpretive Techniques, St. Paul, MN, June 1987, pp. 189–198.Google Scholar
  9. 9.
    Davidson, J. W. and Whalley, D. B., “A Design Environment for Addressing Architecture and Compiler Interactions”, Microprocessors and Microsystems, 15(9), November 1991, pp. 459–472.Google Scholar
  10. 10.
    Joy, William N. and McKusick, M. Kirk, “Berkeley Pascal PX Implementation Notes Version 2.0-January, 1979”, Department of Engineering and Computer Science, University of California, Berkeley, January 1979.Google Scholar
  11. 11.
    McFarling, S., “Procedure Merging with Instruction Caches”, Proceedings of the ACM SIGPLAN '91 Symposium on Programming Language Design and Implementation, Toronto, Ontario, June 1991, pp. 71–79.Google Scholar
  12. 12.
    Nelson, P. A., “A Comparison of PASCAL Intermediate Languages”, Proceedings of the SIGPLAN Symposium on Compiler Construction, Denver, CO, August 1979, pp. 208–213.Google Scholar
  13. 13.
    Newey, M. C., Poole, P. C., and Waite, W. M., “Abstract Machine Modelling to Produce Portable Software—A Review and Evaluation”, Software-Practice and Experience, 2, 1972, pp. 107–136.Google Scholar
  14. 14.
    Powell, M. L., “A Portable Optimizing Compiler for Modula-2”, Proceedings of the SIGPLAN '84 Symposium on Compiler Construction, Montreal, Canada, June 1984, pp. 310–318.Google Scholar
  15. 15.
    Richards, M., “The Portability of the BCPL Compiler”, Software-Practice and Experience, 1(2), April 1971, pp. 135–146.Google Scholar
  16. 16.
    Systems Performance Evaluation Cooperative, Waterside Associates, Fremont, CA, 1989.Google Scholar
  17. 17.
    Tanenbaum, A. S., Staveren, H. V., and Stevenson, J. W., “Using Peephole Optimization on Intermediate Code”, Transactions on Programming Languages and Systems, 4(1), January 1982, pp. 21–36.Google Scholar
  18. 18.
    Tanenbaum, A. S., Staveren, H. V., Keizer, E. G., and Stevenson, J. W., “A Practical Tool Kit for Making Portable Compilers”, Communications of the ACM, 26(9), September 1983, pp. 654–660.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Manuel E. Benitez
    • 1
  • Jack W. Davidson
    • 1
  1. 1.Department of Computer ScienceUniversity of VirginiaCharlottesvilleUSA

Personalised recommendations