optimizeVectorResize is rewriting patterns like:
%1 = bitcast vector %src to integer %2 = trunc/zext %1 %dst = bitcast %2 to vector
Since bitcasting between integer an vector types gives
different integer values depending on endianness, we need
to take endianness into account. As it happens the old
implementation only gave the correct result for little
endian targets.
Add an assert that SrcElts != DestElts? Make sure the calling code doesn't get out-of-sync from the assumption in this function.