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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to