[PATCH] D138637: [InstCombine] Combine opaque pointer single index GEP and with src GEP which has result of array type

krishna chaitanya sankisa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 23 08:23:18 PST 2022


skc7 added a comment.

In D138637#3970359 <https://reviews.llvm.org/D138637#3970359>, @nikic wrote:

> I think in terms of general approach, the better way to handle this would be to relax the `Src->getResultElementType() != GEP.getSourceElementType()` check to allow the transform if the types can be made to match by adding additional zero indices.
>
> (As a meta note, I think we'd probably be better off considering GEPs with multiple dynamic indices to be non-canonical, and try to split them up instead, e.g. because this allows LICM of an invariant part. But I guess that's not our current stance. It would be interesting to hear where you have found this merging to be beneficial.)

Hi @nikic I have updated the patch to match the types by adding additional zero indices. Please review.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138637



More information about the llvm-commits mailing list