基于中间表示规则替换的二进制翻译中间代码优化方法
作者:
作者单位:

(1. 战略支援部队信息工程大学, 河南 郑州 450001;2. 数学工程与先进计算国家重点实验室, 河南 郑州 450002)

作者简介:

李男(1977—),男,辽宁锦州人,副教授,博士,硕士生导师,E-mail:linan_happy@126.com

通讯作者:

中图分类号:

TP314

基金项目:

国家自然科学基金资助项目(61802433)


Intermediate code optimization method for binary translation based on intermediate representation rule replacement
Author:
Affiliation:

(1. PLA Strategic Support Force Information Engineering University, Zhengzhou 450001, China;2. State Key Laboratory of Mathematical Engineering and Advanced Computing, Zhengzhou 450002, China)

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    动态二进制翻译在实现多源到多目标的程序翻译过程中,为屏蔽不同源平台间的硬件差异引入中间代码,采用内存虚拟策略进行实现,但同时带来中间代码膨胀问题。传统的中间代码优化方法主要采用对冗余指令进行匹配删除的方法。将优化重点聚焦在针对特殊指令匹配的中间表示规则替换上,提出了一种基于中间表示规则替换的二进制翻译中间代码优化方法。该方法针对中间代码膨胀所呈现的几种典型情景,描述了中间表示替换规则,并将以往应用在后端代码优化上的寄存器直接映射策略应用在此处。通过建立映射公式,实现了将原来的内存虚拟操作替换为本地寄存器操作,从而降低了中间代码膨胀率。使用SPEC CPU2006测试集进行了实验,验证了此优化方法的正确性和有效性。测试用例在优化前和优化后的执行结果一致,验证了优化方法的正确性;优化后测试用例的中间代码平均缩减率达到32.59%,验证了优化方法的有效性。

    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.

    参考文献
    相似文献
    引证文献
引用本文

李男,庞建民.基于中间表示规则替换的二进制翻译中间代码优化方法[J].国防科技大学学报,2021,43(4):156-162.
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.

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2020-11-09
  • 最后修改日期:
  • 录用日期:
  • 在线发布日期: 2021-07-20
  • 出版日期: 2021-08-28
文章二维码