Title: COpt: A High Level Domain-Specific Language to Generate Compiler Optimizers
Abstract: The coding of compiler optimizations along with the program analysis required to do so is a strenuous task involving thousands of lines of code. This paper presents COpt, a high level domain specific language (DSL) for the use of compiler developers as a tool to be used in the compiler development pipeline for the generation of compiler optimizers. A simple, intuitive and concise manner for specifying compiler optimizations is presented by the DSL. The paper includes a prototype implementation of the DSL which supports a set of ten optimizations including local, global and loop optimizations. On compilation of a COpt program, the COpt compiler translates the COpt program to a LLVM C++ pass. This generated pass acts as the code optimizer which works on LLVM intermediate representation (LLVM IR) to optimize it. COpt has been developed after carefully studying low-level compiler infrastructure, namely LLVM, as well as the algorithms for global, local and loop compiler optimizations and this has been abstracted into appropriate constructs in the DSL. While tools such as Lex and Yacc assist in the generation of the frontend phases of the compiler, namely the lexer and the parser, COpt assists in the generation of compiler optimizers. This will provide compiler developers an easy method of specifying compiler optimizations and saves them the hassle of reading, understanding, coding and debugging low-level infrastructure code by automatically generating compiler optimizers.
Publication Year: 2018
Publication Date: 2018-12-01
Language: en
Type: article
Indexed In: ['crossref']
Access and Citation
Cited By Count: 2
AI Researcher Chatbot
Get quick answers to your questions about the article from our AI researcher chatbot