If the pointer width is 32 bits and the calculated GEP offset is
negative, we call APInt::getLimitedValue(), which does a
*zero*-extension of the offset. That's wrong -- we should do an sext.
Fixes a bug introduced in rL314362 and found by Evgeny Astigeevich.
This doesn't actually clamp the way you want it to; suppose BaseOffset is less than int64_t::min.
I'd suggest just BaseOffset.sextOrTrunc(64).getSExtValue(); not precisely the same thing, but good enough until someone comes along with an architecture which actually needs 128-bit pointer offsets.