引用本文: | 李男,庞建民.基于中间表示规则替换的二进制翻译中间代码优化方法[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[点击复制] |
|
|
|
本文已被:浏览 6274次 下载 4618次 |
基于中间表示规则替换的二进制翻译中间代码优化方法 |
李男1,2,庞建民1,2 |
(1. 战略支援部队信息工程大学, 河南 郑州 450001;2. 数学工程与先进计算国家重点实验室, 河南 郑州 450002)
|
摘要: |
动态二进制翻译在实现多源到多目标的程序翻译过程中,为屏蔽不同源平台间的硬件差异引入中间代码,采用内存虚拟策略进行实现,但同时带来中间代码膨胀问题。传统的中间代码优化方法主要采用对冗余指令进行匹配删除的方法。将优化重点聚焦在针对特殊指令匹配的中间表示规则替换上,提出了一种基于中间表示规则替换的二进制翻译中间代码优化方法。该方法针对中间代码膨胀所呈现的几种典型情景,描述了中间表示替换规则,并将以往应用在后端代码优化上的寄存器直接映射策略应用在此处。通过建立映射公式,实现了将原来的内存虚拟操作替换为本地寄存器操作,从而降低了中间代码膨胀率。使用SPEC CPU2006测试集进行了实验,验证了此优化方法的正确性和有效性。测试用例在优化前和优化后的执行结果一致,验证了优化方法的正确性;优化后测试用例的中间代码平均缩减率达到32.59%,验证了优化方法的有效性。 |
关键词: 动态二进制翻译 中间代码 内存虚拟策略 代码膨胀 中间表示规则 寄存器映射 |
DOI:10.11887/j.cn.202104019 |
投稿日期:2020-11-09 |
基金项目:国家自然科学基金资助项目(61802433) |
|
Intermediate code optimization method for binary translation based on intermediate representation rule replacement |
LI Nan1,2, PANG Jianmin1,2 |
(1. PLA Strategic Support Force Information Engineering University, Zhengzhou 450001, China;2. 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 |
|
|
|
|
|