[llvm] Fix incorrect codegen with respect to GEPs #85333 (PR #88440)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 20 05:02:55 PDT 2024


nikic wrote:

> Overall, this seems fine to me, but I do wonder about the situation arising in the first place. I was under the impression that GEPs had been canonicalized to always use i8 now when the IR is read in (e.g. auto upgrade). Is that logic in one of the simplification passes? Does that imply that such a pass should always run _before_ **GVNSink**? IIRC, what I'm referring to is related to the [ptradd proposal](https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699).

GVNSink still has to be correct when considered as a standalone pass. Besides, the i8 canonicalization is currently only applied to constant offsets, while GVNSink presumably also operates on non-constants.

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


More information about the llvm-commits mailing list