This patch adds legalisation of extensions where the operand
of the extend is a legal scalable type but the result is not.
EXTRACT_SUBVECTOR is used to split the result, before
being replaced by target-specific [S|U]UNPK[HI|LO] operations.
For example:
zext <vscale x 16 x i8> %a to <vscale x 16 x i16>
should emit:
uunpklo z2.h, z0.b uunpkhi z1.h, z0.b
In general, there are four possibilities for legalization of the operand vector:
Currently, you're assuming the the result of GetPromotedInteger() has an element type narrower or equal to the element type of NOutVT. I'm not sure that's true on all targets, but I guess it's true for SVE. Better to explicitly check, I think.