[llvm] [InstCombine] Strip trailing zero GEP indices (PR #151338)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 30 08:58:20 PDT 2025
nikic 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: [c0965b0](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., #150896 and #150639).
Apart from those two, another one I know about is in RelLookupTableConverter.
Also it may prevent GEP merging, but as we are now moving towards splitting instead, that's no longer a concern.
https://github.com/llvm/llvm-project/pull/151338
More information about the llvm-commits
mailing list