[llvm-branch-commits] [llvm] [AMDGPU] Move MaxHWAddressableLocalMemorySize into TargetParser (PR #219020)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Aug 26 12:48:12 PDT 2026


================
@@ -1179,17 +1179,8 @@ unsigned getWavefrontSize(const MCSubtargetInfo &STI) {
 // Maximum LDS a single work-group can address. This is a fixed HW cap. It does
 // not depend on how many SIMDs a work-group runs on.
 static unsigned getMaxHWAddressableLocalMemorySize(const MCSubtargetInfo &STI) {
-  if (STI.getFeatureBits().test(FeatureAddressableLocalMemorySize32768))
-    return 32768;
-  if (STI.getFeatureBits().test(FeatureAddressableLocalMemorySize65536))
-    return 65536;
-  if (STI.getFeatureBits().test(FeatureAddressableLocalMemorySize163840))
-    return 163840;
-  if (STI.getFeatureBits().test(FeatureAddressableLocalMemorySize196608))
-    return 196608;
-  if (STI.getFeatureBits().test(FeatureAddressableLocalMemorySize327680))
-    return 327680;
-  return 32768;
+  return AMDGPU::getMaxHWAddressableLocalMemorySize(
+      parseArchAMDGCN(STI.getCPU()));
----------------
arsenm wrote:

This is worse. No target query should ever parse the CPU 

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


More information about the llvm-branch-commits mailing list