高级检索

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

    Compiler Optimization Sequence Selection Method Based on Learning Model

    • 摘要: 针对新的应用程序和目标平台通常需要使用编译器进行程序优化顺序选择,以提升目标代码性能.迭代编译可使优化顺序选择过程自动进行,在允许的时间空间范围内尽可能多地执行程序的不同版本,但该方法是一种机械式搜索,缺少对先前获得经验的利用,需要较大的执行开销.因此,需要能自动预测变换后目标程序性能而不必实际运行程序的优化编译方法.提出一种编译器优化顺序选择方法: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.

       

    /

    返回文章
    返回