This patch optimises the lowering for some vector types for the min/max instruction.
I'm not sure you have to clamp the elements on a v2s64, as they are going to be expanded anyway.
Should it be dealing with vXi16 and vXi8 though?
It looks like clampNumElements is a wrapper around clampMinNumElements(..).clampMaxNumElements(..);
Out of interest, what would make the individual methods better to use themselves? Is it something about how small types are widened?
It turns out that G_ICMP doesn't support splitting vectors yet, which is why v2s64 is here too. Otherwise it could be lowered.
(It might be worth added a FIXME to that extent.)