<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hello to all LLVM developers.<br><br>I'm developing a register allocator using LLVM, my allocator has a local search phase: given a solution (assignment of virtual registers to physical registers or memory) generated in the first phase of the algorithm, some movements are applied to this solution in order to find a better solution. To apply such movements, I need to unassign a virtual register from a physical register and one from the memory, and swap those two. To unassign from a physical register, the method <b>unassign</b> from the <b><i>LiveRegMatrix</i></b> class can be used. But, in the other hand, the class <i><b>InlineSpiller</b></i> doesn't provide a similar method, like <b>unspill</b>.<br><br>So I thought, instead of applying the spill directly during the first phase of the algorithm, I would store the virtual registers candidates to spill in an auxiliary structure. So that when it was decided to apply spill at some virtual register, it would be added to the structure and that would be ignored in the next iteration of the algorithm. After local search phase is completed, the spill would be applied in fact to these virtual registers contained in auxiliary structure. Using this structure I can move make the switch between virtual registers assigned to physical registers and virtual registers candidates to go to the memory smoothly.<br>So my question is this: Following this approach of "Lazy Spill", leads to any side effects? Far as I know applying spill to a virtual register leads to insert instructions of load/store in the code, which may make it necessary to run the Liveness Analysis again, changing the structure of Live Intervals. That would be a problem, but looking at the source code of <b><i>InlineSpiller</i></b> class, I see no invocation of Liveness Analysis after applying spill.<br><br>Att<br><br clear="all"></div><br>-- <br><div class="gmail_signature">Natanael Ramos <br>Membro do corpo discente de Ciência da Computação pelo Instituto Federal de <br>Minas Gerais - Campus Formiga<br><br></div>
</div>