[PATCH] D125845: [InstCombine] Canonicalize GEP of GEP by swapping constant-indexed GEP to the back

William Junda Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 12:04:21 PST 2022


huangjd added a comment.

I would need some clarification on `inbounds` keyword. When an inbounds GEP of GEP is being transformed, what kind of transformation and conditions keep the new GEP inbounds?  For example `GEP inbounds (GEP inbounds P a) b` is equivalent to `GEP inbounds (GEP inbounds P b) a` if and only if `a` and `b` have the same sign. Are there other algebraically valid transformations?  This actually does affect D137212 <https://reviews.llvm.org/D137212> since it is swapping constant indexed GEP.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125845



More information about the llvm-commits mailing list