[clang] [llvm] [InstCombine] Try to infer type for `load`/`store` when replacing `memcpy` (PR #169966)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 29 23:10:09 PST 2025
https://github.com/dtcxzyw commented:
I am not sure whether the opaque pointer migration will eventually remove the type information in the alloca instruction. I saw this idea somewhere but now I cannot find it in Discourse. But it was discussed in nikic's blog: https://www.npopov.com/2021/06/02/Design-issues-in-LLVM-IR.html
> GEP instructions are not the only kind of instruction afflicted by too much type information. For example, the [alloca instruction](https://llvm.org/docs/LangRef.html#alloca-instruction), which is used to reserve stack space, accepts a type, while it really only needs to know the number of bytes to reserve:
```
%ptr = alloca [8 x i32], align 4
; should be
%ptr = alloca i64 32, align 4
```
> However, canonicality is not particularly important for allocas in practice, as they are typically not subject to redundancy elimination or structural equality checks.
https://github.com/llvm/llvm-project/pull/169966
More information about the llvm-commits
mailing list