It is interesting to compare prefetching with locality optimizations since both techniques rely on essentially the same locality analysis to predict cache misses. Despite this commonality, the two techniques differ in many ways. Locality optimizations reduce latency, unlike prefetching which tolerates latency; from this perspective, locality optimizations appear to be more desirable since they can also reduce bandwidth consumption. However, locality optimizations appear to be more limited in their applicability, as evidenced by the fact that they improved only two of our 13 benchmarks. Intuitively, this is because not only must the locality optimizing algorithm recognize a better way to structure the code (which is not always possible), it must also be legal to perform this restructuring. Prefetching, on the other hand, is never restricted by such correctness issues, and therefore appears to have wider applicability.
These results have demonstrated the complementary interactions that can occur between locality optimizations and prefetching. Locality optimizations help prefetching by reducing the amount of data that needs to be prefetched, and prefetching further increases performance by hiding any latency that could not be eliminated.