When accumulating the GEP offset in BasicAA, we should use the pointer index size rather than the pointer size.
GEP decomposition looks through address space casts, so the index size can change. It does mostly work with the index size of a single AS and then sext up to the maximum size, though the precise way it does so is not quite correct in some respects (wrt sext/mul commutativity and scale adjustment -- fixing this needs some more preliminary work though).
It would certainly make things easier if we could get away with not looking through address space casts, but I'm not sure that's viable.
Thanks, this LGTM and should hopefully avoid some unnecessary extends to 128 bits for CHERI.
I think it would be nice if we could avoid the use of the max pointer/index size here but that is an unrelated change that can be looked into later.