TY - GEN
T1 - A study of conflicting pairs of compiler optimizations
AU - Asher, Yosi Ben
AU - Haber, Gadi
AU - Stein, Esti
N1 - Publisher Copyright:
© 2017 IEEE.
PY - 2017/7/2
Y1 - 2017/7/2
N2 - 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.
AB - 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.
KW - LLVM
KW - Optimized Sequence of optimizations
KW - compilers
UR - http://www.scopus.com/inward/record.url?scp=85049731172&partnerID=8YFLogxK
U2 - 10.1109/MCSoC.2017.31
DO - 10.1109/MCSoC.2017.31
M3 - ???researchoutput.researchoutputtypes.contributiontobookanthology.conference???
AN - SCOPUS:85049731172
T3 - Proceedings - IEEE 11th International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017
SP - 52
EP - 58
BT - Proceedings - IEEE 11th International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017
T2 - 11th IEEE International Symposium on Embedded Multicore/Many-Core Systems-on-Chip, MCSoC 2017
Y2 - 18 September 2017 through 20 September 2017
ER -