[llvm] [Verifier][AMDGPU] No store to const addrspace (PR #109181)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 06:20:04 PDT 2024


jofrn wrote:

> This must be UB, and not a verifier error. For example, we allow constant->flat casts. We do not want to have to consider the address spaces involved when folding something like store (addrspacecast ptr addrspace(4) %val to ptr)

The the addrspace in `store (addrspacecast ptr addrspace(4) %val to ptr)` won't be affected by `getPointerAddressSpace` since this function asks about the second operand to the store, `store i32 %val, ptr addrspace(4) %ptr`, in particular, `ptr addrspace(4) %ptr`. Your example gives a complex expression on the value source.

https://github.com/llvm/llvm-project/pull/109181


More information about the llvm-commits mailing list