A study of conflicting pairs of compiler optimizations

Yosi Ben Asher, Gadi Haber, Esti Stein

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

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→gi y, y→gj z, →gk z that form a triangleand contracting them to a new edge x → g=f(gi,gj,gk) 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 languageEnglish
Title of host publicationProceedings - IEEE 11th International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages52-58
Number of pages7
ISBN (Electronic)9781538634417
DOIs
StatePublished - 2 Jul 2017
Event11th IEEE International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017 - Seoul, Korea, Republic of
Duration: 18 Sep 201720 Sep 2017

Publication series

NameProceedings - IEEE 11th International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017
Volume2018-January

Conference

Conference11th IEEE International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017
Country/TerritoryKorea, Republic of
CitySeoul
Period18/09/1720/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

Fingerprint

Dive into the research topics of 'A study of conflicting pairs of compiler optimizations'. Together they form a unique fingerprint.

Cite this