<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 9, 2010, at 10:49 PM, Evan Cheng wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Dec 9, 2010, at 10:15 AM, Andrew Trick wrote:<br><br><blockquote type="cite">Author: atrick<br></blockquote><blockquote type="cite">Date: Thu Dec  9 12:15:21 2010<br></blockquote><blockquote type="cite">New Revision: 121388<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=121388&view=rev">http://llvm.org/viewvc/llvm-project?rev=121388&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Added register reassignment prototype to RAGreedy. It's a simple<br></blockquote><blockquote type="cite">heuristic to reshuffle register assignments when we can't find an<br></blockquote><blockquote type="cite">available reg.<br></blockquote><br>Do you mean to use this to vacate a physical register that's preferred by another virtual register with stricter allocation requirement?<br>e.g. vacate r1 in order to form r0 / r1 pair.<br></div></blockquote><br></div><span class="Apple-style-span" style="font-family: monospace; ">I could just be primitive puzzle solving. Suppose we allocate like this:</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">a=[1;2] --> %R0</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">b=[6;7] --> %R0</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">c=[4;10] --> %R1</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">d=[1;5] --> ?</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">Assuming other registers are occupied, by reassigning a, we can allocate:</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">a=[1;2] --> %R1</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">d=[1;5] --> %R0</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">But yes, it can also help with allocating register with stricter constraints. An interfering register can be moved to a register outside the class we are allocating from.</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">/jakob</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><div><span class="Apple-style-span" style="font-family: monospace; "><br></span></div></body></html>