[llvm] [AMDGPU][NFC] Remove duplicate code by using getAddressableLocalMemor… (PR #104604)

Mariusz Sikora via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 08:18:10 PDT 2024


https://github.com/mariusz-sikora-at-amd created https://github.com/llvm/llvm-project/pull/104604

…ySize

>From 1a40e6e9642d2f1b5f7096d77224e6262a1844ec Mon Sep 17 00:00:00 2001
From: Mariusz Sikora <mariusz.sikora at amd.com>
Date: Fri, 16 Aug 2024 17:14:11 +0200
Subject: [PATCH] [AMDGPU][NFC] Remove duplicate code by using
 getAddressableLocalMemorySize

---
 llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

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