[llvm] [AMDGPU] Rename getNumVGPRBlocks. NFC (PR #84161)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 00:46:49 PST 2024


================
@@ -1158,14 +1158,23 @@ unsigned getMaxNumVGPRs(const MCSubtargetInfo *STI, unsigned WavesPerEU) {
   return std::min(MaxNumVGPRs, AddressableNumVGPRs);
 }
 
-unsigned getNumVGPRBlocks(const MCSubtargetInfo *STI, unsigned NumVGPRs,
-                          std::optional<bool> EnableWavefrontSize32) {
-  NumVGPRs = alignTo(std::max(1u, NumVGPRs),
-                     getVGPREncodingGranule(STI, EnableWavefrontSize32));
-  // VGPRBlocks is actual number of VGPR blocks minus 1.
-  return NumVGPRs / getVGPREncodingGranule(STI, EnableWavefrontSize32) - 1;
+static unsigned getNumBlocks(unsigned NumVGPRs, unsigned Granule) {
----------------
rampitec wrote:

Yes, I thought so too, it is not VGPR specific. Maybe even something like getGranulatedNumRegisterBlocks. Plus rename the first argument, it is not VGPR number either, just register number.

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


More information about the llvm-commits mailing list