A Translation Method of ARM Machine Code to LLVM-IR for Binary Code Parallelization and Optimization

A Translation Method of ARM Machine Code to LLVM-IR for Binary Code Parallelization and Optimization
复制标题

ARM机器代码到LLVM-IR的二进制代码并行化和优化的翻译方法

DOI:
10.1109/candar.2017.75
复制
发表时间:
2017
期刊:
Proc. 5th International Symposium on Computing and Networking (CANDAR'17)
影响因子:
--
通讯作者:
Takashi Yokota
Takashi Yokota
中科院分区:
--
文献类型:
--
作者:
Kohta Shigenobu;Kanemitsu Ootsu;Takeshi Ohkawa;Takashi Yokota

文献摘要

相似文献

近年来,配备多核处理器和GPU等高性能计算组件的移动计算和嵌入式设备越来越流行。为了充分利用这些计算组件来加速用户程序,需要根据各类设备上的运行环境来优化程序。二进制代码优化是一种有前途的解决方案。特别是,为了优化各种目标设备的 ARM 原生程序代码,使用 LLVM 编译器基础设施进行二进制代码优化被认为非常有用。为了实现这一点,我们想要使用LLVM编译器的各种优化模块,但它们是在LLVM-IR(中间表示)上执行处理的。因此,我们需要开发一个 LLVM 前端,将 ARM 机器代码转换为 LLVM-IR。在本文中,我们对ARM到LLVM-IR的翻译进行了初步讨论。翻译后的IR代码应该与LLVM的优化过程相匹配。然而,需要什么形式的 IR 代码尚不清楚,因此我们的目标是生成与编译器生成的 IR 代码等效的 IR 代码。我们通过与 Clang 从 C 源代码生成的 IR 代码进行比较来讨论代码翻译方法。初步评估结果表明,我们的翻译方法可以生成与 C 源程序代码生成的 IR 代码等效的 IR 代码。
Recently, mobile computing and embedded devices equipped with high performance computing components such as multicore processor and GPU are becoming popular. In order to speedup user programs by making full use of these computing components, it is necessary to optimize the program according to the runtime environment on various types of devices. Binary code optimization is one promising solution. Especially, in order to optimize ARM-native program code for various target devices, using the LLVM compiler infrastructure for binary code optimization is considered quite useful. To realize this, we want to use various optimization modules of LLVM compiler, but they perform their processings on LLVM-IR (Intermediate Representation). Thus, we need to develop a frontend for LLVM that translates ARM machine code to LLVM-IR. In this paper, we make preliminary discussions on the ARM-to-LLVM-IR translation. The translated IR codes should match the optimization process of LLVM. However, what form of IR code is desired is unclear, so we aim at generating the IR code equivalent to the compiler-generated IR code. We discuss a code translation method by comparing with the IR codes generated by Clang from C source codes. Preliminary evaluation results show that our translation method can generate the IR codes equivalent to the one generated from C source program code.