[llvm] [AMDGPU] Limit DVGPR entry function max VGPRs to block size (PR #226242)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 28 04:19:45 PDT 2026
================
@@ -636,9 +636,18 @@ unsigned GCNSubtarget::getBaseMaxNumVGPRs(
unsigned GCNSubtarget::getMaxNumVGPRs(const Function &F) const {
unsigned DynamicVGPRBlockSize = AMDGPU::getDynamicVGPRBlockSize(F);
std::pair<unsigned, unsigned> Waves = getWavesPerEU(F);
- return getBaseMaxNumVGPRs(
+
+ unsigned MaxNumVGPRs = getBaseMaxNumVGPRs(
F, {getMinNumVGPRs(Waves.second, DynamicVGPRBlockSize),
getMaxNumVGPRs(Waves.first, DynamicVGPRBlockSize)});
+
+ // In DVGPR mode, a wave launches with a single VGPR block allocated. Applied
+ // after getBaseMaxNumVGPRs so "amdgpu-num-vgpr" cannot raise it back up.
----------------
shiltian wrote:
In the long run, we need to remove amdgpu-num-vgpr
https://github.com/llvm/llvm-project/pull/226242
More information about the llvm-commits
mailing list