|
Global register allocation during dynamic binary translation
K. A. Batuzov Institute for System Programming of the Russian Academy of Sciences
Abstract:
Register allocation have a significant impact on performance of generated code. This paper explores the problem of global register alloction during dynamic binary translation. Since existing algorithms are designed for compilers and they are not always suitable for dynamic binary translation, a new global register allocation was developed. This algorithm decides which variables should reside on which registers before and after each basic block (called pre- and post- conditons of this basic block) and solves local register allocation problem in these constraints. To ensure that pre- and post- conditions of different basic blocks are consistent the algorithms must choose these conditions in such a way that for each basic block b' that precides arbitrary block b it's postconditions are the same as preconditions of b . This can be achieved by finding groups of arcs in control flow graph on which these conditions should remain the same (let's call them synchronisation points) and then choosing conditions for each such synchronisation point. Synchronization points are connected components in graph G<sub>E </sub>which is a graph where arcs of original CFG are vertices and edges connect arcs which start or end in the same basic block. This gives an efficient way to find synchronization points. To choose which variables should reside on registers in each synchronization point the amount of available register is estimated using register pressure in incident basic blocks. Then actual variables a picked based on how often they are used in incident basic blocks. Finally the local register allocation algorithm is modified to use precondition and ensure post conditions of the basic block. The efficient algorithm to convert existing allocation to the desired postcondition at the end of basick block is presented with the proof of that it's optimal in terms of generated spills, reloads and register moves. The described algorithm showed 29.6% running time decrease on the synthetic example. The needed modifications of the algorithm to efficiently run on real life application are explored.
Keywords:
global register allocation, dynamic binary translation, QEMU.
Citation:
K. A. Batuzov, “Global register allocation during dynamic binary translation”, Proceedings of ISP RAS, 28:5 (2016), 199–214
Linking options:
https://www.mathnet.ru/eng/tisp76 https://www.mathnet.ru/eng/tisp/v28/i5/p199
|
Statistics & downloads: |
Abstract page: | 161 | Full-text PDF : | 84 | References: | 40 |
|