This patch splits the list of sorted distinct GEPs into groups and selects the optimal base offset for each group to ensure that each offset can fit into simm12 on RISC-V.
It also tries to align offsets when compressed load/store instructions are available.
It is an alternative to D150665.
Fixes https://github.com/llvm/llvm-project/issues/62734.
If the only reason of introducing F argument to get entry block, why not using
GEP->getFunction()->getEntryBlock();
?