[llvm] [TypePromotion] Do not zero-extend getelementptr indexes since signed (PR #134281)

David Green via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 04:22:17 PDT 2025


davemgreen wrote:

Hi - I would guess that we usually assume that trivial instructions have already been removed in anything that wasn't a hand-written (or reduced) test case, and that the snippet for #133928 would just need to be larger if it had to include extra uses for the trivial instructions - the original problem would remain just in a different form. I don't think it would be an issue if you wanted to add it, but I doubt it would be super useful in the entire pass pipeline.

I think in practice all gep indices will be canonicalized to ptrsize so this is probably OK. Can you update the `// Ignore GEPs because ...` comment before the gep, and add a testcase from #133928 with a comment explaining what is going on?

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


More information about the llvm-commits mailing list