摘要:Compilers must make choices between different optimizations; in this paper we present an analytic cost model thatcan be used to compare several compile-time optimizations for memory-intensive, matrix-based codes. These optimiza-tions increase the spatial locality of references to improve cache hierarchy performance. Specifically, we consider looptransformations, array restructuring, and address remapping, as well as combinations thereof. Our cost model comparesthe effectiveness of these optimizations and provides a good basis for deciding which optimization to use.To evaluate the cost model and the decisions taken based on it, we simulate eight applications on a variety of inputsizes and with a variety of manually applied restructuring optimizations. We find that a single fixed strategy deliverssuboptimal performance, and that it is necessary to adjust the chosen optimization to each code. Our model generallypredicts the best combination of restructuring optimizations among those we examined. The set of best optimizationsunder our model yields performance within a geometric mean of 5% of the best combination of candidate optimizations,regardless of the benchmark or its input dataset size