摘要
编译优化技术的目的是挖掘程序中的优化空间,提高程序编译或运行效率,无效代码删除优化是被广泛使用的编译优化技术之一,它旨在删除程序中不可达的代码,以提升程序的执行效率。许多应用程序的执行路径往往与运行时的输入参数值相关,并且在一些分支路径上与运行时参数值相结合,可能存在无效代码,通过现有的无效代码删除优化,很难做出优化处理。为此,提出一种依赖数据流分析的激进蝴蝶优化方法,利用SSA中间表示,根据动态运行时的参数可能值,自动为程序生成代码形状类似蝴蝶(butterfly)的分支代码,使编译器在程序编译阶段为相关优化提供可行的优化依据。最后通过实验验证了该方法的有效性和可行性。
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.
作者
朱广林
吕方
赖庆宽
陈华英
何先波
ZHU Guang-lin;Lü Fang;LAI Qing-kuan;CHEN Hua-ying;HE Xian-bo(State Key Laboratory of Computer Architecture,Institute of Computing Technology,Chinese Academy of Sciences,Beijing 100190;School of Computer Science,China West Normal University,Nanchong 637009;China Civil Aviation Flight Academy,Guanghan 618307,China)
出处
《计算机工程与科学》
CSCD
北大核心
2021年第6期962-968,共7页
Computer Engineering & Science
基金
国家重点研发计划(2016YFB0200803)
国家自然科学基金(61872043)
国家自然科学基金青年科学基金(61802368)
中国科学院战略性先导科技专项(C类)(XDC05030101)
西华师范大学英才基金(17YC149)
CCF腾讯开放科研基金和澳大利亚研究理事会项目(RG171010)。
关键词
无效代码删除
编译优化
数据流分析
激进蝴蝶优化
SSA中间表示
dead code elimination
compilation optimization
data flow analysis
aggressive butterfly optimization
SSA intermediate representation