{'fraction_non_alphanumeric': 0.014354066985645933, 'fraction_numerical': 0.0, 'mean_word_length': 5.45945945945946, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Reordering and storage optimizations for scientific programs

We present the design and implementation of compiler optimizations that choreograph the use of data in scientific programs. Scientific programs often include multiple loops over the same data, where completing each loop before starting the next discards opportunities for fine-grained data reuse. Interleaving parts of different loops may greatly improve performance. Our approach combines reordering optimizations such as loop fusion and tiling with storage optimizations such as eliminating or reducing the size of temporary arrays. 
The programmers we have in mind are willing to spend some time tuning their code and their compiler parameters. Given that, and the difficulty in statically selecting parameters such as tile sizes, it makes sense to provide automatic parameter searching alongside the compiler. Furthermore, including automatic parameter searching logically leads one to include more aggressive and speculative optimizing transformations in the compiler. Our strategy is to optimize aggressively but to expose the compiler's decisions to external control. Since we expect to generate numerous executables during the tuning process, optimizations that may pay off are relatively more important. 
Our implementation is in a library invoked from tc, a compiler for the Titanium language. We give an overview of Titanium and tc, describe our reordering and storage optimizations, and present experimental results with and without parameter search. We double or triple the performance of Gauss-Seidel relaxation and multigrid, and we argue that ours is the best compiler for that kind of program.