Abstract
Agile hardware design is gaining increasing momentum and bringing new chips in larger quantities to the market faster. However, it also takes new challenges for compiler developers to retarget existing compilers to these new chips in shorter time than ever before. Currently, retargeting a compiler backend, e.g., an LLVM backend to a new target, requires compiler developers to write manually a set of target description files (totalling 10 300+ lines of code (LOC) for RISC-V in LLVM), which is error-prone and time-consuming. In this paper, we introduce a new approach, Automatic Target Description File Generation (ATG), which accelerates the generation of a compiler backend for a new target by generating its target description files automatically. Given a new target, ATG proceeds in two stages. First, ATG synthesizes a small list of target-specific properties and a list of code-layout templates from the target description files of a set of existing targets with similar instruction set architectures (ISAs). Second, ATG requests compiler developers to fill in the information for each instruction in the new target in tabular form according to the list of target-specific properties synthesized and then generates its target description files automatically according to the list of code-layout templates synthesized. The first stage can often be reused by different new targets sharing similar ISAs. We evaluate ATG using nine RISC-V instruction sets drawn from a total of 1 029 instructions in LLVM 12.0. ATG enables compiler developers to generate compiler backends for these ISAs that emit the same assembly code as the existing compiler backends for RISC-V but with significantly less development effort (by specifying each instruction in terms of up to 61 target-specific properties only).
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Bao Y G, Carlson T E. Agile and open-source hardware. IEEE Micro, 2020, 40(4): 6–9. DOI: https://doi.org/10.1109/MM.2020.3002606.
Bahr R, Barrett C, Bhagdikar N, Carsello A, Daly R, Donovick C, Durst D, Fatahalian K, Feng K, Hanrahan P, Hofstee T, Horowitz M, Huff D, Kjolstad F, Kong T, Liu Q Y, Mann M, Melchert J, Nayak A, Niemetz A, Nyengele G, Raina P, Richardson S, Setaluri R, Setter J, Sreedhar K, Strange M, Thomas J, Torng C, Truong L, Tsiskaridze N, Zhang K Y. Creating an agile hardware design flow. In Proc. the 57th ACM/IEEE Design Automation Conference, July 2020, Article No. 142. DOI: 10.1109/DAC18072.2020.9218553.
Fuchs A, Wentzlaff D. The accelerator wall: Limits of chip specialization. In Proc. the 2019 IEEE International Symposium on High Performance Computer Architecture (HPCA), Feb. 2019. DOI: https://doi.org/10.1109/HPCA.2019.00023.
Collberg C S. Automatic derivation of compiler machine descriptions. ACM Trans. Programming Languages and Systems, 2002, 24(4): 369–408. DOI: https://doi.org/10.1145/567097.567100.
Lopes B C, Auler R. Getting Started with LLVM Core Libraries. Packt Publishing Ltd, 2014.
Leroy X. Formally verifying a compiler: Why? How? How far? In Proc. the 9th International Symposium on Code Generation and Optimization, Apr. 2011. DOI: 10.1109/CGO.2011.5764668.
Aho A V, Sethi R, Ullman J D. Compilers: Principles, Techniques, and Tools. Addison-Wesley Longman Publishing Co., Inc., 1986.
Goldberg Y, Levy O. word2vec Explained: Deriving Mikolov et al.’s negative-sampling word-embedding method. arXiv: 1402.3722, 2014. https://arxiv.org/abs/1402.3722, Nov. 2023.
Arora S, Liang Y Y, Ma T Y. A simple but tough-to-beat baseline for sentence embeddings. In Proc. the 5th International Conference on Learning Representations, Apr. 2017.
Simos T E, Famelis I T. A neural network training algorithm for singular perturbation boundary value problems. Neural Computing and Applications, 2022, 34(1): 607–615. DOI: https://doi.org/10.1007/s00521-021-06364-1.
Vural N M, Ergüt S, Kozat S S. An efficient and effective second-order training algorithm for LSTM-based adaptive learning. IEEE Trans. Signal Processing, 2021, 69: 2541–2554. DOI: https://doi.org/10.1109/TSP.2021.3071566.
Haidl M, Moll S, Klein L, Sun H H, Hack S, Gorlatch S. PACXXv2 + RV: An LLVM-based portable high-performance programming model. In Proc. the 4th Workshop on the LLVM Compiler Infrastructure in HPC, Nov. 2017, Article No. 7. DOI: https://doi.org/10.1145/3148173.3148185.
Barchi F, Urgese G, Macii E, Acquaviva A. Code mapping in heterogeneous platforms using deep learning and LLVM-IR. In Proc. the 56th ACM/IEEE Design Automation Conference (DAC), Jun. 2019, Article No. 170. DOI: https://doi.org/10.1145/3316781.3317789.
Davidson J W, Fraser C W. The design and application of a retargetable peephole optimizer. ACM Trans. Programming Languages and Systems, 1980, 2(2): 191–202. DOI: https://doi.org/10.1145/357094.357098.
Lattner C. The golden age of compiler design in an era of HW/SW co-design. Technical Report, 2021. https://asplos-conference.org/asplos2021/index.html%3Fp=2355.html, November 2023.
Lattner C, Tatiana S. MLIR: Multi-level intermediate representation compiler infrastructure. Technical Report, 2020. https://cgo-conference.github.io/cgo2020/keynotes, November 2023.
Cai B M, Ashwathnarayan S, Shafiq F, Eltantawy A, Azimi R, Gao Y Q. Exploring agile hardware/software co-design methodology. Technical Report, 2020. https://jnamaral.github.io/SSHAW/program.html, November 2023.
Graf A. Compiler backend generation using the VADL processor description language [Ph.D. Thesis]. Technische Universität Wien, Wien, 2021.
Sullivan K J, Griswold W G, Cai Y F, Hallen B. The structure and value of modularity in software design. ACM SIGSOFT Software Engineering Notes, 2001, 26(5): 99–108. DOI: https://doi.org/10.1145/503271.503224.
Baldwin C Y, Clark K B. Design Rules: The Power of Modularity. MIT Press, 2000. DOI: https://doi.org/10.7551/mitpress/2366.001.0001.
Tsantalis N, Mazinanian D, Krishnan G P. Assessing the refactorability of software clones. IEEE Trans. Software Engineering, 2015, 41(11): 1055–1090. DOI: https://doi.org/10.1109/TSE.2015.2448531.
Ganzinger H. Increasing modularity and language-independency in automatically generated compilers. Science of Computer Programming, 1983, 3(3): 223–278. DOI: https://doi.org/10.1016/0167-6423(83)90021-7.
Kastens U, Waite W M. Modularity and reusability in attribute grammars. Acta Informatica, 1994, 31(7): 601–627. DOI: https://doi.org/10.1007/BF01177548.
Harper R, Lillibridge M. A type-theoretic approach to higher-order modules with sharing. In Proc. the 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Feb. 1994, pp.123–137. DOI: 10.1145/174675.176927.
Kasampalis T, Park D, Lin Z Y, Adve V S, Roşu G. Language-parametric compiler validation with application to LLVM. In Proc. the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Apr. 2021, pp.1004–1019. DOI: 10.1145/3445814.3446751.
Mahajan D, Park J, Amaro E, Sharma H, Yazdanbakhsh A, Kim J K, Esmaeilzadeh H. TABLA: A unified template-based framework for accelerating statistical machine learning. In Proc. the 2016 IEEE International Symposium on High Performance Computer Architecture (HPCA), Mar. 2016, pp.14–26. DOI: 10.1109/HPCA.2016.7446050.
Whatmough P N, Donato M, Ko G G, Lee S K, Brooks D, Wei G Y. CHIPKIT: An agile, reusable open-source framework for rapid test chip development. IEEE Micro, 2020, 40(4): 32–40. DOI: https://doi.org/10.1109/MM.2020.2995809.
Tang X F, Giacomin E, Chauviere B, Alacchi A, Gaillardon P E. OpenFPGA: An open-source framework for agile prototyping customizable FPGAs. IEEE Micro, 2020, 40(4): 41–48. DOI: https://doi.org/10.1109/MM.2020.2995854.
Chen Y S, Mendis C, Carbin M, Amarasinghe S. VeGen: A vectorizer generator for SIMD and beyond. In Proc. the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Apr. 2021, pp.902–914. DOI: 10.1145/3445814.3446692.
Cummins C, Petoumenos P, Wang Z, Leather H. Synthesizing benchmarks for predictive modeling. In Proc. the 2017 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), Feb. 2017, pp.86–99. DOI: 10.1109/CGO.2017.7863731.
Lim J P, Nagarakatte S. Automatic equivalence checking for assembly implementations of cryptography libraries. In Proc. the 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), Feb. 2019, pp.37–49. DOI: 10.1109/CGO.2019.8661180.
Liu D F, Chen T S, Liu S L, Zhou J H, Zhou S Y, Teman O, Feng X B, Zhou X H, Chen Y J. PuDianNao: A polyvalent machine learning accelerator. ACM SIGPLAN Notices, 2015, 50(4): 369–381. DOI: https://doi.org/10.1145/2775054.2694358.
Chen T Q, Moreau T, Jiang Z H, Zheng L M, Yan E, Cowan M, Shen H C, Wang L Y, Hu Y W, Ceze L, Guestrin C, Krishnamurthy A. TVM: An automated end to-end optimizing compiler for deep learning. In Proc. the 13th USENIX Conference on Operating Systems Design and Implementation (OSDI 18), Oct. 2018, pp.579–594.
Ham T J, Wu L S, Sundaram N, Satish N, Martonosi M. Graphicionado: A high-performance and energy-efficient accelerator for graph analytics. In Proc. the 49th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO), Oct. 2016, Article No. 56. DOI: https://doi.org/10.1109/MICRO.2016.7783759.
Coussy P, Morawiec A. High-Level Synthesis. Springer, 2008.
Thomas D, Moorby P. The Verilog® Hardware Description Language. Springer, 2008.
Lattner C, Adve V. LLVM: A compilation framework for lifelong program analysis & transformation. In Proc. the 2004 International Symposium on Code Generation and Optimization, Mar. 2004, pp.75–86. DOI: 10.1109/CGO.2004.1281665.
Pilato C, Ferrandi F. Bambu: A modular framework for the high level synthesis of memory-intensive applications. In Proc. the 23rd International Conference on Field Programmable Logic and Applications, Sept. 2013. DOI: 10.1109/FPL.2013.6645550.
Cohen W W. A demonstration of WHIRL (demonstration abstract). In Proc. the 22nd Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, Aug. 1999, p.327. DOI: 10.1145/312624.312763.
Tate R, Stepp M, Tatlock Z, Lerner S. Equality saturation: A new approach to optimization. In Proc. the 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Jan. 2009, pp.264–276. DOI: 10.1145/1480881.1480915.
Tristan J B, Govereau P, Morrisett G. Evaluating valuegraph translation validation for LLVM. In Proc. the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, Jun. 2011, pp.295–305. DOI: 10.1145/1993498.1993533.
Hawblitzel C, Lahiri S K, Pawar K, Hashmi H, Gokbulut S, Fernando L, Detlefs D, Wadsworth S. Will you still compile me tomorrow? Static cross-version compiler validation. In Proc. the 9th Joint Meeting on Foundations of Software Engineering, Aug. 2013, pp.191–201. DOI: 10.1145/2491411.2491442.
Barnett M, Chang B Y E, DeLine R, Jacobs B, Leino K R M. Boogie: A modular reusable verifier for object-oriented programs. In Proc. the 4th International Conference on Formal Methods for Components and Objects, Nov. 2005, pp.364–387. DOI: 10.1007/11804192_1.
Ragan-Kelley J, Barnes C, Adams A, Paris S, Durand F, Amarasinghe S. Halide: A language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines. ACM SIGPLAN Notices, 2013, 48(6): 519–530. DOI: https://doi.org/10.1145/2499370.2462176.
Nigam R, Thomas S, Li Z J, Sampson A. A compiler infrastructure for accelerator generators. In Proc. the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Apr. 2021, pp.804–817. DOI: 10.1145/3445814.3446712.
Author information
Authors and Affiliations
Corresponding author
Supplementary Information
ESM 1
(PDF 192 kb)
Rights and permissions
About this article
Cite this article
Geng, HN., Lyu, F., Zhong, M. et al. Automatic Target Description File Generation. J. Comput. Sci. Technol. 38, 1339–1355 (2023). https://doi.org/10.1007/s11390-022-1919-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11390-022-1919-x