## Abstract

Modern compilers use dozens of optimizations which are typically applied serially one after the other and at the same order. Theoretically, for a given program, some of these optimizations, and the order in which they areapplied, can degrade the performance or produce suboptimal performance. In this work we formally define the problem of finding an optimized sequence of optimizations (OSO) for a given programbased on information on conflicting pairs of optimizations alone. Previous works studied heuristic search algorithmscovering the space S of all possible optimization sequences. These works proposed various heuristic techniques to search S by reducing the number of s ϵ S that need to be evaluated (compiled and executed). In this work we show, for the first time, an algorithmic solutionto this problem of finding an OSO. We do not search or evaluate sequences s ϵ S. Instead, we build a directed conflict graph G witha weighted directed edge x →g y between every pair of optimizations x,y wherein g is the outcomeof applying optimization y after optimization x compared to applying only x or y alone. The optimal OSO is therefore a directed sub-path in G with the maximal sum of triangle weights over all other sub-paths in G. The proposed algorithm uses transitive closure steps done by selecting every three edges x→g_{i} y, y→g_{j} z, →g_{k} z that form a triangleand contracting them to a new edge x → g=f(g_{i},g_{j},g_{k}) z. By selecting the triangle with maximal g' in every step, the algorithm findsthe maximal OSO including repetitions. This technique was implemented in the LLVM compiler and applied to 9 programs from SPEC 2006. The resulting OSOs obtained and average of 10\% improvement in execution time compare to using the -O3 optimizations sequence. This is the first algorithmic solution to this problem and the first technique that can handle repetitions of optimizations in thecompilation sequence.

Original language | English |
---|---|

Title of host publication | Proceedings - IEEE 11th International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017 |

Publisher | Institute of Electrical and Electronics Engineers Inc. |

Pages | 52-58 |

Number of pages | 7 |

ISBN (Electronic) | 9781538634417 |

DOIs | |

State | Published - 26 Mar 2018 |

Event | 11th IEEE International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017 - Seoul, Korea, Republic of Duration: 18 Sep 2017 → 20 Sep 2017 |

### Publication series

Name | Proceedings - IEEE 11th International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017 |
---|---|

Volume | 2018-January |

### Conference

Conference | 11th IEEE International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017 |
---|---|

Country/Territory | Korea, Republic of |

City | Seoul |

Period | 18/09/17 → 20/09/17 |

### Bibliographical note

Publisher Copyright:© 2017 IEEE.

## Keywords

- LLVM
- Optimized Sequence of optimizations
- compilers

## ASJC Scopus subject areas

- Safety, Risk, Reliability and Quality
- Hardware and Architecture
- Signal Processing