Abstract
The process of code generation takes the intermediate representation generated by the front-end of the compiler, with or without any optimisation performed by the machine-independent optimisation phase, and generates code for the target machine. Writing a good code generator is not easy. There is too much choice. There will be infinitely many ways of translating a piece of intermediate code to target code and there is no standard way of performing the translation. The translation process can involve many different algorithms, all interacting with each other in seemingly unpredictable ways, and ensuring that the code produced is of sufficiently high quality is something of a challenge.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsReferences
Payne M, Bhandarkar D (1980) VAX floating point: a solid foundation for numerical computation. SIGARCH Comput Archit News 8(4):22–33
Lindholm T, Yellin F (1997) The Java virtual machine specification. The Java series, Addison-Wesley, Reading
Appel AW (2004) Modern compiler implementation in C. Cambridge University Press, Cambridge
Aho AV, Lam MS, Sethi R, Ullman JD (2007) Compilers – principles, techniques and tools, 2nd edn. Pearson Education, Upper Saddle River
Muchnick SS (1997) Advanced compiler design and implementation. Morgan Kaufmann Publishers, San Francisco
Cooper KD, Torczon L (2011) Engineering a compiler, 2nd edn. Morgan Kaufmann, San Francisco
Mittal S, Vetter JS (2015) A survey of CPU-GPU heterogeneous computing techniques. ACM Comput Surv 47(4):69:1–69:35
McKeeman WM (1965) Peephole optimization. Commun ACM 8(7):443–444
Davidson JW, Fraser CW (1984) Automatic generation of peephole optimizations. In: Proceedings of the ACM SIGPLAN ’84 symposium on compiler construction, Montreal, Canada, pp 111–116. Published as ACM SIGPLAN Notices 19:6
Davidson JW, Fraser CW (1980) The design and application of a retargetable peephole optimizer. ACM Trans Program Lang Syst 2(2):191–202
Tanenbaum AS, van Staveren H, Stevenson JW (1982) Using peephole optimization on intermediate code. ACM Trans Program Lang Syst 4(1):21–36
Massalin H (1987) Superoptimizer – A look at the smallest program. In: Proceedings of the second international conference on architectural support for programming languages and operating systems (ASPLOS-II), Palo Alto, California, pp 122–126. Published as ACM SIGPLAN Notices 22:10
Glanville RS, Graham SL (1978) A new method for compiler code generation. In: Proceedings of the 5th annual symposium on principles of programming languages, pp 231–240
Ganapathi M, Fischer CN (1982) Description-driven code generation using attribute grammars. In: Proceedings of the 9th annual symposium on principles of programming languages, Albuquerque, NM, pp 108–119
Ganapathi M, Fischer CN (1984) Attributed linear intermediate representations for retargetable code generators. Softw Pract Exp 14(4):347–364
Ganapathi M, Fischer CN (1985) Affix grammar driven code generation. ACM Trans Program Lang Syst 7(4):560–599
Aho AV, Ganapathi M, Tjiang SWK (1989) Code generation using tree matching and dynamic programming. ACM Trans Program Lang Syst 11(4):491–516
Pelegri-Llopart E, Graham SL (1988) Optimal code generation for expression trees: an application of BURS theory. In: Proceedings of the 15th annual symposium on principles of programming languages, pp 294–308
Fraser CW, Henry RR, Proebsting TA (1992) BURG – fast optimal instruction selection and tree parsing. ACM SIGPLAN Not 27(4):68–76
Blindell GH (2016) Instruction selection: principles, methods, and applications. Springer, Switzerland
Chaitin GJ (1982) Register allocation and spilling via graph coloring. In: Proceedings of the ACM SIGPLAN ’82 symposium on compiler construction, Boston, Mass, pp 98–105. Published as ACM SIGPLAN Notices 17:6
Chow FC, Hennessy JL (1990) The priority-based coloring approach to register allocation. ACM Trans Program Lang Syst 12(4):501–536
Mogensen TÆ (2011) Introduction to compiler design. Undergraduate topics in computer science. Springer, Berlin
Naur P (1963) Revised report on the algorithmic language ALGOL 60. Commun ACM 6(1):1–17
Sethi R (1989) Programming languages – concepts and constructs. Addison-Wesley Publishing Company, Reading
Free Software Foundation (2016) GCC, the GNU compiler collection. https://gcc.gnu.org/
Davidson JW, Fraser CW (1984) Register allocation and exhaustive peephole optimization. Softw Pract Exp 14(9):857–865
Granlund T, Kenner R (1992) Eliminating branches using a superoptimizer and the GNU C compiler. In: Proceedings of the ACM SIGPLAN ’92 conference on programming language design and implementation. San Francisco, California, pp 341–352, June 1992
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this chapter
Cite this chapter
Watson, D. (2017). Code Generation. In: A Practical Approach to Compiler Construction. Undergraduate Topics in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-319-52789-5_8
Download citation
DOI: https://doi.org/10.1007/978-3-319-52789-5_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-52787-1
Online ISBN: 978-3-319-52789-5
eBook Packages: Computer ScienceComputer Science (R0)