[PATCH] D149936: [LAA] Don't require stride one for inbounds GEP

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 07:45:42 PDT 2023


nikic added a comment.
Herald added a subscriber: wangpc.

I've been thinking about this again and had a crazy thought: Do we need inbounds at all?

As far as I understand, everything here is working under the assumption that the pointer actually gets accessed on each iteration (otherwise a lot of the reasoning would not be valid anyway). The underlying object of an addrec only depends on the addrec start, so the underlying object must stay the same across all iterations. This means that, on each iteration, the pointer address must be part of that single underlying object -- otherwise we would not have provenance to perform the access, and behavior would be undefined. As no allocated object can cross the address space boundary, this implies that the pointer cannot wrap.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149936/new/

https://reviews.llvm.org/D149936



More information about the llvm-commits mailing list