Profile-guided optimisation for indirect branches in a binary translator

Binary translators, which translate the binary executables from one instruction set to another, are useful tools. Indirect branches are one of the key factors that affect the efficiency of binary translators. In the previous research, our lab developed an LLVM-based binary translation framework, cal...

Full description

Bibliographic Details
Main Authors: Jyun-Siang Huang, Wuu Yang, Yi-Ping You
Format: Article
Language:English
Published: Taylor & Francis Group 2022-12-01
Series:Connection Science
Subjects:
Online Access:http://dx.doi.org/10.1080/09540091.2022.2041555
_version_ 1797684023609262080
author Jyun-Siang Huang
Wuu Yang
Yi-Ping You
author_facet Jyun-Siang Huang
Wuu Yang
Yi-Ping You
author_sort Jyun-Siang Huang
collection DOAJ
description Binary translators, which translate the binary executables from one instruction set to another, are useful tools. Indirect branches are one of the key factors that affect the efficiency of binary translators. In the previous research, our lab developed an LLVM-based binary translation framework, called Rabbit. Rabbit introduces novel optimisations: platform-dependent hyperchaining and platform-independent hyperchaining for improving the emulation of the indirect branch instructions. Indirect branch instructions may have several destinations, and these destinations are not known until runtime. Both platform-independent and platform-dependent hyperchaining establish a search table for each indirect branch instruction to record the visited branch destinations at runtime. In this work, we focus on the translation from AArch64 binary to RISC-V binary and further develop the profile-guided optimisation for indirect branch, which collects runtime information, including branch destinations and execution frequency of each destination for each indirect branch instruction, and then use the information to improve hyperchaining (i.e. accelerate the process of finding the branch destination). The profile-guided optimisation can be divided to profile-guided platform-independent hyperchaining and profile-guided platform-dependent hyperchaining. We finally use SPEC CPU 2006 CINT benchmark to evaluate the optimisations. The experiment results indicate that compared with (1) no chaining, (2) platform-independent hyperchaining and (3) platform-dependent hyperchaining, profile-guided platform-independent hyperchaining provides 1.123×, 1.066× and 1.098× speedup respectively. Similarly, profile-guided platform-dependent hyperchaining achieves 1.106×, 1.047× and 1.083× speedup with respect to the above three configurations, respectively.
first_indexed 2024-03-12T00:24:34Z
format Article
id doaj.art-b4900e2d532049a2a517f9de615ca564
institution Directory Open Access Journal
issn 0954-0091
1360-0494
language English
last_indexed 2024-03-12T00:24:34Z
publishDate 2022-12-01
publisher Taylor & Francis Group
record_format Article
series Connection Science
spelling doaj.art-b4900e2d532049a2a517f9de615ca5642023-09-15T10:48:00ZengTaylor & Francis GroupConnection Science0954-00911360-04942022-12-0134174976510.1080/09540091.2022.20415552041555Profile-guided optimisation for indirect branches in a binary translatorJyun-Siang Huang0Wuu Yang1Yi-Ping You2National Yang–Ming Chiao–Tung UniversityNational Yang–Ming Chiao–Tung UniversityNational Yang–Ming Chiao–Tung UniversityBinary translators, which translate the binary executables from one instruction set to another, are useful tools. Indirect branches are one of the key factors that affect the efficiency of binary translators. In the previous research, our lab developed an LLVM-based binary translation framework, called Rabbit. Rabbit introduces novel optimisations: platform-dependent hyperchaining and platform-independent hyperchaining for improving the emulation of the indirect branch instructions. Indirect branch instructions may have several destinations, and these destinations are not known until runtime. Both platform-independent and platform-dependent hyperchaining establish a search table for each indirect branch instruction to record the visited branch destinations at runtime. In this work, we focus on the translation from AArch64 binary to RISC-V binary and further develop the profile-guided optimisation for indirect branch, which collects runtime information, including branch destinations and execution frequency of each destination for each indirect branch instruction, and then use the information to improve hyperchaining (i.e. accelerate the process of finding the branch destination). The profile-guided optimisation can be divided to profile-guided platform-independent hyperchaining and profile-guided platform-dependent hyperchaining. We finally use SPEC CPU 2006 CINT benchmark to evaluate the optimisations. The experiment results indicate that compared with (1) no chaining, (2) platform-independent hyperchaining and (3) platform-dependent hyperchaining, profile-guided platform-independent hyperchaining provides 1.123×, 1.066× and 1.098× speedup respectively. Similarly, profile-guided platform-dependent hyperchaining achieves 1.106×, 1.047× and 1.083× speedup with respect to the above three configurations, respectively.http://dx.doi.org/10.1080/09540091.2022.2041555binary translationprofile-guided optimisationhyperchainingrisc-vaarch64llvmrabbit
spellingShingle Jyun-Siang Huang
Wuu Yang
Yi-Ping You
Profile-guided optimisation for indirect branches in a binary translator
Connection Science
binary translation
profile-guided optimisation
hyperchaining
risc-v
aarch64
llvm
rabbit
title Profile-guided optimisation for indirect branches in a binary translator
title_full Profile-guided optimisation for indirect branches in a binary translator
title_fullStr Profile-guided optimisation for indirect branches in a binary translator
title_full_unstemmed Profile-guided optimisation for indirect branches in a binary translator
title_short Profile-guided optimisation for indirect branches in a binary translator
title_sort profile guided optimisation for indirect branches in a binary translator
topic binary translation
profile-guided optimisation
hyperchaining
risc-v
aarch64
llvm
rabbit
url http://dx.doi.org/10.1080/09540091.2022.2041555
work_keys_str_mv AT jyunsianghuang profileguidedoptimisationforindirectbranchesinabinarytranslator
AT wuuyang profileguidedoptimisationforindirectbranchesinabinarytranslator
AT yipingyou profileguidedoptimisationforindirectbranchesinabinarytranslator