[LLVMdev] Live range splitting with Ising models

Rafael Espíndola rafael.espindola at gmail.com
Thu Aug 8 08:24:43 PDT 2013


On 7 August 2013 17:06, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
> With the D-Wave computer in the news recently, you may find it interesting that LLVM’s register allocator is using Ising models to compute regions for live range splitting.
>
> The problem of finding a region for splitting a live range is mapped to an Ising model with the help of the edge bundle graph, see EdgeBundles.h. A node in the edge bundle graph represents a set of CFG edges that enter or leave the same basic block, see also ‘llc -view-edge-bundles’.
>
> A region for splitting a live range can be described as a coloring of the edge bundle graph, such that ‘spin up’ means that the live range should go in a register through this bundle, and ‘spin down’ means that the live range should go on the stack. The connections between edge bundle nodes correspond to basic blocks, and we give each connection a weight that is the expected execution frequency of the corresponding basic block. This means that the ‘energy’ of a solution is the same as the total expected execution frequency of the spill code required to implement the live range split. The optimal split region is the ‘ground state’ of the Ising model.

Thanks for the information. Is this done iteratively? I.E., we solve a
ising model every time we cannot assign a register to a range and want
to decide if we should split one of the already assigned ranges?

Cheers,
Rafael




More information about the llvm-dev mailing list