[PATCH] D97520: [basicaa] Rewrite isGEPBaseAtNegativeOffset in terms of index difference [NFC]
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 04:22:41 PST 2021
nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.
LGTM. Some caveats:
- This doesn't look entirely NFC to me, because it will now strip away identical variable indices on both sides. You should be able to construct an example that changes with GEPs like `gep inbounds %p, %v, C` and `gep inbounds %p, %v, 0`.
- The inbounds check is not correct, because DecomposeGEP looks across multiple GEPs, and this only checks that the final one is inbounds. We should probably add a flag to DecomposedGEP that indicates whether all the GEPs are inbounds (handling mixes of inbounds and non-inbounds doesn't seem worth the trouble).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97520/new/
https://reviews.llvm.org/D97520
More information about the llvm-commits
mailing list