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
期刊:
2018 International Conference on Advanced Computation and Telecommunication (ICACAT)
影响因子:
--
通讯作者:
P. Kanwal
P. Kanwal
中科院分区:
--
文献类型:
--
作者:
Sruthi Venkat;P. Kanwal

文献摘要

被引文献

相似文献

编译器优化的编码以及所需的程序分析是一项涉及数千行代码的艰巨任务。本文介绍了COPT,这是一种使用编译器开发人员作为编译器开发管道中用于编译器优化器的编译器开发管道中的工具的高级域(DSL)。 DSL提出了一种简单,直观和简洁的指定编译器优化的方式。本文包括DSL的原型实现,该实现支持一组十个优化,包括本地,全局和循环优化。在COPT程序的编译时,COPT编译器将COPT程序转换为LLVM C ++ PASS。该生成的通行证是在LLVM中间表示(LLVM IR)上使用的代码优化器以优化它。在仔细研究了低级编译器基础架构(即LLVM)以及全球,局部和Loop编译器优化的算法之后,COPT是开发的,并且已将其抽象为DSL中的适当构建体。尽管LEX和YACC等工具有助于生成编译器的前端阶段,即Lexer和Parser,但COPT有助于生成编译器优化器。这将为编译器开发人员提供一种简单的指定编译器优化的方法,并通过自动生成编译器优化器来节省阅读,理解,编码和调试低级基础结构代码的麻烦。
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.