Reducing the impact of software prefetching on register pressure
David W. Shrewsbury, Cindy Norris · 2000
Software-controlled prefetching of data is an effective way to tolerate large memory latencies.Software prefetching is a technique in which the compiler attempts to determine whether or not a data item will be present in the cache when the item is referenced.If the compiler determines that the data item will not be present in the cache, a prefetch instruction is generated and placed before the actual reference in an attempt to hide some of the latency of fetching the item from memory.Several researchers have suggested that software prefetching increases the demand for registers, however this issue has not been fully studied.An experimental study performed as part of this research shows that software prefetching can increase register pressure, often dramatically.A method based upon live variable analysis is provided to estimate register pressure during software prefetching.This estimate is used to detemine the loop transformations which will enable prefetching and prevent large increases in register pressure.The experimental evaluation indicates this technique generally results in less inserted spill code than performing standard software prefetching.