If we have a node with an illegal fixed length vector result type that
needs widened, e.g. x:v6i32 = add a, b
Instead of just widening it to: x:v8i32 = add a, b
We can widen it to the equivalent VP operation and set the EVL to the
exact number of elements needed: x:v8i32 = vp_add a, b, mask=true, evl=6
Provided that the target supports the equivalent VP operation on the
widened type.
This patch applies this technique when widening unary, binary and
ternary ops, as well as selects, but there are more
places this could be applied.
This is an extension of https://reviews.llvm.org/D148713
This was changed so that it can reuse the ShouldWidenToVP logic.