[PATCH] D138443: [AMDGPU] Fix getMinNumVGPRs, add unit test to check consistency between getMinNumVGPRs, getMaxNumVGPRs and getOccupancyWithNumVGPRs.

Valery Pykhtin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 08:32:49 PST 2022


vpykhtin created this revision.
Herald added subscribers: kosarev, foad, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl, arsenm.
Herald added a project: All.
vpykhtin requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

While working on RP tracking issues I noticed that getMinNumVGPRs return incorrect
values: the problem is large VGPR granule sizes on GFX10+ architectures. Some of the
occupancies aren't reachable because require the same amount of VGPR granules. For example
19 waves occupancy on gfx1010 require the same amount of granules as 20 waves so the
resultng occupancy would be 20.

SGPRs have the same issue and even have inconsistency between getMaxNumSGPRs and getOccupancyWithNumSGPRs.
It will be addressed in the next patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138443

Files:
  llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
  llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
  llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
  llvm/test/CodeGen/AMDGPU/occupancy-levels.ll
  llvm/unittests/Target/AMDGPU/AMDGPUUnitTests.cpp
  llvm/unittests/Target/AMDGPU/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138443.476919.patch
Type: text/x-patch
Size: 9314 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221121/dbd4a2de/attachment.bin>


More information about the llvm-commits mailing list