首页 | 本学科首页   官方微博 | 高级检索  
   检索      

基于中间表示规则替换的二进制翻译中间代码优化方法
引用本文:李男,庞建民.基于中间表示规则替换的二进制翻译中间代码优化方法[J].国防科技大学学报,2021,43(4):156-162.
作者姓名:李男  庞建民
作者单位:战略支援部队信息工程大学,河南郑州 450001;数学工程与先进计算国家重点实验室,河南郑州 450002
基金项目:国家自然科学基金资助项目(61802433)
摘    要:动态二进制翻译在实现多源到多目标的程序翻译过程中,为屏蔽不同源平台间的硬件差异引入中间代码,采用内存虚拟策略进行实现,但同时带来中间代码膨胀问题。传统的中间代码优化方法主要采用对冗余指令进行匹配删除的方法。将优化重点聚焦在针对特殊指令匹配的中间表示规则替换上,提出了一种基于中间表示规则替换的二进制翻译中间代码优化方法。该方法针对中间代码膨胀所呈现的几种典型情景,描述了中间表示替换规则,并将以往应用在后端代码优化上的寄存器直接映射策略应用在此处。通过建立映射公式,实现了将原来的内存虚拟操作替换为本地寄存器操作,从而降低了中间代码膨胀率。使用SPEC CPU2006测试集进行了实验,验证了此优化方法的正确性和有效性。测试用例在优化前和优化后的执行结果一致,验证了优化方法的正确性;优化后测试用例的中间代码平均缩减率达到32.59%,验证了优化方法的有效性。

关 键 词:动态二进制翻译  中间代码  内存虚拟策略  代码膨胀  中间表示规则  寄存器映射
收稿时间:2020/11/9 0:00:00

Intermediate code optimization method for binary translation based on intermediate representation rule replacement
LI Nan,PANG Jianmin.Intermediate code optimization method for binary translation based on intermediate representation rule replacement[J].Journal of National University of Defense Technology,2021,43(4):156-162.
Authors:LI Nan  PANG Jianmin
Institution:PLA Strategic Support Force Information Engineering University, Zhengzhou 450001, China;State Key Laboratory of Mathematical Engineering and Advanced Computing, Zhengzhou 450002, China
Abstract:In the process of realizing multi-source to multi-target program translation, the dynamic binary translation uses intermediate code to shield the hardware differences between different source platforms, and the memory virtual strategy is adopted to achieve the goal. As a result, it brings about the problem of intermediate code expansion. Traditional intermediate code optimization methods usually use the method of matching and deleting redundant instructions. The intermediate representation rule replacement for special instruction matching was focused on, and an intermediate code optimization method for binary translation based on intermediate representation rule replacement was proposed. This method described the corresponding intermediate representation replacement rules for several typical scenarios of intermediate code expansion, and the register direct mapping strategy used in the back-end code optimization was applied here. By establishing mapping formula, the memory virtual operation was replaced by local register operation, thus reducing the expansion degree of intermediate code. The SPEC CPU2006 test suite was used to carry out the experimental, and the experimental results verify the correctness and effectiveness of this optimization method. The results before and after optimization are consistent, which verifies the correctness of the optimization method, meanwhile, the average reduction rate of intermediate code for each case after optimization is 32.59%, which verifies the effectiveness of the optimization method.
Keywords:dynamic binary translation  intermediate code  memory virtual strategy  code expansion  intermediate representation rule  register mapping
本文献已被 CNKI 万方数据 等数据库收录!
点击此处可从《国防科技大学学报》浏览原始摘要信息
点击此处可从《国防科技大学学报》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号