Abstract
Nowadays compilers include tens or hundreds of optimization passes, which makes it difficult to find sequences of optimizations that achieve compiled code more optimized than the one obtained using typical compiler options such as -O2 and -O3. The problem involves both the selection of the compiler passes to use and their ordering in the compilation pipeline. The improvement achieved by the use of custom phase orders for each function can be significant, and thus important to satisfy strict requirements such as the ones present in high-performance embedded computing systems. In this paper we present a new and fast iterative approach to the phase selection and ordering challenges resulting in compiled code with higher performance than the one achieved with the standard optimization levels of the LLVM compiler. The obtained performance improvements are comparable with the ones achieved by other iterative approaches while requiring considerably less time and resources. Our approach is based on sampling over a graph representing transitions between compiler passes. We performed a number of experiments targeting the LEON3 microarchitecture using the Clang/LLVM 3.7 compiler, considering 140 LLVM passes and a set of 42 representative signal and image processing C functions. An exhaustive cross-validation shows our new exploration method is able to achieve a geometric mean performance speedup of 1.28x over the best individually selected -OX flag when considering 100,000 iterations; versus geometric mean speedups from 1.16x to 1.25x obtained with state-of-the-art iterative methods not using the graph. From the set of exploration methods tested, our new method is the only one consistently finding compiler sequences that result in performance improvements when considering 100 or less exploration iterations. Specifically, it achieved geometric mean speedups of 1.08x and 1.16x for 10 and 100 iterations, respectively.
- GCC, the GNU Compiler Collection, https://www.gnu.org/software/gcc/.Google Scholar
- Lelac Almagor, Keith D. Cooper, Alexander Grosul, Timothy J. Harvey, Steven W. Reeves, Devika Subramanian, Linda Torczon, and Todd Waterman, 2004. Finding effective compilation sequences. SIGPLAN Not. 39, 7, 231-239. Google Scholar
Digital Library
- Yang Chen, Shuangde Fang, Yuanjie Huang, Lieven Eeckhout, Grigori Fursin, Olivier Temam, and Chengyong Wu, 2012. Deconstructing iterative optimization. ACM Transactions on Architecture and Code Optimization (TACO). 9, 3, 1-30. Google Scholar
Digital Library
- Ricardo Nobre, 2013. Identifying sequences of optimizations for HW/SW compilation. In 23rd International Conference on Field Programmable Logic and Applications (FPL), 2013, 1-2.Google Scholar
Cross Ref
- Luiz G.A. Martins, Ricardo Nobre, Alexandre C.B. Delbem, Eduardo Marques, and Jo˜ao M.P. Cardoso, 2014. Exploration of compiler optimization sequences using clustering-based selection. In ACM Proc. 2014 SIGPLAN/SIGBED conference on Languages, compilers and tools for embedded systems (LCTES), 63-72. Google Scholar
Digital Library
- Ricardo Nobre, Luiz G.A. Martins, and Jo˜ao M.P. Cardoso, 2015. Use of Previously Acquired Positioning of Optimizations for Phase Ordering Exploration. In Proc. 18th International Workshop on Software and Compilers for Embedded Systems (SCOPES ’15) (Schloss Rheinfels, St. Goar, Germany, June 1-3, 2015). Google Scholar
Digital Library
- Amir H. Ashouri, Giovanni Mariani, Gianluca Palermo, and Cristina Silvano, 2014. A Bayesian network approach for compiler autotuning for embedded processors. In IEEE 12th Symposium on Embedded Systems for Real-time Multimedia (ESTIMedia), 2014, 90- 97.Google Scholar
Cross Ref
- Aeroflex Gaisler, LEON3 Processor, http://www.gaisler.com/index.php/products/processors/leon3.Google Scholar
- Aeroflex, TSIM2 ERC32/LEON simulator, http://www.gaisler.com/index.php/products/simulators/tsim.Google Scholar
- Texas Instruments, 2008. TMS320C64x+ DSP Little-Endian Library Programmer’s Reference (Rev. B).Google Scholar
- Texas Instruments, 2008. TMS320C64x+ DSP Image/Video Processing Library (v2.0) Programmer’s Reference (Rev. A).Google Scholar
- Luiz G. A. Martins, Ricardo Nobre, Jo˜ao M.P. Cardoso, Alexandre C.B. Delbem, and Eduardo Marques. Clustering-Based Selection for the Exploration of Compiler Optimization Sequences. ACM Trans. Archit. Code Optim. 13, 1, Article 8 (March 2016), 28 pages. Google Scholar
Digital Library
- Huang Qijing, Ruolong Lian, Andrew Canis, Jongsok Choi, Ryan Xi, Nazanin Calagar, Stephen Brown, Jason Anderson, 2013. The Effect of Compiler Optimizations on High-Level Synthesis for FPGAs. In IEEE 21st Annual International Symposium on Field-Programmable Custom Computing Machines (FCCM), 2013, 89-96. Google Scholar
Digital Library
- Jo˜ao M.P. Cardoso, Tiago Carvalho, Jos G.F. Coutinho, Wayne Luk, Ricardo Nobre, Pedro Diniz, and Zlatko Petrov, 2012. LARA: an aspect-oriented programming language for embedded systems. In Proceedings of the 11th annual international conference on Aspectoriented Software Development (Potsdam, Germany, 2012), ACM, 2162071, 179-190. Google Scholar
Digital Library
- Ricardo Nobre, Jo˜ao M.P. Cardoso, Bryan Olivier, Razvan Nane, Liam Fitzpatrick, Jos Gabriel de F. Coutinho, Hans van Someren, Vlad-Mihai Sima, Koen Bertels, and Pedro C. Diniz, 2013. Hardware/Software Compilation. In Compilation and Synthesis for Embedded Reconfigurable Systems, J.M.P. Cardoso, P.C. Diniz, J.G.F. Coutinho and Z.M. Petrov Eds. Springer New York, 105-134.Google Scholar
- clang: a C language family frontend for LLVM, http://clang.llvm.org/.Google Scholar
- The LLVM Compiler Infrastructure, http://llvm.org/.Google Scholar
- David E. Goldberg, Genetic Algorithms in Search, Optimization and Machine Learning, 1st ed., Addison-Wesley Longman, 1989. Google Scholar
Digital Library
- Scott Kirkpatrick, C. D. Gelat, Mario P. Vecchi. Optimization by simulated annealing. Science 220, 671-680 (1983).Google Scholar
- Keith D. Cooper, Alexander Grosul, Timothy J. Harvey, Steve Reeves, Devika Subramanian, Linda Torczon, and Todd Waterman, 2006. Exploring the structure of the space of compilation sequences using randomized search algorithms. The Journal of Supercomputing 36, 2 (2006/05/01), 135-151. Google Scholar
Digital Library
- Prasad A. Kulkarni, Stephen R. Hines, David B. Whalley, Jason D. Hiser, Jack W. Davidson, and Douglas L. Jones, 2004. Fast searches for effective optimization phase sequences. SIGPLAN Not. 39, 6, 171-182. Google Scholar
Digital Library
- Prasad A. Kulkarni, David B. Whalley, Gary S. Tyson, and Jack W. Davidson, 2009. Practical exhaustive optimization phase order exploration and evaluation. ACM Trans. Archit. Code Optim. 6, 1, 1-36. Google Scholar
Digital Library
- Prasad A. Kulkarni, Michael R. Jantz, and David B. Whalley, 2010. Improving both the performance benefits and speed of optimization phase sequence searches. SIGPLAN Not. 45, 4, 95-104. Google Scholar
Digital Library
- Suresh Purini and Lakshya Jain, 2013. Finding good optimization sequences covering program space. ACM Trans. Archit. Code Optim. 9, 4, 1-23. Google Scholar
Digital Library
- Michael R. Jantz and Prasad A. Kulkarni, 2013. Performance potential of optimization phase selection during dynamic JIT compilation. SIGPLAN Not. 48, 7, 131-142. Google Scholar
Digital Library
- Felix Agakov, Edwin Bonilla, John Cavazos, Björn Franke, Grigori Fursin, Michael F.P. O’Boyle, John Thomson, Marc Toussaint, and Christopher K.I. Williams, 2006. Using Machine Learning to Focus Iterative Optimization. In Proc. International Symposium on Code Generation and Optimization (2006), IEEE Computer Society, 1122412, 295-305. Google Scholar
Digital Library
- Grigori Fursin, Yuriy Kashnikov, Abdul Wahid Memon, Zbigniew Chamski, Olivier Temam, Mircea Namolaru, Elad Yom-Tov, Bilha Mendelson, Ayal Zaks, Eric Courtois, Francois Bodin, Phil Barnard, Elton Ashton, Edwin Bonilla, John Thomson, Christopher K. I. Williams, and Michael OBoyle, 2011. Milepost GCC: Machine Learning Enabled Self-tuning Compiler. International Journal of Parallel Programming 39, 3 (2011/06/01), 296-327.Google Scholar
Cross Ref
- Gene Sher, Kyle Martin, and Damian Dechev, 2014. Preliminary results for neuroevolutionary optimization phase order generation for static compilation. In Proc. 11th Workshop on Optimizations for DSP and Embedded Systems (Orlando, Florida, USA, 2014), ACM, 33- 40. Google Scholar
Digital Library
Index Terms
A graph-based iterative compiler pass selection and phase ordering approach
Recommendations
Predictive modeling methodology for compiler phase-ordering
PARMA-DITAM '16: Proceedings of the 7th Workshop on Parallel Programming and Run-Time Management Techniques for Many-core Architectures and the 5th Workshop on Design Tools and Architectures For Multicore Embedded Computing PlatformsToday's compilers offer a huge number of transformation options to choose among and this choice can significantly impact on the performance of the code being optimized. Not only the selection of compiler options represents a hard problem to be solved, ...
A graph-based iterative compiler pass selection and phase ordering approach
LCTES 2016: Proceedings of the 17th ACM SIGPLAN/SIGBED Conference on Languages, Compilers, Tools, and Theory for Embedded SystemsNowadays compilers include tens or hundreds of optimization passes, which makes it difficult to find sequences of optimizations that achieve compiled code more optimized than the one obtained using typical compiler options such as -O2 and -O3. The ...
NOREBA: a compiler-informed non-speculative out-of-order commit processor
ASPLOS '21: Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating SystemsModern superscalar processors execute instructions out-of-order, but commit them in program order to provide precise exception handling and safe instruction retirement. However, in-order instruction commit is highly conservative and holds on to critical ...







Comments