[llvm] [Verifier][AMDGPU] No store to const addrspace (PR #109181)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 06:28:38 PDT 2024
arsenm wrote:
> 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, the first operand.
You're reading the example too literally. It should be valid for a pass to strip away the cast, and store directly to the original address space of the pointer without considering any special information. It would be a target specific burden placed on any IR transformation, which is not OK.
This type of check belongs in Lint, which hardly ever gets used and I'm not sure is worth the effort
https://github.com/llvm/llvm-project/pull/109181
More information about the llvm-commits
mailing list