Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/997163.997196acmconferencesArticle/Chapter ViewAbstractPublication PagescpsweekConference Proceedingsconference-collections
Article

Finding effective compilation sequences

Published: 11 June 2004 Publication History

Abstract

Most modern compilers operate by applying a fixed, program-independent sequence of optimizations to all programs. Compiler writers choose a single "compilation sequence", or perhaps a couple of compilation sequences. In choosing a sequence, they may consider performance of benchmarks or other important codes. These sequences are intended as general-purpose tools, accessible through command-line flags such as -O2 and -O3.Specific compilation sequences make a significant difference in the quality of the generated code, whether compiling for speed, for space, or for other metrics. A single universal compilation sequence does not produce the best results over all programs [8, 10, 29, 32]. Finding an optimal program-specific compilation sequence is difficult because the space of potential sequences is huge and the interactions between optimizations are poorly understood. Moreover, there is no systematic exploration of the costs and benefits of searching for good (i.e., within a certain percentage of optimal) program-specific compilation sequences.In this paper, we perform a large experimental study of the space of compilation sequences over a set of known benchmarks, using our prototype adaptive compiler. Our goal is to characterize these spaces and to determine if it is cost-effective to construct custom compilation sequences. We report on five exhaustive enumerations which demonstrate that 80% of the local minima in the space are within 5 to 10% of the optimal solution. We describe three algorithms tailored to search such spaces and report on experiments that use these algorithms to find good compilation sequences. These experiments suggest that properties observed in the enumerations hold for larger search spaces and larger programs. Our findings indicate that for the cost of 200 to 4,550 compilations, we can find custom sequences that are 15 to 25% better than the human-designed fixed-sequence originally used in our compiler.

References

[1]
B. Alpern, M. N. Wegman, and F. K. Zadeck. Detecting equality of variables in programs. In Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages, pages 1--11, San Diego, CA, USA, Jan. 1988.
[2]
S. Baluja and S. Davies. Fast probabilistic modeling for combinatorial optimization. In Proceedings of the 15th International Conference on Artificial Intelligence and 10th Innovative Applications of Artificial Intelligence Conference, pages 469--476, Madison, WI, USA, July 1998. AAAI Press/MIT Press.
[3]
D. Bernstein, D. A. Goldin, M. C. Golumbic, H. Krawczyk, Y. Mansour, I. Nashon, and R. Y. Pinter. Spill code minimization techniques for optimizing compilers. SIGPLAN Notices, 24(7):258--263, July 1989. In Proceedings of the 1989 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI).
[4]
P. Briggs and K. D. Cooper. Effective partial redundancy elimination. SIGPLAN Notices, 29(6):159--170, June 1994. Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation.
[5]
P. Briggs, K. D. Cooper, and L. T. Simpson. Value numbering. Software--Practice and Experience, 27(6):701--724, June 1997.
[6]
G. J. Chaitin, M. A. Auslander, A. K. Chandra, J. Cocke, M. E. Hopkins, and P. W. Markstein. Register allocation via graph coloring. Computer Languages, 6(1):47--57, Jan. 1981.
[7]
K. Chow and Y. Wu. Feedback-directed selection and characterization of compiler optimizations. In Proceedings of the 4th Workshop on Feedback-Directed and Dynamic Optimization (FDDO-4), Dec. 2001.
[8]
K. D. Cooper, P. J. Schielke, and D. Subramanian. Optimizing for reduced code space using genetic algorithms. In 1999 Acm Sigplan Workshop on Languages, Compilers, and Tools for Embedded Systems ( Lctes), pages 1--9, May 1999.
[9]
K. D. Cooper, L. T. Simpson, and C. A. Vick. Operator strength reduction. ACM Transactions on Programming Languages and Systems, 2001. to appear.
[10]
K. D. Cooper, D. Subramanian, and L. Torczon. Adaptive optimizing compilers for the 21st century. Journal of Supercomputing, 21(1):7--22, Aug. 2002.
[11]
K. D. Cooper and L. Torczon. Engineering a Compiler. Morgan-Kaufmann Publishers, 2003.
[12]
K. D. Cooper and T. Waterman. Investigating adaptive compilation using the MIPSPro compiler. In Proceedings of the 2003 Los Alamos Computer Science Institute Symposium. Los Alamos Computer Science Institute (LACSI), Oct. 2003.
[13]
R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems (TOPLAS), 13(4):451--490, Oct. 1991.
[14]
J. W. Davidson and C. W. Fraser. The design and application of a retargetable peephole optimizer. ACM Transactions on Programming Languages and Systems (TOPLAS), 2(2):191--202, Apr. 1980.
[15]
G. E. Forsythe, M. A. Malcolm, and C. B. Moler. Computer Methods for Mathematical Computations. Prentice-Hall, Englewood Cliffs, NJ, USA, 1977.
[16]
M. Frigo. A fast fourier transform compiler. SIGPLAN Notices, 34(5):169--180, May 1999. In Proceedings of the 1999 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI).
[17]
M. Frigo and S. G. Johnson. FFTW: An adaptive software architecture for the FFT. In Proceedings of the 1998 ICASSP Conference, volume 3, pages 1381--1384, 1998.
[18]
E. D. Granston and A. Holler. Automatic recommendation of compiler options. In Proceedings of the 4th Workshop on Feedback-Directed and Dynamic Optimization (FDDO-4), Dec. 2001.
[19]
L. Johnsson. Private communication. Discussion regarding algorithm choice in the Thinking Machine numerical libraries., Oct. 2003.
[20]
T. Kisuki, P. M. Knijnenburg, and M. F. O'Boyle. Combined selection of tile sizes and unroll factors using iterative compilation. In Proceedings of the 2000 International Conference on Parallel Architectures and Compilation Techniques (PACT'00), pages 237--248, Oct. 2000.
[21]
T. Kisuki, P. M. Knijnenburg, M. F. O'Boyle, and H. Wijsho. Iterative compilation in program optimization. In Proceedings of 8th Workshop on Compilers for Parallel Computers, CPC 2000, pages 35--44, Jan. 2000.
[22]
J. Knoop, O. Rüthing, and B. Steffen. Lazy code motion. SIGPLAN Notices, 27(7):224--234, July 1992. Proceedings of the ACM SIGPLAN '92 Conference on Programming Language Design and Implementation.
[23]
P. Kulkarni, W. Zhao, H. Moon, K. Cho, D. Whalley, J. Davidson, M. Bailey, Y. Paek, and K. Gallivan. Finding effective optimization phase sequences. In Proceedings of the 2003 ACM SIGPLAN Conference on Languages, Tools, and Compilers for Embedded Systems, pages 12--23, June 2003.
[24]
G. Marin and J. Mellor-Crummey. Cross-architecture performance predictions for scientific applications using parameterized models. In Proceedings of the Joint International Conference on Measurement and Modeling of Computer Systems, New York, NY, USA, June 2004.
[25]
D. Mirkovic and S. L. Johnsson. Automatic performance tuning in the UHFFT library. In Proceedings of the Interational Conference on Computational Science, May 2001.
[26]
E. Morel and C. Renvoise. Global optimization by suppression of partial redundancies. Communications of the ACM, 22(2):96--103, Feb. 1979.
[27]
B. Selman and S. Kirkpatrick. Critical behavior in the computational cost of satisfiability testing. Artificial Intelligence, 81(1-2):273--295, 1996.
[28]
L. T. Simpson. Value-driven Redundancy Elimination. PhD thesis, Rice University, May 1996.
[29]
S. Triantifyllis, M. Vachharajani, N. Vachharajani, and D. I. August. Compiler optimization-space exploration. In Proceedings of the First International Symposium on Code Generation and Optimization, Mar. 2003.
[30]
M. Wegman and F. K. Zadeck. Constant propagation with conditional branches. ACM Transactions on Programming Languages and Systems, 13(2):181--210, Apr. 1991.
[31]
R. C. Whaley, A. Petitet, and J. J. Dongarra. Automated empirical optimization of software and the ATLAS project. Parallel Computing, 27(1--2):3--25, 2001.
[32]
D. L. Whitfield and M. L. Soffa. An approach for exploring code improving transformations. ACM Transactions on Programming Languages and Systems (TOPLAS), 19(6):1053--1084, Nov. 1997.
[33]
M. Zhao, B. Childers, and M. L. Soffa. Predicting the impact of optimizations for embedded systems. In Proceedings of the 2003 ACM SIGPLAN Conference on Languages, Tools, and Compilers for Embedded Systems, pages 1--11, June 2003.

Cited By

View all
  • (2022)Machine-Learning-Based Self-Optimizing Compiler Heuristics✱Proceedings of the 19th International Conference on Managed Programming Languages and Runtimes10.1145/3546918.3546921(98-111)Online publication date: 14-Sep-2022
  • (2021)Iterative Compilation Optimization Based on Metric Learning and Collaborative FilteringACM Transactions on Architecture and Code Optimization10.1145/348025019:1(1-25)Online publication date: 6-Dec-2021
  • (2021)Predictive data locality optimization for higher-order tensor computationsProceedings of the 5th ACM SIGPLAN International Symposium on Machine Programming10.1145/3460945.3464955(43-52)Online publication date: 21-Jun-2021
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
LCTES '04: Proceedings of the 2004 ACM SIGPLAN/SIGBED conference on Languages, compilers, and tools for embedded systems
June 2004
276 pages
ISBN:1581138067
DOI:10.1145/997163
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 39, Issue 7
    LCTES '04
    July 2004
    265 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/998300
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 June 2004

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. adaptive compilers
  2. learning models

Qualifiers

  • Article

Conference

LCTES04

Acceptance Rates

Overall Acceptance Rate 116 of 438 submissions, 26%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)31
  • Downloads (Last 6 weeks)2
Reflects downloads up to 12 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2022)Machine-Learning-Based Self-Optimizing Compiler Heuristics✱Proceedings of the 19th International Conference on Managed Programming Languages and Runtimes10.1145/3546918.3546921(98-111)Online publication date: 14-Sep-2022
  • (2021)Iterative Compilation Optimization Based on Metric Learning and Collaborative FilteringACM Transactions on Architecture and Code Optimization10.1145/348025019:1(1-25)Online publication date: 6-Dec-2021
  • (2021)Predictive data locality optimization for higher-order tensor computationsProceedings of the 5th ACM SIGPLAN International Symposium on Machine Programming10.1145/3460945.3464955(43-52)Online publication date: 21-Jun-2021
  • (2021)An Experience with Code-Size Optimization for Production iOS Mobile Applications2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO)10.1109/CGO51591.2021.9370306(363-377)Online publication date: 27-Feb-2021
  • (2020)Tensor Optimization for High-Level Synthesis Design FlowsIEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems10.1109/TCAD.2020.3012318(1-1)Online publication date: 2020
  • (2020)ML-based Clang optimization passes selection for binary code size reduction2020 Ivannikov Ispras Open Conference (ISPRAS)10.1109/ISPRAS51486.2020.00013(40-45)Online publication date: Dec-2020
  • (2020)Machine Learning in Compilers: Past, Present and Future2020 Forum for Specification and Design Languages (FDL)10.1109/FDL50818.2020.9232934(1-8)Online publication date: 15-Sep-2020
  • (2019)“It looks like you’re writing a parallel loop”: a machine learning based parallelization assistantProceedings of the 6th ACM SIGPLAN International Workshop on AI-Inspired and Empirical Methods for Software Engineering on Parallel Computing Systems10.1145/3358500.3361567(1-10)Online publication date: 22-Oct-2019
  • (2019)Epona and the Obfuscation ParadoxProceedings of the 3rd ACM Workshop on Software Protection10.1145/3338503.3357722(41-52)Online publication date: 15-Nov-2019
  • (2018)Bridging the gap between deep learning and sparse matrix format selectionACM SIGPLAN Notices10.1145/3200691.317849553:1(94-108)Online publication date: 10-Feb-2018
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media