Hello,
In our target we sometimes load multiple constants with the same instruction into registers that have disjoint subregisters and then use the subregisters separately.
In certain cases during constant re-materialization in the register coalescer the one of these multiple constants load instructions can be selected to rematerialize only one of the constants.
The situation is something like this:
vreg1 = LOAD CONSTANTS 5, 8 ; Loading both 5 and 8 in different subregs
; Copying only part of the register here, but the rest is undef.
vreg2:sub_16bit<def, read-undef> = COPY vreg1:sub_16bit
==>
; Materialize all the constants but only using one eventually.
vreg2 = LOAD_CONSTANTS 5, 8
In the above case we had an undefined registers that gets partially defined by the copy of one of the two constants in VREG1.
The re-materialization substitutes the copy with the load instructions defining the whole register now.
This is fine, because the register was undefined, but if this happens we need to update the sub-register liveness to keep track that there is a dead definition of the lanes that weren't loaded previously.
Random line break