Rotating Register Allocation for Enhanced Pipeline Scheduling

Suhyun Kim1 and Soo-Mook Moon2
1IBM, 2Seoul National University


Abstract

A rotating register file is a compiler-managed hardware renaming mechanism for overcoming the cross-iteration register overwrite problem in software pipelining \cite{dehnert}. It has primarily been used for software pipelining of straight-line and if-converted loops in the context of {\em modulo scheduling}. This paper proposes using rotating registers for software pipelining of loops with {\bf arbitrary control flows}, in the context of enhanced pipeline scheduling (EPS). EPS can achieve a tight, variable initiation interval for such loops, but generates many hard-to-delete copies for handling the cross-iteration register overwrite problem. These copies may cause a stall if they renamed multi-latency instructions, in addition to taking resources. In the prior work \cite{unroll_based}, these copies were removed by loop unrolling using an abstraction called {\em extended live range} (ELR). In this paper, we eliminate those copies by allocating rotating registers using the same ELR yet with a different interpretation, since both techniques share a similar intuition for copy elimination. There are some differences in building and using ELRs, though, which will also be discussed. We also discuss how existing rotating register allocation techniques cannot be easily adapted for EPS to handle loops with control flows. Our experimental results indicate that we can eliminate 50\% of otherwise uncoalescible copies via rotating register allocation, which allows us to avoid a serious slowdown from latency handling and resource pressure without code expansion as in unrolling.