Estratégias para exploração de sequências de transformações do compilador - Fabrício Filho, João (2017)
Compilers aims to translate a source language program to a target language, usually a machine language. Find the best correspondence between programming languages is a complex problem, due to the size of search space. Because of this complexity, a code transformation step is needed, where transformation algorithms modify the code, trying to improve it without semantic alterations. Despite, the result of the application of these algorithms depends on code particularities. The Transformations Selection Problem (TSP) consists of the search for the best transformations to an input code, such that target code achieves a good performance. The state-of-art does not have strategies that allow the application of TSP solutions to final users, because the response time is very high to this. This work aims to formulate techniques to find effective transformations sequences to be applied to an input code, in a way to increase programs performance reducing its execution time. Furthermore, another objective is to reduce the compiler response time, to approximate a TSP solution to final users application. Initially, the metaheuristic Variable Neighborhood Search (VNS) is explored to solve TSP, compiling iteratively each input code. VNS achieved results up to 15.72% better than another iterative strategy, reaching improvement for all evaluated programs compared to the best compiler transformation level. However, the iterative compilation demands a high response time. Therefore, it is necessary to explore machine learning techniques, which can provide good results based on compiler previous experiences, with a cost of an initial training phase. Thus, this work explores different program characterizations to represent the cumulated knowledge on transformations application, to formulate a code generation system with Case-Based Reasoning (CBR), which chooses certain sequence to an input program. The knowledge representation is capable to reach 81% of proximity of the best possible result to evaluated programs, while the CBR system generates results 13.74% better than -O3 level, on a response time 99% lower than iterative compilation techniques. The improvement of previous experiences recovering method obtained performances over 20.23% compared to another strategy with a close evaluations number.