[llvm] [InstCombine] Merge GEPs with the same index when the inner GEP has one use (PR #227960)

Ömer Sinan Ağacan via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 09:58:54 PDT 2026


osa1 wrote:

> This is limited to identical indices. Merging different indices into `gep p, (x + y)` can be undone by other folds, which caused an infinite loop when I tried it.

Curious which folds undoes this and why?

If combining GEPs is a good thing and we do it as a part of `instcombine` I'd expect other passes to not undo it.

https://github.com/llvm/llvm-project/pull/227960


More information about the llvm-commits mailing list