• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2021, Vol. 43 ›› Issue (06): 962-968.

• 高性能计算 • 上一篇    下一篇

编译器中激进蝴蝶优化方法的研究与实现

朱广林1,2,吕方1,赖庆宽1,2,陈华英3,何先波1,2   

  1. (1.中国科学院计算技术研究所计算机体系结构国家重点实验室,北京 100190;

    2.西华师范大学计算机学院,四川 南充 637009;3.中国民用航空飞行学院,四川 广汉 618307)


  • 收稿日期:2020-08-28 修回日期:2020-12-10 接受日期:2021-06-25 出版日期:2021-06-25 发布日期:2021-06-22
  • 基金资助:
    国家重点研发计划(2016YFB0200803);国家自然科学基金(61872043);国家自然科学基金青年科学基金(61802368);中国科学院战略性先导科技专项(C类)(XDC05030101);西华师范大学英才基金(17YC149);CCF腾讯开放科研基金和澳大利亚研究理事会项目(RG171010)

An aggressive butterfly optimization method in compiler

ZHU Guang-lin1,2,L Fang1,LAI Qing-kuan1,2,CHEN Hua-ying3,HE Xian-bo1,2#br#

#br#
  

  1. (1.State Key Laboratory of Computer Architecture,Institute of Computing Technology,

    Chinese Academy of Sciences,Beijing 100190;

    2.School of Computer Science,China West Normal University,Nanchong 637009;

    3.China Civil Aviation Flight Academy,Guanghan 618307,China)

  • Received:2020-08-28 Revised:2020-12-10 Accepted:2021-06-25 Online:2021-06-25 Published:2021-06-22

摘要: 编译优化技术的目的是挖掘程序中的优化空间,提高程序编译或运行效率,无效代码删除优化是被广泛使用的编译优化技术之一,它旨在删除程序中不可达的代码,以提升程序的执行效率。许多应用程序的执行路径往往与运行时的输入参数值相关,并且在一些分支路径上与运行时参数值相结合,可能存在无效代码,通过现有的无效代码删除优化,很难做出优化处理。为此,提出一种依赖数据流分析的激进蝴蝶优化方法,利用SSA中间表示,根据动态运行时的参数可能值,自动为程序生成代码形状类似蝴蝶(butterfly)的分支代码,使编译器在程序编译阶段为相关优化提供可行的优化依据。最后通过实验验证了该方法的有效性和可行性。

关键词: 无效代码删除, 编译优化, 数据流分析, 激进蝴蝶优化, SSA中间表示

Abstract: The purpose of compilation optimization technology is to explore the optimization space in the program and improve the efficiency of program compilation or operation. Dead code elimination optimization is one of the widely used compilation optimization technologies. It aims to delete the unreachable codes in the program to improve the execution efficiency of the programs. In many applications, the execution path is often related to the input parameter values at runtime, and some branch paths are combined with the runtime parameter values. There may be dead codes. It is difficult to deal with these dead codes through the existing dead code elimination optimization. To this end, this paper proposes an aggressive butterfly optimization method that relies on data flow analysis. According to the possible values of dynamic runtime parameters, the method uses SSA intermediate representation to automatically generate the branch code similar to butterfly shape for the program. At the stage of program compilation in compiler, it provides feasible optimization basis for related optimization. Finally, the effectiveness and feasibility of this method are verified through experiments.


Key words: dead code elimination, compilation optimization, data flow analysis, aggressive butterfly optimization, SSA intermediate representation