Improving data locality in programs which manipulate arrays has been the subject of a great deal of research. Much of the
work on improving data locality examines individual loop nests; other work includes transformations such as loop fusion, which
combines loops so that multiple loop nests can be transformed as a single loop nest. We propose a data-driven method to optimize
locality across multiple loop nests. Our technique achieves loop fusion-like results even when normal loop fusion is illegal
without enabling transformations. Given an array whose locality should be optimized, it also finds other calculations that
can profitably be executed with the computation of that array.