<span>PHI elimination doesn't preserve sub-registers of source operands when creating copy instructions. As an example take the following PHI instruction:<br>

<br>    %reg1045<def> = PHI %reg3456:v4sub2, <BB#7>, %reg1050, <BB#9>; GPR:%reg1045,1050 QPR:%reg3456<br><br>QPR represents 128 bit registers with 4 x 32 bit sub-registers and GPR represents single 32 bit registers. The PHI is correct: it's selecting either a 32 bit register from reg1050 or selecting a 32 bit sub-register of reg3456.<br>


<br>After PHI elimination BB7 contains:<br><br>    %reg3566<def> = COPY %reg3456; GPR:%reg3566 QPR:%reg3456<br><br>Now there's a copy of a 128 bit register to a 32 bit register but without any sub-register to determine what is going on.<br>


<br>The patch preserves the sub-registers when creating copy instructions.<br><br>Krister<br><br></span>