[clang] [llvm] [InstCombine] Strip leading zero indices from GEP (PR #155415)
Fabian Ritter via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 9 01:04:52 PDT 2025
ritter-x2a wrote:
I think I might have found the culprit: `AMDGPUPromoteAllocaToVectorPass`
Attached is the IR before and after that pass, with interesting points marked with `; HERE: `.
A `%arrayidx = getelementptr i8, ptr addrspace(5) %14, i64 -1` (AS 5 is the private/scratch address space, so pointers have 32 bits) seems to be translated into `%15 = add i64 4294967295, %conv6`, which adds a zero-extended 32-bit -1 in 64 bits. That probably should be sign-extended instead.
[around-AMDGPUPromoteAllocaToVectorPass.ll.txt](https://github.com/user-attachments/files/22229340/around-AMDGPUPromoteAllocaToVectorPass.ll.txt)
https://github.com/llvm/llvm-project/pull/155415
More information about the llvm-commits
mailing list