Beta 1

Title Phase-ordering in optimizing compilers
Author Queva, Matthieu Stéphane Benoit (Language-Based Technology, Department of Informatics and Mathematical Modeling, Technical University of Denmark, DTU, DK-2800 Kgs. Lyngby, Denmark)
Institution Technical University of Denmark, DTU, DK-2800 Kgs. Lyngby, Denmark
Thesis level Master's thesis
Year 2007
Abstract The “quality” of code generated by compilers largely depends on the analyses and optimizations applied to the code during the compilation process. While modern compilers could choose from a plethora of optimizations and analyses, in current compilers the order of these pairs of analyses/transformations is fixed once and for all by the compiler developer. Of course there exist some flags that allow a marginal control of what is executed and how, but the most important source of information regarding what analyses/optimizations to run is ignoredthe source code. Indeed, some optimizations might be better to be applied on some source code, while others would be preferable on another. A new compilation model is developed in this thesis by implementing a Phase Manager. This Phase Manager has a set of analyses/transformations available, and can rank the different possible optimizations according to the current state of the intermediate representation. Based on this ranking, the Phase Manager can decide which phase should be run next. Such a Phase Manager has been implemented for a compiler for a simple imperative language, the while language, which includes several Data-Flow analyses. The new approach consists in calculating coefficients, called metrics, after each optimization phase. These metrics are used to evaluate where the transformations will be applicable, and are used by the Phase Manager to rank the phases. The metrics are calculated using a new algorithm that approximates the dataflow analyses for the while language. This algorithm skims through the intermediate representation of the program only once, and thus solves the analyses’ equations faster than classical worklist algorithms. In order to evaluate the metric-based approach, a benchmark suite is created. This suite generates a large amount of regular expressions that express various orders of optimizations. The metric-based phase-ordering is applied on several benchmark programs and compared to the best regular expression on each of these programs. Finally, this thesis considers the interactions between the transformations considered, as well as the effects of these transformations on the size and speed of the program to improve the metric-based algorithm. The resulting versions of the phase-ordering mechanism are then evaluated using the benchmark suite.
Imprint Technical University of Denmark (DTU) : Kgs. Lyngby, Denmark
Pages 177
Series IMM-MSC-2007-71
Keywords optimizing compiler; static analysis; data flow analysis
Original PDF imm5406.pdf (3.46 MB)
Admin Creation date: 2010-04-07    Update date: 2010-04-07    Source: dtu    ID: 259692    Original MXD