[llvm] [AMDGPU] Move SGPR Count Queries into TargetParser (PR #209848)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 07:11:23 PDT 2026


================
@@ -6083,7 +6083,8 @@ bool AMDGPUAsmParser::calculateGPRBlocks(
   if (Version.Major >= 10)
     NumSGPRs = MCConstantExpr::create(0, Ctx);
   else {
-    unsigned MaxAddressableNumSGPRs = IsaInfo::getAddressableNumSGPRs(getSTI());
+    AMDGPU::GPUKind Kind = AMDGPU::parseArchAMDGCN(getSTI().getCPU());
----------------
arsenm wrote:

The subarch is new and we cannot yet rely on it. In the future that would be an option. For now I'd suggest storing some combination of IsaVersion, GPUKind or SubArch in AMDGPUAsmParser. This is morally equivalent to HwMode, so needs to be set wherever that is updated 

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


More information about the llvm-commits mailing list