[llvm] 2f89c1c - [AMDGPU][NFC] Remove duplicate code by using getAddressableLocalMemorySize (#104604)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 23:11:06 PDT 2024


Author: Mariusz Sikora
Date: 2024-08-17T08:11:03+02:00
New Revision: 2f89c1c76ce22831bd7abebea99202a6d3313110

URL: https://github.com/llvm/llvm-project/commit/2f89c1c76ce22831bd7abebea99202a6d3313110
DIFF: https://github.com/llvm/llvm-project/commit/2f89c1c76ce22831bd7abebea99202a6d3313110.diff

LOG: [AMDGPU][NFC] Remove duplicate code by using getAddressableLocalMemorySize (#104604)

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 0ca6266cc678b6..5b41a2cd731607 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -906,11 +906,7 @@ unsigned getWavefrontSize(const MCSubtargetInfo *STI) {
 }
 
 unsigned getLocalMemorySize(const MCSubtargetInfo *STI) {
-  unsigned BytesPerCU = 0;
-  if (STI->getFeatureBits().test(FeatureLocalMemorySize32768))
-    BytesPerCU = 32768;
-  if (STI->getFeatureBits().test(FeatureLocalMemorySize65536))
-    BytesPerCU = 65536;
+  unsigned BytesPerCU = getAddressableLocalMemorySize(STI);
 
   // "Per CU" really means "per whatever functional block the waves of a
   // workgroup must share". So the effective local memory size is doubled in


        


More information about the llvm-commits mailing list