Support shape transpose in `hlo_sharding_util::ReshapeSharding`.
Support shape transpose in `hlo_sharding_util::ReshapeSharding`.

Before this cl, `hlo_sharding_util::ReshapeSharding` can handle the cases where source and target shapes can be transformed to each other by merging and splitting dimension sizes. It returns `std::nullopt` if transpose is needed between source and target shapes.

This cl extracts the gcd(source_sharding_tile_size, target_shape) when `source_shape % source_sharding_tile_size == 0` in the major dimensions. An example is shown below.
```
input_shape: [6, 4]
output_shape: [2, 2, 3, 2]
input_sharding: {devices=[6,1]<=[6]}
```
output_sharding is `{devices=[2,1,1,1,3]<=[6] last_tile_dim_replicate}`. Before this cl, the output_sharding is `{replicated}`.
