Since the mid-1990s, researchers have been trying to use machine-learning based approaches to solve a number of di erent compiler optimization problems. These techniques primarily enhance the quality of the obtained results and, more importantly, make it feasible to tackle two main compiler optimization problems: optimization selection (choosing which optimizations to apply) and phase-ordering (choosing the order of applying optimizations). The compiler optimization space continues to grow due to the advancement of applications, increasing number of compiler optimizations, and new target architectures. Generic optimization passes in compilers cannot fully leverage newly introduced optimizations and, therefore, cannot keep up with the pace of increasing options. This survey summarizes and classi es the recent advances in using machine learning for the compiler optimization eld, particularly on the two major problems of (1) selecting the best optimizations, and (2) the phase-ordering of optimizations. The survey highlights the approaches taken so far, the obtained results, the ne-grain classi cation among di erent approaches and nally, the in uential papers of the eld.
A. H. Ashouri et al.unrolling, register allocation, etc.) could substantially bene t several performance metrics. Depending on the objectives, these metrics could be execution time, code size, or power consumption. A holistic exploration approach to trade-o these metrics also represents a challenging problem [193].Autotuning [35,256] addresses automatic code-generation and optimization by using di erent scenarios and architectures. It constructs techniques for automatic optimization of di erent parameters to maximize or minimize the satis ability of an objective function. Historically, several optimizations were done in the backend where scheduling, resource-allocation and code-generation are done [56,93]. The constraints and resources form a linear system (ILP) which needs to be solved. Recently, researchers have shown increased e ort in introducing front-end and IR-optimizations. Two observations support this claim: (1) the complexity of a backend compiler requires exclusive knowledge strictly by the compiler designers, and (2) lower overheads with external compiler modi cation compared with back-end modi cations. The IR-optimization process normally involves ne-tuning compiler optimization parameters by a multi-objective optimization formulation which can be harder to explore. Nonetheless, each approach has its bene ts and drawbacks and are subject to analysis under their scope.A major challenge in choosing the right set of compiler optimizations is the fact that these code optimizations are programming language, application, and architecture dependent. Additionally, the word optimization is a misnomer -there is no guarantee the transformed code will perform better than the original version. In fact, aggressive optimizations can even degrade the performance of the code to which they are applied [251]. Understanding the behavior of the optimization...