Files
clang-p2996/llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-pointer-ops.ll
Krzysztof Drewniak 6b9da28b2b [AMDGPU][LowerBufferFatPointers] Handle addrspacecast null to p7 (#140775)
Some application code operating on generic pointers (that then gete
initialized to buffer fat pointers) may perform tests against nullptr.
After address space inference, this results in comparisons against
`addrspacecast (ptr null to ptr addrspace(7))`, which were crashing.

However, while general casts to ptr addrspace(7) from generic pointers
aren't supposted, it is possible to cast null pointers to the all-zerose
bufer resource and 0 offset, which this patch adds.

It also adds a TODO for casting _out_ of buffer resources, which isn't
implemented here but could be.
2025-05-20 16:13:01 -07:00

33 KiB