Improving data locality with loop transformations
Kathryn S. McKinley, Steve Carr, Chau‐Wen Tseng · ACM Transactions on Programming Languages and Systems · 1996
In the past decade, processor speed has become significantly faster than memory speed. Small, fast cache memories are designed to overcome this discrepancy, but they are only effective when programs exhibit data locality . In the this article, we present compiler optimizations to improve data locality based on a simple yet accurate cost model. The model computes both temporal and spatial reuse of cache lines to find desirable loop organizations. The cost model drives the application of compound transformations consisting of loop permutation, loop fusion, loop distribution, and loop reversal. To validate our optimization strategy, we implemented our algorithms and ran experiments on a large collection of scientific programs and kernels. Experiments illustrate that for kernels our model and algorithm can select and achieve the best loop structure for a nest. For over 30 complete applications, we executed the original and transformed versions and simulated cache hit rates. We collected statistics about the inherent characteristics of these programs and our ability to improve their data locality. To our knowledge, these studies are the first of such breadth and depth. We found performance improvements were difficult to achieve bacause benchmark programs typically have high hit rates even for small data caches; however, our optimizations significanty improved several programs.
Cited by 551 works. doi:10.1145/233561.233564 Open-access PDF
Authors
References
- Dependence graphs and compiler optimizations
- Automatic translation of FORTRAN programs to vector form
- A data locality optimizing algorithm
- The cache performance and optimizations of blocked algorithms
- Strategies for cache and local memory management by global program transformation
- Supernode partitioning
- Proceedings of the 2000 International Conference on Parallel Processing
- Improving register allocation for subscripted variables
- Automatic loop interchange
- Proceedings SUPERCOMPUTING '90