skip to main content
10.1145/207110.207121acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article
Free Access

Simple and effective link-time optimization of Modula-3 programs

Published:01 June 1995Publication History

ABSTRACT

Modula-3 supports development of modular programs by separating an object's interface from its implementation. This separation induces a runtime overhead in the implementation of objects, because it prevents the compiler from having complete information about a program's type hierarchy. This overhead can be reduced at link time, when the entire type hierarchy becomes available. We describe opportunities for link-time optimization of Modula-3, present two link-time optimizations that reduce the runtime costs of Modula-3's opaque types and methods, and show how link-time optimization could provide C++ which the benefits of opaques types at no additional runtime cost.

Our optimization techniques are implemented in mld, a retargetable linker for the MIPS, SPARC, and Intel 486, mld links a machine-independent intermediate code that is suitable for link-time optimization and code generation. Linking intermediate code simplifies implementation of the optimizations and makes it possible to evaluate them on a wide range of architectures. mld's optimizations are effective: they reduce the total number of instructions executed by up to 14% and convert as many as 79% of indirect calls to direct calls.

References

  1. 1.E. Adams. The old man and the C. In Proceedzngs of the Summer USEN{X Conference, pages 15-26, 1984.]] Google ScholarGoogle Scholar
  2. 2.A. Aho, R. Sethi, and J. Ullman. Compilers- Prznczples, Technzques and Tools. Addison Wesley, 1986.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.T. Ball and J. R. Larus, Optimally profiling and tracing programs. In Conference Record of the A CM Symposium on Principles of Programming Languages, pages 59-70, Albuquerque, NM, Jan. 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.G. Baumgartner and V. Russo. Implementing signatures for C++ In Proceedings of the USENL~ C++ Conference, pages 37-56, April 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.M. E. Benitez and J. W. Davidson. A portable global optimizer and linker. Proceedzngs of the SICPLAN'83 Conference on Programming Language Design and Impleme~tatzon, SIGPLAN Notices, 23(7):329-338, July 1988.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.B. Calder and D. Grunwald. Reducing indirect function call overhead in C++ programs. In ACM Symposium on Principles of Programming Languages, pages 397-408, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.B. Calder, D. Grunwald, and B. Zorn. Quantifying behavioral differences between C and C++ programs. Journal of Programming Languages, 2(4), ~994.]]Google ScholarGoogle Scholar
  8. 8.C. Chambers. The Cecil language Specification and rationale. Technical Report CSE-TR-93-03-05, University of Washington, 1993.]]Google ScholarGoogle Scholar
  9. 9.C. Chambers and D Ungar. Making pure objectoriented languages practical. In OOPSLA Conference Proceedings, pages 1-15, 1991. Published as SIGPLAN Notices, 26(}1), 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.C. S. Collberg. Flexible Encapsulation. PhD thesis, Lurid University, Sweden, 1992.]]Google ScholarGoogle Scholar
  11. 11.J. Dean, C. Chambers, and D. Grove. Selective specialization for object-oriented languages. In SIGPLAN Conference on Programming Language Design and Implementation, 1995. To appear.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.D. Detlefs. Garbage collection and run-time typing as a C++ library. In Proceedings of the USENIX C++ Conference, pages 37-56, August. 1992.]]Google ScholarGoogle Scholar
  13. 13.M. Fern~tndez. Simple and effective link-time optimization of Modula-3 programs. Technical Report TR-474- 94, Department of Computer Science, Princeton University, Nov. 1994.]]Google ScholarGoogle Scholar
  14. 14.C. W. Fraser and D. R. Hanson. A Retargetable C Compiler: Design and Implementation. Benjamin/Cummings, Redwood City, CA, 1995. ISBN 0-8053-1670-1.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15.C. W. Fraser, D. R. Hanson, and T. A. Proebsting. Engineering a simple, efficient code-generator generator. A UM Letters on Programm~r,g Languages and Systems, 1(3):213-226, Sept. 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16.C. W. Fraser and R. R. Henry. Hard-coding bottomup code generation tables to save time and space. Software--Practice and Experience, 21(t):1-t2, Jan. 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17.C. W. Fraser, R. R. Henry, and T. A. Proebsting. BURG--Fast optimM instruction selection ~nd tree parsing. SIGPLAN Notices, 27(4):68-76, Apr. 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18.M. I. Himelstein, F. C. Chow, and K. Enderby. Crossmodule optimizations: Its implementation and benefits. In Proceedings of the Summer USENIX Technzcal Cor~ferer~ce, pages 347-356, Phoenix, AZ, June 1987.]]Google ScholarGoogle Scholar
  19. 19.U. ttolzle. Adaptive optimization for Self: Reconciling H~gh Performance w~th Exploratory Programming. PhD thesis, Stanford University, August 1994.]]Google ScholarGoogle Scholar
  20. 20.U. Holzle. Optimizing dynamicMly-dispatched calls with run-time type feedback, tn SIGPLAN Conference on Programming Language Design and Implernerta&on, pages 326-335, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 21.B. Kalsow and E. Muller. SRC Modula-3 Version 2. I1. Digital Equipment Corporation Systems Research Center, January 1992.]]Google ScholarGoogle Scholar
  22. 22.D. Lea. Customization in C++ In Proceedings of the]]Google ScholarGoogle Scholar
  23. 23.D. Lea. Panel discussion: Run time type information and class design. In Proceedings of the U,_qEN{X C++ Conference, pages 341-347, August 1992.]]Google ScholarGoogle Scholar
  24. 24.M. Linton and D. Pan. Interface translation and implementation filtering. In Proceedings of the lrSENLY C++ Conference, pages 227-236, April 1994.]]Google ScholarGoogle Scholar
  25. 25.S. McFarling. Procedure merging with instruction caches. In SIGPLAN Conference on Programming Language Deszgn and Implementa&on, pages 71-79, Toronto, Ontario, Canada, June 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 26.L. N ackman and J. Barton. Base-class composition with multiple derivation and virtual bases. In Proceedings of the USENIX C++ Conference, pages 57-71, April 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. 27.G. Nelson, editor. Systems Programmzng wzth Modula- 3. Prentice Hall, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. 28.E. Pelegri-Llopart and S. L. Graham. Optimal code generation for expression trees: An application of BURS theory. In Conference Record of the A UAI Symposium or~ Pmnczples of Programmzng La~guc, ges, pages 294-308, San Diego, CA, Jan. 1988.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 29.K. Pettis and R. Hansen. Profile guided code positioning. In SIGPLAN Conference on Programming Language Design and {mplementa&on, 1990. Also in SIG- PLAN Notices, \%1. 25, No. 6, June, 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. 30.N. Ramsey and M. F. FernXndez. The New Jersey machine-code toolkit. In Proceedings of the I'V~nter 1995 USENL~ Conference, pages 289-30'2, New Orleans, LA, Jan. 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. 31.R L. Sites, editor. Alpha Architecture Reference Manual. Digital Press, 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. 32.A. Srivastava and D. W. Wall. A practical system for intermodule code optimization at link-time. Journal of Programm,ng Languages, pages 1-18, March 1993.]]Google ScholarGoogle Scholar
  33. 33.A. Srivastava and D. W. Wall. Link-time optimization of address calculation on a 64-bit architecture. In SIG- PLAN Conference on Programming Language Design and {mplementatlon, pages 49-60, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. 34.J. W. Stamos. Static grouping of small objects to enhance performance of a paged virtual memory. A CM Transactions on Computer Systems, 2(2), t984.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. 35.B. Stroustrup. The C++ Programming Language. Addison Wesley, second edition, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. 36.B. Stroustrup and D. Lenkov. Run time type identification in C++. In Proceedings of the USENIX C++ Conference, pages 313-340, August 1992.]]Google ScholarGoogle Scholar
  37. 37.D. Ungar and R. B. Smith. SELF: The power of simplicity. OOPSLA '87 Conference Proceedzngs, SIG- PLAN Notices, 22(12):'2'27-241, Dec. 1987.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. 38.D. W. Wall. Experience with a software-defined machine architecture. A CM Transactzons on Programruing Languages and Systems, t4(3):299-338, 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Simple and effective link-time optimization of Modula-3 programs

        Recommendations

        Comments

        Login options

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

        Sign in
        • Published in

          cover image ACM Conferences
          PLDI '95: Proceedings of the ACM SIGPLAN 1995 conference on Programming language design and implementation
          June 1995
          335 pages
          ISBN:0897916972
          DOI:10.1145/207110

          Copyright © 1995 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 June 1995

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          PLDI '95 Paper Acceptance Rate28of105submissions,27%Overall Acceptance Rate406of2,067submissions,20%

          Upcoming Conference

          PLDI '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader