The BUILD_VECTOR node will truncate its operators to match the
type. We need to take this into account when constant folding -
we need to perform a truncation before constant folding the elements.
This is because the upper bits can change the result, depending on
the operation type (for example this is the case for min/max).
This change also adds a regression test.
I'd prefer to see this as ANY_EXTEND, as that more precisely describes that the upper bits are known to be undefined.
But shouldn't this only happen if we're in the post-legalize stage?