[PATCH] D98120: [InstCombine] Do not apply provenance losing transformations to GEP
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 6 12:22:27 PST 2021
nikic added a comment.
The (in)correctness of this transform isn't really related to inbounds, see https://alive2.llvm.org/ce/z/Pr8daF. Actually, after @lebedev.ri's commit this code is now in sync with InstSimplify (both fold the ptrtoint-ptrtoint case, but not the 0-ptrtoint case).
The remaining fold (both here and in InstSimplify) is only valid if both pointers have the same provenance, i.e. getUnderlyingObject() is the same. I don't know what the fallout of enforcing that would be.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98120/new/
https://reviews.llvm.org/D98120
More information about the llvm-commits
mailing list