[llvm] [InstCombine] Strip trailing zero GEP indices (PR #151338)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 30 08:01:41 PDT 2025


dtcxzyw wrote:

> (Doing the same at the start requires adjusting the source element type.)

I tried it two years ago when I noticed that there were many `[0 x T]` geps in rustc-generated IR:
https://github.com/llvm/llvm-project/commit/c0965b0d5f80d6ef1f2915a6ac27f70a4a535c2b

It may expose some problems in the existing code that relies on specific GEP types (e.g., https://github.com/llvm/llvm-project/pull/150896 and https://github.com/llvm/llvm-project/pull/150639).


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


More information about the llvm-commits mailing list