A Translation Method of ARM Machine Code to LLVM-IR for Binary Code Parallelization and Optimization - Shigenobu, Kohta; Ootsu, Kanemitsu; Ohkawa, Takeshi; Yokota, Takashi (International Symposium on Computing and Networking (Online), 2017)
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.