[llvm] 11d7c9c - [llvm-calc-occupancy] Fix build after SGPR queries moved to TargetParser (#213023)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 07:12:47 PDT 2026


Author: michaelselehov
Date: 2026-07-30T14:12:41Z
New Revision: 11d7c9c9b4e8ebaf5f9bfb6ba80aecd498aa25ca

URL: https://github.com/llvm/llvm-project/commit/11d7c9c9b4e8ebaf5f9bfb6ba80aecd498aa25ca
DIFF: https://github.com/llvm/llvm-project/commit/11d7c9c9b4e8ebaf5f9bfb6ba80aecd498aa25ca.diff

LOG: [llvm-calc-occupancy] Fix build after SGPR queries moved to TargetParser (#213023)

Urgent buildbot fix for #208727.

That PR was developed before #209848, which moved the SGPR count queries
into TargetParser and removed
`AMDGPU::IsaInfo::getAddressableNumSGPRs()`, so
`llvm-calc-occupancy.cpp` fails to compile on current `main`:

```
llvm-calc-occupancy.cpp:229:41: error: no member named 'getAddressableNumSGPRs' in namespace 'llvm::AMDGPU::IsaInfo'
```

This switches to the equivalent
`GCNSubtarget::getAddressableNumSGPRs()`, which forwards to the
TargetParser version. All other `IsaInfo::*` calls in the file were
checked against the new API and are unaffected.

Verified locally: `ninja llvm-calc-occupancy` builds clean,
`llvm/test/tools/llvm-calc-occupancy` passes, and the reported
addressable SGPR count is unchanged (102 on gfx90a).

Added: 
    

Modified: 
    llvm/tools/llvm-calc-occupancy/llvm-calc-occupancy.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-calc-occupancy/llvm-calc-occupancy.cpp b/llvm/tools/llvm-calc-occupancy/llvm-calc-occupancy.cpp
index 916c9fb941626..ed44d7531640e 100644
--- a/llvm/tools/llvm-calc-occupancy/llvm-calc-occupancy.cpp
+++ b/llvm/tools/llvm-calc-occupancy/llvm-calc-occupancy.cpp
@@ -226,7 +226,7 @@ int main(int argc, char **argv) {
   unsigned AddrLocalMem = AMDGPU::IsaInfo::getAddressableLocalMemorySize(STI);
   unsigned AddrVGPRs =
       AMDGPU::IsaInfo::getAddressableNumVGPRs(STI, DynVGPRBlockSizeEff);
-  unsigned AddrSGPRs = AMDGPU::IsaInfo::getAddressableNumSGPRs(STI);
+  unsigned AddrSGPRs = ST.getAddressableNumSGPRs();
   unsigned MaxWGSize = AMDGPU::IsaInfo::getMaxFlatWorkGroupSize();
 
   // Warn about inputs that exceed the hardware's physical capacity: such a


        


More information about the llvm-commits mailing list