[llvm-branch-commits] [llvm] [AMDGPU] Lower loads and stores for address space 13 (PR #209541)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 3 06:13:28 PDT 2026


================
@@ -1655,6 +1671,14 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
     // inserting addrspacecasts.
     Actions.customIf(typeIs(1, Constant32Ptr));
 
+    // VGPR ("as memory") accesses are custom-lowered to the legal
+    // G_AMDGPU_REG_LOAD/STORE target instructions. Always take the custom path
+    // so an unsupported (e.g. sub-dword) access is diagnosed cleanly rather
+    // than failing to legalize.
+    Actions.customIf([](const LegalityQuery &Query) -> bool {
+      return Query.Types[1].getAddressSpace() == AMDGPUAS::VGPR;
----------------
arsenm wrote:

Merge this with the above customIf 

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


More information about the llvm-branch-commits mailing list