This pass was created with the assumption that all the copy sequences like
x = COPY y
z = COPY x
were already handled by the coalescer and transformed to
z = COPY y
This was true until the sub-registers appeared.
Considering the following pattern:
x = COPY y
z = COPY s
w = COPY x_z
where x_z is a super-reg consisting of x and y
Current implementation does not take into account registers defined by another copies assuming that one COPY cannot define register that is used by another one. As a result in sinks the COPY defining sub-register to one successor but COPY that reads super-register to another providing this later with uninitialized register.
Proposed fix updates lane mask after sinking the COPY rather then merely add whole COPY source to live ins.
Should use MCRegUnitMaskIterator instead of getting the lane masks for each subreg