Since the 1980’s code reordering has gained popularity as an important way to improve the spatial locality of programs. While the effect of the processor’s microarchitecture and memory hierarchy on this optimization technique has been investigated, little research has focused on the impact of the instruction set. In this paper, we analyze the effect of limited branch offset of the MIPS-like instruction set [Hwu et al. 2004, 2005] on code reordering, explore two simple methods to handle the exceeded branches, and propose the bidirectional code layout (BCL) algorithm to reduce the number of branches exceeding the offset limit. The BCL algorithm sorts the chains according to the position of related chains, avoids cache conflict misses deliberately and lays out the code bidirectionally. It strikes a balance among the distance of related blocks, the instruction cache miss rate, the memory size required, and the control flow transfer. Experimental results show that BCL can effectively reduce exceeded branches by 50.1%, on average, with up to 100% for some programs. Except for some programs with little spatial locality, the BCL algorithm can achieve the performance, as the case with no branch offset limitation. © 2007, ACM. All rights reserved.
CITATION STYLE
chen, yu, & zhang, fuxin. (2007). Code Reordering on Limited Branch Offset. ACM Transactions on Architecture and Code Optimization, 4(2), 10. https://doi.org/10.1145/1250727.1250730
Mendeley helps you to discover research relevant for your work.