Optimizing Compiler Design for Modularity and Extensibility
- 313 Downloads
Implementing an optimizing compiler for a new target architecture has traditionally been a complex design/development effort requiring a large time scale. Existing machine descriptions and approaches based on pre-existing internal representations (IR) are not sufficient to build truly modular and extensible compilers. This paper describes the features of the Extensible Compiler Interface (ECI) implemented in the PROMIS compiler, which tackles several major problems concerning the reuse of compiler components, retargeting as well as extending existing compilers with new functionality. One of the main design issues is maintaining analysis information calculated by one module after another potentially unknown module modifies the IR. Another problem is expanding existing modules (or passes) to work with processor-specific instructions and data types added by the compiler developers. Our approach to compiler extensibility through the proposed ECI tackles and solves the above problems, and provides a simple yet powerful API for adding arbitrary functionality or entirely new optimizations to existing compilers. A case study is presented in which the components of a parallelizing compiler are reused to build a compiler for a vector architecture, thereby demonstrating the utility and convenience of ECI.
KeywordsStrip Mining Strongly Connect Component Analysis Pass Abstract Syntax Tree Intrinsic Function
Unable to display preview. Download preview PDF.
- A. Appel, J. Davidson, and N. Ramsey. The Zephyr compiler infrastructure, 1998.Google Scholar
- W.E. Cohen. Automatic Construction of Optimizing, Parallelizing Compilers from Specifications. PhD thesis, Purdue University, December 1994.Google Scholar
- CSRD. PROMIS Manual (http://promis.csrd.uiuc.edu/). Urbana, Illinois.
- C. Fraser, R. Henry, and T. Proebsting. BURG — Fast Optimal Instruction Selection and Tree Parsing, April 1992.Google Scholar
- Edison Design Group. http://www.edg.com/.
- L.J. Hendren, C. Donawa, M. Emami, G. R. Gao, Justiani, and B. Sridharan. Designing the McCAT Compiler Based on a Family of Structured Intermediate Representations. In Proceedings of the 5th International Workshop on Languages and Compilers for Parallel Computing, pages 406–420. Springer-Verlag, LNCS 757, 1993.Google Scholar
- G. Holloway and M.D. Smith. An Extender’s Guide to the Optimization Programming Interface and Target Descriptions. Harvard University, 2000.Google Scholar
- S. C. Johnson. Yacc: Yet another compiler compiler. In UNIX Programmer’s Manual, volume 2, pages 353–387. Holt, Rinehart, and Winston, New York, NY, USA, 1979.Google Scholar
- W. Ko. The Promis Universal Machine Descriptor: Concepts, Design, and Implementation. Master’s thesis, University of Illinois, Urbana, Illinois, 2001.Google Scholar
- M. E. Lesk. Lex — A lexical analyzer generator. Technical Report No. 39, AT&T Bell Laboratories, Murray Hill, N.J., 1975.Google Scholar
- H. Saito, N. Stavrakos, Steve Carroll, Constantine Polychronopoulos, and Alex Nicolau. The design of the PROMIS compiler. In Proceedings of the International Conference on Compiler Construction (CC), March 1999. Also available in Lecture Notes in Computer Science No. 1575 (Springer-Verlag) and as CSRD Technical Report No. 1539 (rev.1).Google Scholar
- H. Saito, N. Stavrakos, C. Polychronopoulos, and A. Nicolau. The Design of the PROMIS Compiler — Towards Multi-Level Parallelization. International Journal of Parallel Programming, 28(2), 2000.Google Scholar
- M. Smith. Extending SUIF for Machine-dependent Optimizations. In Proc. First SUIF Compiler Workshop, January 1996.Google Scholar
- M.D. Smith and G. Holloway. An Introduction to Machine SUIF and Its Portable Libraries for Analysis and Optimization. Harvard University, 2000.Google Scholar
- N. Stavrakos, S. Carroll, H. Saito, C. Polychronopoulos, and A. Nicolau. Symbolic analysis in the PROMIS compiler. In Proceedings of the International Workshop on Languages and Compilers for Parallel Computing (LCPC), August 1999. Also available in Lecture Notes in Computer Science (Springer-Verlag). Extended version available as CSRD Technical Report No. 1564.Google Scholar
- D. Whitfield and M.L. Soffa. An approach to ordering optimizing transformations. In Proceedings of ACM SIGPLAN Symposium on Principles and Practices of Parallel Programming (PPoPP), March 1990.Google Scholar
- R. Wilson, R. French, C. Wilson, S. Amarasinghe, J. Anderson, S. Tjiang, S. Liao, C. Tseng, M. Hall, M. Lam, and J. Hennessy. The SUIF compiler system: a parallelizing and optimizing research compiler. Technical Report CSL-TR-94-620, Stanford University, May 1994.Google Scholar