llvm-project
458b1e9d - [TBAA] Refine pointer-tbaa for void pointers by pointer depth (#126047)

Commit
223 days ago
[TBAA] Refine pointer-tbaa for void pointers by pointer depth (#126047) Commit 77d3f8a avoids distinct tags for any pointers where the ultimate pointee type is `void`, to solve breakage in real-world code that uses (indirections to) `void*` for polymorphism over different pointer types. While this matches the TBAA implementation in GCC, this patch implements a refinement that distinguishes void pointers by pointer depth, as described in the "strict aliasing" documentation included in the aforementioned commit: > `void*` is permitted to alias any pointer type, `void**` is permitted > to alias any pointer to pointer type, and so on. For example, `void**` is no longer considered to alias `int*` in this refinement, but it remains possible to use `void**` for polymorphism over pointers to pointers.
Author
Parents
Loading