Hi Susan,<div><br></div><div>It looks like the allocation-order aware code didn't make it into your email on November 7th, and I didn't think to add it back in. This code is important, and its omission could be the cause of the errors your seeing.</div>
<div><br></div><div>- Lang.</div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 15, 2012 at 12:09 PM, Susan Horwitz <span dir="ltr"><<a href="mailto:horwitz@cs.wisc.edu" target="_blank">horwitz@cs.wisc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks Lang, I'll try substPhysReg.<br>
<br>
I did try your latest code, and although it made the assembler errors go away, now some of my tests produce bad output when executed.  I need to look into that some more...  (I did change my "usedPregSet" to be ALL pregs used in the whole function, not just those in the current instruction, so the problem should not be the erroneous over-writing of a live preg.)<br>

<br>
Also, I'm confused about the code that gets a preg for a given vreg. Previously,you gave me code that takes into account the "allocation order" and the "reserved regs", including the following:<br>

         BitVector reservedRegs = TRI->getReservedRegs(Fn);<div class="im"><br>
         ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(Fn)<u></u>;<br>
         ArrayRef<uint16_t>::iterator rItr = rawOrder.begin();<br></div>
         while (rItr != rawOrder.end()) {<br>
          while (rItr != rawOrder.end() && reservedRegs.test(*rItr)) {<br>
            ++rItr;<br>
          }<br>
<br>
As I recall, this prevented some failed assertion.  Why has that code gone away?<span class="HOEnZb"><font color="#888888"><br>
<br>
Susan</font></span><div class="im"><br>
<br>
<br>
On 11/15/2012 01:45 PM, Lang Hames wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi Susan,<br>
<br>
Jakob just pointed me to 'MachineOperand::substPhysReg(<u></u>unsigned preg,<br>
const TargetRegisterInfo& TRI)'. That substitutes the given physreg for<br>
a virtreg operand, taking the subregister index into account. That is<br>
what my examples have been doing manually. Using substPhysReg would<br>
allow you to tidy the Gcra code up slightly.<br>
<br>
- Lang.<br>
<br>
<br>
On Thu, Nov 15, 2012 at 11:21 AM, Lang Hames <<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a><br></div><div class="im">
<mailto:<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>>> wrote:<br>
<br>
    Thanks Jakob. I should have mentioned that earlier. :)<br>
<br>
    When you see mismatched sizes on operands it's a fair bet that the<br>
    subreg rewriting has gone wrong. I should have pulled that entirely<br>
    out of the preg search loop in the previous example.<br>
<br>
    Fixed version attached.<br>
<br>
    - Lang.<br>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br></div>