When doing register coalescing for copys from reg to subreg like this:
%72.ssub_1:vregs = COPY %239:svregs
the %239 LiveRange is conflicting with %72.ssub_0 not %72.ssub_1, meaning the two regs are conflicting in different Lanes, which should return CR_Replace.
But the conflicting Segment of %72 was calcuated as 0xFFFFFFFF because %239 doesnot have a subreg Thus, the SubIdx of %72 is 0 and LaneMask is set to 0xFFFFFFFF, which will lead the conflict LaneMask with %239.
I think the LaneMask of PHI-def LiveRange should caculated by its subrange's LaneMask when the Reg has SubRanges. Because the Reg is Live in some subrange, It should have the LaneMask of this SubRange. When the VNI is Live all the SubRanges, Reg's LaneMask should be the Union of LaneMask of Subranges.
In New method, the LaneMask of %72's PHI-def Segment is the same as the subrange's LaneMask. The %72 and %239 will be conflicting in different Lanes and replace CR_Replace.
original question:
When doing register coalescing for copys from reg to subreg like this:
%72.ssub_1:vregs = COPY %239:svregs
If the liverange of %239 conflicts with the liverange of %72, but not for %72.ssub_1.
I have tried set SubRangeJoin to true, this COPY can be coalesced.
So can this attribute be modified by subtarget? Is there any potential problems when set this to true?
Hopeful to get some suggestion. Thanks.