collectShuffleElements already handles combining the following into a single shufflevector:

%elt0 = extractelement <8 x i16> %in, i32 3 %elt1 = extractelement <8 x i16> %in, i32 1 %elt2 = extractelement <8 x i16> %in2, i32 0 %elt3 = extractelement <8 x i16> %in, i32 2 %vec.0 = insertelement <4 x i16> undef, i16 %elt0, i32 0 %vec.1 = insertelement <4 x i16> %vec.0, i16 %elt1, i32 1 %vec.2 = insertelement <4 x i16> %vec.1, i16 %elt2, i32 2 %vec.3 = insertelement <4 x i16> %vec.2, i16 %elt3, i32 3

This patch extends it to handle the following, by turning it into shufflevector + ext.

%elt0e = extractelement <8 x i16> %in, i32 3 %elt1e = extractelement <8 x i16> %in, i32 1 %elt2e = extractelement <8 x i16> %in, i32 0 %elt3e = extractelement <8 x i16> %in, i32 3 %elt0 = zext i16 %elt0e to i32 %elt1 = zext i16 %elt1e to i32 %elt2 = zext i16 %elt2e to i32 %elt3 = zext i16 %elt3e to i32 %vec.0 = insertelement <4 x i32> undef, i32 %elt0, i32 0 %vec.1 = insertelement <4 x i32> %vec.0, i32 %elt1, i32 1 %vec.2 = insertelement <4 x i32> %vec.1, i32 %elt2, i32 2 %vec.3 = insertelement <4 x i32> %vec.2, i32 %elt3, i32 3