节点文献

基于LLVM的NiosⅡ处理器后端快速移植及优化

Fast Backend Porting and Optimization for NiosⅡ Processor Based on LLVM

【作者】 卢念

【导师】 任胜兵;

【作者基本信息】 中南大学 , 计算机科学与技术, 2011, 硕士

【摘要】 编译器是嵌入式系统研发的基础,快速实现特定硬件平台的嵌入式系统编译器可以大大缩短嵌入式系统研发周期。目前研究人员主要采用GCC编译器后端移植方法来生成嵌入式系统编译器。GCC主要使用RTL描述后端处理器,但是RTL抽象复杂不便于编写和阅读。同时GCC复杂的软件结构以及后端移植文档缺乏导致GCC后端移植方法无法满足嵌入式系统研发周期短的要求。如何快速实现编译器后端移植仍然是嵌入式系统研究的热点。首先本文采用新的编译器架构低级虚拟机(Low Level Virtual Machine, LLVM),通过移植NiosⅡ嵌入式处理器来分析LLVM快速后端移植架构。采用LLVM后端移植架构中的TableGen描述NiosⅡ基本体系结构,使用完备的LLVM C++函数库来描述复杂或特殊的操作。TableGen与LLVM C++函数库配合使用,实现LLVM编译器对NiosⅡ处理器后端的支持。实验结果表明与GCC后端移植方法相比,基于LLVM快速后端移植方法大大减少了源代码量及无需模仿已有的处理器,大大节省了后端移植时间。其次本文研究并实现后端描述辅助系统,以加快目标处理器后端描述速度。针对LLVM后端移植架构中存在大量繁杂且重复的文本TableGen描述,本文设计人性化、可视化的后端描述辅助系统。输入少量目标处理器后端信息,通过后端描述辅助系统快速生成相应的TableGen描述文件。最后本文以纸张计数系统为出发点,鉴于纸张图像处理的运算量大和循环数目多的特点,研究并实现LLVM编译器循环优化功能,并对该系统进行循环优化。通过实验表明经过LLVM编译器的循环优化,纸张计数系统的图像数据处理速度提高了10.1%-14.6%。

【Abstract】 Compiler is the basis of embedded systems development. Implementing quickly embedded systems compiler of hardware platform-specific can greatly shorten the development period of embedded systems. Currently research and development personnel mainly use the method of GCC compiler backend-porting to generate embedded systems compiler. GCC mainly uses Register Transfer Language (RTL) to describe backend processor, but RTL is too abstract and complex to write and read. At the same time, complex software architecture of GCC and the lack of backend-porting documents cause that the method of GCC compiler backend-porting can not meet the requirements of the short development period of embedded system. How to quickly implement compiler backend-porting is still a hot research.Firstly, this thesis adopts a new compiler framework which is called Low Level Virtual Machine (LLVM), and analyses the backend-porting architecture of LLVM by porting NiosII embedded processor. It uses TableGen in backend-porting architecture to describe basic architecture of NiosII processor, and uses complete LLVM C++library to describe the complex or special operations. The match usage of TableGen and LLVM C++library realizes LLVM compiler to support NiosII backend processor. The experimental results indicate that backend-porting method which based on LLVM reduces the source lines of code (SLOC) and does not need to imitate the existing processors, and compared with backend-porting method based on GCC, the method greatly shortens the backend-porting period.Secondly, in order to accelerate the backend-description speed of target processor, this thesis studies and implements the backend-description assistant system. Ascribe the existence of a great number of complex and repeated TableGen description which are text format in LLVM backend-porting architecture, this thesis designs a humanization and visualization backend-description assistant system. We input a few backend information of target processor, and the backend-description assistant system quickly generates the corresponding TableGen description files.At last, this thesis takes paper-counting system as a starting point, in view of the heavy computation and the large loop count features of image-processing for paper, this thesis studies and implements the loop optimization function of LLVM compiler, and optimizes paper-counting system with it. The experimental results indicate that the image-processing speed of paper-counting system is improved by 10.1%~14.6%.

  • 【网络出版投稿人】 中南大学
  • 【网络出版年期】2012年 04期
节点文献中: 

本文链接的文献网络图示:

本文的引文网络