Extends findMoreOptimalIndexType to allow ISD::BUILD_VECTOR based
indices to be truncated when such truncation is lossless. This can
enable the use of 32bit gather/scatter indices thus making it less
likely to have to split a gather/scatter in two.
Depends on D125194
I think it's worth adding a comment here saying that this currently only works for BUILD_VECTOR nodes. The name of the function is quite generic, so I think users would probably expect it to also work for things like SPLAT_VECTOR, STEP_VECTOR, etc.