<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
</div><div class="im">> BB#0: derived from LLVM BB %entry<br>
>         %reg16390<def> = MOVZX32rm16 <fi#-2>, 1, %reg0, 0, %reg0; mem:LD2[FixedStack-2] GR32:%reg16390<br>
>         %reg16385<def> = COPY %reg16390:sub_16bit<kill>; GR16:%reg16385 GR32:%reg16390<br>
>         %reg16391<def> = MOVZX32rm16 <fi#-1>, 1, %reg0, 0, %reg0; mem:LD2[FixedStack-1] GR32:%reg16391<br>
>         %reg16384<def> = COPY %reg16391:sub_16bit<kill>; GR16:%reg16384 GR32:%reg16391<br>
>     Successors according to CFG: BB#1<br>
<br>
</div>MachineOperands can refer to sub-registers of virtual registers. That is what is happening here. It is not specific to COPY instructions, but it happens a lot for them.<br>
<br>
You should look at how the other register allocators are rewriting virtual registers to physicals.<br>
<font color="#888888"><br>
/jakob<br>
<br>
</font></blockquote></div><div><br></div><div>Thanks, it looks like all I have to do is check the 'sub_16bit' flag from the operand. This flag makes it possible for the target register class of a virtual register to change. </div>
<div><br></div></div><div>- Jeff Kunkel</div><div><br></div>