I’ve put up https://reviews.llvm.org/D90708 to clarify the wrapping limitations for GEP inbounds, because I find the current wording ambiguous. I think this codifies the way it is currency interpreted in practice, but I’d like to have some wider feedback on that.
Essentially this comes down to two questions:
Can an allocated object cross the unsigned address space boundary? (In address space zero the answer is clearly “no”, due to the null pointer.)
Can an allocated object cross the signed address space boundary? (On x86-64 the answer is clearly “no”, due to canonical address space layout.)
My current assumption is that the answer to the first question is “no” and the answer to the second question is “yes”. (For optimization, it would be ideal if both questions were answered by “yes”.)