ISSN 1000-1239 CN 11-1777/TP

计算机研究与发展 ›› 2019, Vol. 56 ›› Issue (9): 2012-2026.doi: 10.7544/issn1000-1239.2019.20180789

• 系统结构 • 上一篇    

学习模型指导的编译器优化顺序选择方法

刘慧1,2,3, 徐金龙2, 赵荣彩2, 姚金阳2   

  1. 1(河南师范大学计算机与信息工程学院 河南新乡 453007); 2(数学工程与先进计算国家重点实验室(战略支援部队信息工程大学) 郑州 450002); 3(河南省高校“计算智能与数据挖掘”工程技术研究中心(河南师范大学) 河南新乡 453007) (liuhui806@126.com)
  • 出版日期: 2019-09-10
  • 基金资助: 
    国家重点研发计划项目(2016YFB0200503);河南师范大学青年科学基金项目(2015QK21);河南省高等学校重点科研项目(20A520018)

Compiler Optimization Sequence Selection Method Based on Learning Model

Liu Hui1,2,3, Xu Jinlong2, Zhao Rongcai2, Yao Jinyang2   

  1. 1(College of Computer and Information Engineering, Henan Normal University, Xinxiang, Henan 453007); 2(State Key Laboratory of Mathematical Engineering and Advanced Computing(Strategic Support Force Information Engineering University), Zhengzhou 450002); 3(Engineering Technology Research Center for Computing Intelligence&Data Mining in Henan Province (Henan Normal University), Xinxiang, Henan 453007)
  • Online: 2019-09-10
  • Supported by: 
    This work was supported by the National Key Research and Development Program of China (2016YFB0200503), the Youth Science Fund Project of Henan Normal University (2015QK21), and the Key Scientific Research Project of Henan Province Colleges (20A520018).

摘要: 针对新的应用程序和目标平台通常需要使用编译器进行程序优化顺序选择,以提升目标代码性能.迭代编译可使优化顺序选择过程自动进行,在允许的时间空间范围内尽可能多地执行程序的不同版本,但该方法是一种机械式搜索,缺少对先前获得经验的利用,需要较大的执行开销.因此,需要能自动预测变换后目标程序性能而不必实际运行程序的优化编译方法.提出一种编译器优化顺序选择方法:Features ANN.该方法首先采用动静结合的程序特征表示技术,对程序特征进行抽取;然后基于程序特征对编译优化空间进行搜索,找到当前程序版本的最佳优化;最后,由程序特征和最佳优化形成训练样本,基于人工神经网络(artificial neural network, ANN)形成监督学习模型,对新程序的最佳编译优化顺序进行预测.实验结果表明,Features ANN与2种现有迭代编译方法GraphDSE和ClusterDSE比较时,在2种平台上相对于编译器标准优化级别-O3分别获得1.49x,1.25x,1.38x和1.41x,1.16x,1.22x的执行时间加速比.此外,与现有非迭代编译方法相比时,Features ANN也获得了有效的性能提升.

关键词: 编译优化, 优化顺序, 监督学习, 特征抽取, 人工神经网络

Abstract: For new applications and target platforms, it is often necessary to use the compiler for optimization sequence selection to improve the performance of target code. Iterative compilation enables the optimization sequence selection process automatically, with as many different versions of the program as possible within the allowable time and space range. However, iterative compilation method is a mechanical search that lacks the utilization of previous experience and requires large execution overheads. Therefore, an optimized compilation method is needed to automatically predict the performance of the transformed program without actually running. This paper presents Features ANN to select the optimization sequence of compiler. Features ANN is based on the supervised learning model. Firstly, the program feature is extracted by the program feature representation technique through a combination of dynamic and static feature. Then, the compiler optimization space is searched based on the program features, and it finds the best optimization of the current version of the program. Finally, training samples are formed by program features and optimal optimization, and an artificial neural network (ANN) is used to construct a learning model to predict the optimal optimization sequence of the new program. Experimental results show that, Features ANN can get the best performance compared with the existing iterative compilation and non-iterative compilation methods.

Key words: compile optimization, optimization sequence, supervise learning, features extraction, artificial neural network (ANN)

中图分类号: