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

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 10:27:42 PDT 2026


================
@@ -1491,8 +1465,9 @@ unsigned getOccupancyWithNumSGPRs(const MCSubtargetInfo &STI, unsigned SGPRs) {
   if (!isSGPROccupancyLimited(STI))
     return MaxWaves;
 
-  return getOccupancyWithNumSGPRs(SGPRs, MaxWaves, getTotalNumSGPRs(STI),
-                                  getSGPRAllocGranule(STI),
+  GPUKind Kind = parseArchAMDGCN(STI.getCPU());
----------------
theSK2005 wrote:

I don't see any alternatives to get GPUKind here other than parsing this way. What should be done instead?

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


More information about the llvm-commits mailing list