Compiler Optimizations for Improving Data Locality
Document Type
Article
Publication Date
1-11-1994
Abstract
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 this paper, 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. We demonstrate that these program transformations are useful for optimizing many programs. To validate our optimization strategy, we implemented our algorithms and ran experiments on a large collection of scientific programs and kernels. Experiments with kernels illustrate that our model and algorithm can select and achieve the best performance. For over thirty 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 because benchmark programs typically have high hit rates even for small data caches; however, our optimizations significantly improved several programs. © 1994, ACM. All rights reserved.
Publication Title
ACM SIGPLAN Notices
Recommended Citation
Carr, S.,
McKinley, K.,
&
Tseng, C.
(1994).
Compiler Optimizations for Improving Data Locality.
ACM SIGPLAN Notices,
29(11), 252-262.
http://doi.org/10.1145/195470.195557
Retrieved from: https://digitalcommons.mtu.edu/michigantech-p/12514