Alocação de registradores desacoplada baseada em coloração de grafos com compartilhamento hierárquico

=== Recent results have shown how to do graph-coloring-based register allocation in a way that decouples spilling from register assignment. This decoupled approach has two main advantages: rst, it simplies register allocation algorithms. Second, it might keep more variables in registers, instead of...

Full description

Bibliographic Details
Main Author: Andre Luiz Camargos Tavares
Other Authors: Mariza Andrade da Silva Bigonha
Format: Others
Language:Portuguese
Published: Universidade Federal de Minas Gerais 2011
Online Access:http://hdl.handle.net/1843/SLSS-8GPQJ2
Description
Summary:=== Recent results have shown how to do graph-coloring-based register allocation in a way that decouples spilling from register assignment. This decoupled approach has two main advantages: rst, it simplies register allocation algorithms. Second, it might keep more variables in registers, instead of sending them to memory. In spite of these advantages, the decoupled model using the graph coloring approach, as described in previous works, do not handle register aliasing, a phenomenon present in architectures such as x86, ARM and Sparc. An important obstacle is the fact that existing decoupled algorithms have to perform extensive live range splitting to deal with aliasing, increasing the input graphs by a quadratic factor. Such allocators would be inecient in terms of memory consumption, compilation time and the quality of the code they produce.In this thesis we introduce a number of techniques that overcome this obstacle. We describe a spill test that deals with aliasing better than Kempe's traditional simpli cation test. We use heuristics to merge or rather avoid splitting live ranges whenever possible, and we adapt well-known coalescing tests to the world of aliased registers. In order to determine the best interference representation for the techniques, we have studied the following options: Single Static Assignment (SSA), Single Static Information (SSI), extended SSA (e-SSA) and Elementary Form. In this process we have developed an algorithm to eficiently create SSI and e-SSA. We have empirically validated our results by showing how our techniques improve two well known graph coloring based allocators that deal with aliased registers, namely Smith et al.'s extension [SRH04] of the Iterated Register Coalescer (IRC) [GA96], and Bouchez et al.'s brute force (BF) method [BDR08]. Running our techniques on a subset SPEC CPU 2000, we have been able to reduce the size of the interference graphs that the allocators would require by a factor of 4, and we have improved the quality of IRC, in terms of proportion of copies left in the assembly program, from 1.5% to 0.54%. === Resultados recentes demonstram como fazer alocação de registradores baseada em coloração de grafos que desacopla o derramamento da atribuição de registradores. A abordagem desacoplada tem duas vantagens: primeiro, simplifica os algoritmos de alocação de registradores. Segundo, pode-se manter mais variáveis em registradores, em vez de enviá-los para a memória. Apesar destas vantagens, o modelo desacoplado, como descrito por trabalhos anteriores, não leva em consideração o compartilhamento de registradores, um fenômeno presente em arquiteturas como x86, ARM e SPARC. Um obstáculo importante é o fato de que os algoritmos desacoplados existentes fazem uma extensiva divisão do tempo de vida das variáveis para tratar de compartilhamento, o que aumenta os grafos de entrada por um fator quadrático. Tais alocadores são ineficientes em termos de consumo de memória, tempo de compilação e qualidade de código produzido. Esta dissertação introduz técnicas para contornar este obstáculo.