COpt: A High Level Domain-Specific Language to Generate Compiler Optimizers
COpt: A High Level Domain-Specific Language to Generate Compiler Optimizers
复制标题
COpt:用于生成编译器优化器的高级领域特定语言
DOI:
--
复制
发表时间:
2018
期刊:
影响因子:
--
通讯作者:
P. Kanwal
中科院分区:
文献类型:
--
作者:
Sruthi Venkat;P. Kanwal
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.