[VectorCombine] Fold bitcast(bitreverse(bitcast(x))) to fshl+bitreverse (#214362)
Extend foldBitOrderReverseAndSwap to handle <2 x iN> element bitreverse
patterns. Previously the fold only handled <N x i8> vectors using bswap
to reorder octets. For 2-element vectors, the element swap is a rotate
by half the bitwidth, which can be expressed as fshl(x, x, bitwidth/2).
The transform rewrites:
bitcast(bitreverse(bitcast(x))) -> bitreverse(fshl(x, x, N/2))
when the cost model indicates the scalar form is cheaper.
For <2 x i8> we still prefer to use bswap, and we do not even consider
to check if fshl is cheaper than bswap.