[PATCH] D84194: [AMDGPU] Correct the number of SGPR blocks used for GFX9

Ronak Chauhan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 01:55:39 PDT 2020


rochauha marked 2 inline comments as done.
rochauha added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp:439
   // SGPRBlocks is actual number of SGPR blocks minus 1.
-  return NumSGPRs / getSGPREncodingGranule(STI) - 1;
+  unsigned NumSGPRBlocks = divideCeil(NumSGPRs, Alignment) - 1;
+  return isGFX9(*STI) ? NumSGPRBlocks * 2 : NumSGPRBlocks;
----------------
foad wrote:
> Don't you still need a std::max somewhere in here to cope with the NumSGPRs==0 case?
Done. Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84194/new/

https://reviews.llvm.org/D84194





More information about the llvm-commits mailing list