<p dir="ltr">Thank you for your help Quentin. </p>
<p dir="ltr">I'm trying to avoid to have to work with Live Range Splitting. This allocator is for my Work of completion of undergraduate course in Computer Science, so I don't have enough time to work with advanced techniques, like Splitting, because it will demand a little bit more of research. But can be done in future works. For now, I will have to think in another methodology of local search. </p>
<p dir="ltr">Thank you for the hint, I will look at the LiveIntervals. </p>
<p dir="ltr">Att </p>
<div class="gmail_quote">Em 01/09/2015 17:04, "Quentin Colombet" <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>> escreveu:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Natanael,<div><br></div><div><br><div><div class="quoted-text"><blockquote type="cite"><div>On Sep 1, 2015, at 11:38 AM, Natanael Ramos via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><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? </div></div></div></blockquote><div><br></div></div><div>You need to model the live-range splitting involved by the insertion of load and store instructions. I want to expose such interface in the spiller for this kind of lazy spilling (look for the memory state I added recently in the greedy allocator), but I do not know when I will get to it. This is way down in my todolist.</div><div class="quoted-text"><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">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></div></div></div></blockquote><div><br></div></div><div>The InlineSpiller does update the liveness analysis, look for method on the LiveIntervals object instead the InlineSpiller.</div><div><br></div><div>Cheers,</div><div>-Quentin</div><br><blockquote type="cite"><div><div class="quoted-text"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>Att<br><br clear="all"></div><br>-- <br><div>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></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></div></blockquote></div>