[clang] [llvm] [AMDGPU] Add initial support for VGPR as memory (PR #205435)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 07:46:59 PDT 2026


================
@@ -379,6 +513,12 @@ bool AMDGPUPromoteAllocaImpl::run(Function &F, bool PromoteToLDS) {
   MaxVGPRs = getMaxVGPRs(CurrentLocalMemUsage, TM, F);
   setFunctionLimits(F);
 
+  // "VGPR as memory" is only enabled on the gfx940/gfx950 (CDNA3+) parts and on
+  // GFX12 and later. On any other target the objects fall back to scratch.
+  const GCNSubtarget &ST = TM.getSubtarget<GCNSubtarget>(F);
+  const bool TargetSupportsVGPRAsMemory =
----------------
arsenm wrote:

This shouldn't depend on the subtarget 

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


More information about the llvm-commits mailing list