A Study of Conflicting Pairs of Compiler Optimizations

Yosi Ben-Asher,Gadi Haber,Esti Stein

2017 IEEE 11th International Symposium on Embedded Multicore/Many-core Systems-on-Chip (MCSoC)(2017)

引用 1|浏览7
暂无评分
摘要
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 $\cal{S}$ of all possible optimization sequences. These works proposed various heuristic techniques to search $\cal{S}$ by reducing the number of $s\in \cal{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\in \cal{S}$. Instead, we build a directed conflict graph $G$ witha weighted directed edge $x\nxt{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\nxt{g_i} y,~y\nxt{g_j} z, x\nxt{g_k} z$ that form a triangleand contracting them to a new edge $x\nxt{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.
更多
查看译文
关键词
Optimized Sequence of optimizations,compilers,LLVM
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要