Abstract-We present a framework which effectively combines programmable control by developers, advanced optimization by compilers, and flexible parameterization of optimizations to achieve portable high performance. We have extended ROSE, a C/C++/Fortran source-to-source optimizing compiler, to automatically analyze scientific applications and discover optimization opportunities. Instead of directly generating optimized code, our optimizer produces parameterized scripts in POET, an interpreted program transformation language, so that developers can freely modify the optimization decisions by the compiler and add their own domain-specific optimizations if necessary. The auto-generated POET scripts support extra optimizations beyond those available in the ROSE optimizer. Additionally, all the optimizations are parameterized at an extremely fine granularity, so the scripts can be ported together with their input code and automatically tuned for different architectures. Our results show that this approach is highly effective, and the code optimized by the auto-generated POET scripts can significantly outperform those optimized using the ROSE optimizer alone.
I. INTRODUCTIONCompiler optimization is critical for scientific applications to automatically achieve high performance on modern computers. However, due to the excessive complexity, compilers have lagged behind in precisely modeling the behaviors of applications running on diverse architectures. While computational specialists can adopt low-level programing in C or assembly to directly manage machine resources and can parameterize their algorithm implementations to accommodate architectural diversity [21], [2], [20], [7], [15], this approach is extremely error prone and time consuming, and compiler technology needs to be developed to automate the process.We present a framework, shown in Fig. 1, to reach a balance between direct control of resources by programmers and automation of optimization by compilers. This framework starts with a specialized source-to-source optimizing compiler (the ROSE analysis engine) which interacts with developers to automatically discover applicable optimizations and then produces output in a transformation scripting language, POET [25]. Developers can modify the auto-generated POET scripts as well as writing new POET transformations to directly control the optimization of applications. The POET output can then be ported together with an annotated input program to different machines, where an empirical transformation engine can dynamically interpret the POET scripts with different optimization configurations until satisfactory performance is achieved for the input code.