[llvm] 7c9c331 - [NFC][AMDGPU] Remove redundant code in `AMDGPUSubtarget::getWavesPerEU` (#155201)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 25 05:22:04 PDT 2025


Author: Shilei Tian
Date: 2025-08-25T08:22:00-04:00
New Revision: 7c9c331eb35add068ee71332f8aadf300a2105fb

URL: https://github.com/llvm/llvm-project/commit/7c9c331eb35add068ee71332f8aadf300a2105fb
DIFF: https://github.com/llvm/llvm-project/commit/7c9c331eb35add068ee71332f8aadf300a2105fb.diff

LOG: [NFC][AMDGPU] Remove redundant code in `AMDGPUSubtarget::getWavesPerEU` (#155201)

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
index d095fc6cf9549..a1d82128423bb 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
@@ -209,19 +209,16 @@ std::pair<unsigned, unsigned>
 AMDGPUSubtarget::getWavesPerEU(const Function &F) const {
   // Default/requested minimum/maximum flat work group sizes.
   std::pair<unsigned, unsigned> FlatWorkGroupSizes = getFlatWorkGroupSizes(F);
-  // Minimum number of bytes allocated in the LDS.
-  unsigned LDSBytes = AMDGPU::getIntegerPairAttribute(F, "amdgpu-lds-size",
-                                                      {0, UINT32_MAX}, true)
-                          .first;
-  return getWavesPerEU(FlatWorkGroupSizes, LDSBytes, F);
+  return getWavesPerEU(F, FlatWorkGroupSizes);
 }
 
 std::pair<unsigned, unsigned> AMDGPUSubtarget::getWavesPerEU(
     const Function &F, std::pair<unsigned, unsigned> FlatWorkGroupSizes) const {
   // Minimum number of bytes allocated in the LDS.
-  unsigned LDSBytes = AMDGPU::getIntegerPairAttribute(F, "amdgpu-lds-size",
-                                                      {0, UINT32_MAX}, true)
-                          .first;
+  unsigned LDSBytes =
+      AMDGPU::getIntegerPairAttribute(F, "amdgpu-lds-size", {0, UINT32_MAX},
+                                      /*OnlyFirstRequired=*/true)
+          .first;
   return getWavesPerEU(FlatWorkGroupSizes, LDSBytes, F);
 }
 


        


More information about the llvm-commits mailing list