Currently global SRA uses the GEP structure to determine how to split the global. This patch instead analyses the loads and stores that are performed on the global, and collects which types are used at which offset, and then splits the global according to those.
This is both more general, and works fine with opaque pointers. This is also closer to how ordinary SROA is performed.
clang-format: please reformat the code