Create a wider source vector, and unmerge with dead defs like the
legalizer. The legalization handling for G_EXTRACT is incomplete, and
it's preferrable to keep everything in 32-bit pieces.
Details
Diff Detail
Event Timeline
Looks OK to me technically, but it seems a shame if even simple cases like %1:(<3 x s16>) = G_EXTRACT %0:(<4 x s16>), 0 don't work well.
What do you mean about keeping everything in 32-bit pieces? I don't see anything in the test case diffs where we were not already doing that.
Also I have slight theoretical reservations about ever using getLCMType because of pathological cases like <17 x s32> vs <19 x s32> which would create <323 x s32>. But I suppose it's never that bad in practice.
Is there a helper function already in LegalizerHelper that does what mergeVectorRegsToResultRegs does?
The <3 x s16> results are not even
Also I have slight theoretical reservations about ever using getLCMType because of pathological cases like <17 x s32> vs <19 x s32> which would create <323 x s32>. But I suppose it's never that bad in practice.
In this context, it's only getting legal register pieces, and we break every calling convention argument into 32-bit registers. The worst case is 1 implicit_def and 1 dead def on the unmerge. I wrote it more generally to prepare for a cleanup
Is there a helper function already in LegalizerHelper that does what mergeVectorRegsToResultRegs does?
No
This LGTM if Jay does not object.
Avoiding generating these G_EXTRACT seems preferable ATM.