Abstract
Compilers are essential tools to implement application software, coded in high-level programming languages, on programmable processors. Compiler construction has been an established engineering discipline for several decades. This has resulted in the availability of common technologies and tool infrastructure for compiler engineers. However, to cope with ever-increasing computational demands of electronic system applications, processor architectures have evolved drastically since the early days of compiler engineering. This continues to bring new challenges for compiler developers.
Today’s systems-on-chip can contain a significant number of processor cores. Their architectures exhibit higher amounts of parallelism and specialization. An important requirement, driven by new generations of embedded electronic applications, is that processor architectures are tuned for the needs of their application domain, resulting in so-called application-specific processors or ASIPs.
The impact on compilers is multifold. Compilers must be able to exploit the features of highly specialized architectures. For each new architecture, a compiler must become available in very short time. Processor architectures and compilers should be codeveloped so that early compilation of application code can provide feedback to drive architectural decisions.
Retargetable compilers adapt automatically to the architecture of a processor, based on a user-defined processor model. Retargetable compilation received initial attention from compiler researchers in the 1990s, and recently saw renewed interest and adoption as a technology that addresses several of the challenges of today’s and tomorrow’s embedded electronic applications. This chapter discusses concepts, challenges, and solutions in the domain of retargetable compilation. First, retargetable compilation is positioned in a broader historical perspective of compiler technology development. Next, specific requirements for retargetable compilers are formulated, stemming from the wide architectural scope of contemporary application-specific processors. Finally, models, techniques, and optimization algorithms for retargetable compilers are reviewed.
Similar content being viewed by others
References
Aho AV, Sethi R, Ullman JD (1986) Compilers: principles, techniques and tools. Addison-Wesley, Reading
Aho AV, Ganapathi M, Tjiang SWK (1989) Code generation using tree matching and dynamic programming. ACM Trans On Prog Languages and Systems
Aho AV, Lam MS, Sethi R, Ullman JD (2007) Compilers: principles, techniques and tools. Pearson/Addison-Wesley
Allen R, Kennedy D (1987) Automatic transformations of FORTRAN programs to vector form. ACM Trans. on Prog. Languages and Systems
Allen R, Kennedy K (2001) Optimizing compilers for modern architectures. Morgan Kaufmann
Arm, Arm compiler for embedded, https://developer.arm.com/tools-and-software/embedded/arm-compiler
Arm-KEIL, Embedded development tools, https://www.keil.com
Bik AJC, Girkar M, Grey PM, Tian X (2002) Automatic intra-register vectorization for the Intel architecture. Int. J. of Parallel Programming
Briggs P, Cooper KD, Torczon L (1994) Improvements to graph coloring register allocation. ACM Trans Prog Lang and Systems
Brockmeyer E (2010) Design of an ASIP for DFT/FFT. Technical Report, Target Compiler Technologies
Cadence, Tensilica offerings: development toolchain, https://www.cadence.com/en_US/home/tools/ip/tensilica-ip/technologies.html
Cadence, Tensilica controllers and extensible processors, https://www.cadence.com/en_US/home/tools/ip/tensilica-ip/tensilica-xtensa-controllers-and-extensible-processors.html
CEVA (2020) CEVA-ToolBox Software Development Suite, https://www.ceva-dsp.com/wp-content/uploads/2020/11/07_11_20_ToolBox_Product_Note_EN-V2.pdf
Chaitin GJ (1982) Register allocation & spilling via graph coloring. Proc ACM SIGPLAN Symp on Compiler Construction
Chandra J, Menon R, Dagum L, Kohr D, Maydan D, McDonald J (2001) Parallel programming in OpenMP. Morgan Kaufmann Publishers
Codasip, Codasip RISC-V Processors, Product documentation, https://codasip.com/products/codasip-risc-v-processors
Codasip, Codasip Studio, Product documentation, https://codasip.com/products/codasip-studio/
Cytron R, Ferrante J, Rosen BK, Wegman MN, Kenneth Zadeck F (1991) Efficiently computing static single assignment form and the control dependence graph. Trans Programming Languages and Systems
De Micheli G (1994) Synthesis and optimization of digital circuits. McGraw-Hill
Dennis JB (2011) Data flow graphs. In: Padua D (ed) Encyclopedia of parallel computing. Springer
Dobbelaere J (2019) RFC: Full ‘restrict’ support in LLVM, https://lists.llvm.org/pipermail/llvm-dev/2019-March/131127.html
Ebner D, Brandner F, Scholz B, Krall A, Wiedermann P, Kadlec A (2008) Generalized instruction selection using SSA-graphs. Proc. ACM SIGPLAN/SIGBED Conf. on Lang., Compilers and Tools for Embedded Systems
Ellis JR (1986) Bulldog: a compiler for VLIW architectures. The MIT Press
Ertl MA (1999) Optimal code selection in DAGs. Proc. ACM/SIGPLAN-SIGACT Symp. on Principles of Prog. Lang
Fischer CN, LeBlanc RJ (1991) Crafting a compiler with C. Benjamin/Cummings
Fisher JA (1979) The optimization of horizontal microcode within and beyond basic blocks: an application of processor scheduling with resources. Ph.D Thesis, New York Univ
Fraser CW, Hanson DR (1995) A retargetable C compiler: design and implementation. Pearson Education
Fraser CW, Hanson DR (2001) The Lcc 4.x code generation interface. Technical Report, Microsoft Research
Fraser CW, Henry RR, Proebsting TA (1992) BURG – fast optimal instruction selection and tree parsing. ACM SIGPLAN Notices
Free Software Foundation, GCC, the GNU Compiler Collection, https://gcc.gnu.org
Goossens G, Vandewalle J, De Man H (1989) Loop optimization in register-transfer scheduling for DSP-systems. Proc ACM/IEEE Design Autom Conf
Goossens G (2021) Under the Hood of ASIP designer – application-specific processor design made possible by tool automation. Synopsys DesignWare Technical Bulletin Q4/21
Gough BJ (2004) An introduction to GCC: for the GNU compilers GCC and G++. Network Theory
Griffith A (2018) GCC: the complete reference. McGraw-Hill
Grune D, Jacobs CJH (1990) Parsing techniques: a practical guide. Ellis Horwood
IAR Systems, Embedded development, https://www.iar.com/knowledge/learn/programming
International Workshop on Software and Compilers for Embedded Systems (SCOPES), https://scopesconf.org
Kaeli D, Mistry P, Schaa D, Zhang DP (eds) (2012) Heterogeneous computing with OpenCL 2.0. Morgan Kaufmann Publishers
Keith D, Cooper L, Simpson T (1998) Live range splitting in a graph coloring register allocator. Lecture Notes in Computer Science, volume 1383, Springer Verlag
Klabnik S, Nichols C (2018) The Rust programming language. No Starch Press
Lam M (1988) Software pipelining: an effective scheduling technique for VLIW machines. Proc. ACM SIGPLAN Conf. on Prog. Lang. Design and Implementation
Lanneer D, Cornero M, Goossens G, De Man H (1994) Data routing: a paradigm for efficient data-path synthesis and code generation. Proc Int Symposium on High-Level Synthesis
Lattner C, Adve V (2004) LLVM: a compilation framework for lifelong program analysis & transformation. Proc. 2004 Int. Symp. on Code Generation and Optimization (CGO’04), Palo Alto
Lattner C, Amini M, Bondhugula U, Cohen A, Davis A, Pienaar J, Riddle R, Shpeisman T, Vasilache N, Zinenko O (2021) MLIR: Scaling compiler infrastructure for domain specific computation. IEEE/ACM Int. Symp. on Code Generation and Optimization (CGO)
Leupers R, Marwedel P (1998) Retargetable code generation based on structural processor description. Des Autom Embed Syst
Leupers R, Marwedel P (2013) Retargetable compiler technology for embedded systems: tools and applications. Springer
Levine JR (2009) Flex & Bison. O’Reilly
Levine JR, Brown D, Mason T (1992) Lex & Yacc. O’Reilly
Llosa J, González A, Ayguadé E, Valero M (1996) Swing modulo scheduling: a lifetime-sensitive approach. Proc. Conf. on Parallel Architectures and Compilation Techniques
LLVM Project, The LLVM compiler infrastructure, https://llvm.org
LLVM Project, Clang: a C language family frontend for LLVM, https://clang.llvm.org
LLVM Project, Auto-vectorization in LLVM, https://llvm.org/docs/Vectorizers.html
LLVM Project, Writing an LLVM backend, https://llvm.org/docs/WritingAnLLVMBackend.html
Malik AM, Russel T, Chase M, van Beek P (2008) Learning heuristics for basic block instructions scheduling. J of Heuristics, December 2008
Marwedel P, Goossens G (1995) Code generation for embedded processors. Kluwer Academic Publishers
Moons B, De Brabandere B, Van Gool L, Verhelst M (2016) Energy-efficient ConvNets through approximate computing. IEEE Winter Conf. on Applications of Computer Vision
Morgan R (1998) Building an optimizing compiler. Digital Press
Muchnick SS (1997) Advanced compiler design and implementation. Morgan Kaufman, San Francisco
Muthukumar K, Doshi G (2001) Software pipelining of nested loops. Pr Int Conf on Compiler Construction
Nowak L (1987) Graph based retargetable microcode compilation in the MIMOLA design system. Proc 20th Annual Workshop on Microprogramming
NXP Semiconductors, CodeWarrior Embedded Software Development Tools, https://www.nxp.com/design/software/development-software/codewarrior-development-tools:CW_HOME
Parr T (2007) The definitive Antlr reference: building domain-specific languages. Pragmatic Bookshelf
Ragan-Kelley J, Barnes C, Adams A (2013) Halide: a language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines. Proc ACM SIGPLAN Conf on Programming Language Design and Implementation
Rau BR (1994) Iterative modulo scheduling: an algorithm for software pipelining loops. Proc 27th Annual Workshop on Microprogramming
Rau BR, Glaeser CD (1981) Some scheduling techniques and an easily schedulable horizontal architecture for high performance scientific computing. Proc 14th Annual Workshop on Microprogramming
Reinders J, Ashbaugh B, Brodman B, Kinsner M, Pennycook J, Tian X (2021) Data parallel C++: mastering DPC++ for programming of heterogeneous systems using C++ and SYCL. Apress
Sanghavi H, Andrews N (2008) TIE: An ADL for designing application-specific instruction-set extensions. In: Mishra P, Dutt N (eds) Processor Description Languages. Morgan-Kauffman
Scholz B, Eckstein E (2002) Register allocation for irregular architectures. Proc. Conf. on Lang, Compiler and Tools for Embedded Systems/Software and Compilers for Embedded Systems
Stallman RM (1987) GNU C compiler beta test release. Newsgroup comp.lang.c.
Synopsys (2020) Technology Feature: LLVM extended – A C/C++ compiler frontend for application-specific processors. ASIP eUpdate
Synopsys (2022) Technology feature: wide scope of RISC-V ASIP models ready for ASIP accelerator development. ASIP eUpdate
Synopsys, DesignWare ARC MetaWare Development Toolkit, https://www.synopsys.com/metaware
Synopsys, ASIP Designer, https://synopsys.com/dw/ipdir.php?ds=asip-designer
Texas Instruments, Optimizing C/C++ compilers for our programmable embedded processors, https://www.ti.com/design-resources/embedded-development/ccs-development-tools/compilers.html
Van Praet J (1997) Processor modelling and code generation techniques for retargetable compilation. PhD thesis, KU Leuven
Van Praet J, Lanneer D, Geurts W, Goossens G (2001) Processor modelling and code selection for retargetable compilation. ACM Tr. Design Autom. of Electronic Systems
Van Praet J, Lanneer D, Geurts W, Goossens G (2008) nML: a structural processor modelling language for retargetable compilation and ASIP design. In: Mishra P, Dutt N (eds) Processor description languages. Morgan-Kauffman
Wang S, Kanwar P (2019) Bfloat16: the secret to high performance on cloud TPUs. Google Cloud Blog
Waterman A, Asanović K (2019) The RISC-V instruction set manual, volume I: unprivileged ISA. RISC-V Foundation
Waterman A, Asanović K, Hauser J (2021) The RISC-V instruction set manual, volume II: privileged architecture. RISC-V Foundation
Acknowledgments
The authors express their appreciation to the reviewers and to their colleague Sven Wuytack for their constructive feedback on this chapter.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Section Editor information
Rights and permissions
Copyright information
© 2022 Springer Nature Singapore Pte Ltd.
About this entry
Cite this entry
Goossens, G., Lanneer, D., Van Praet, J., Geurts, W. (2022). Retargetable Compilation. In: Chattopadhyay, A. (eds) Handbook of Computer Architecture. Springer, Singapore. https://doi.org/10.1007/978-981-15-6401-7_67-1
Download citation
DOI: https://doi.org/10.1007/978-981-15-6401-7_67-1
Received:
Accepted:
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-15-6401-7
Online ISBN: 978-981-15-6401-7
eBook Packages: Springer Reference EngineeringReference Module Computer Science and Engineering