[llvm] [AMDGPU] Max. WG size-induced occupancy limits max. waves/EU (PR #137807)
Lucas Ramirez via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 29 06:35:58 PDT 2025
================
@@ -255,6 +256,14 @@ class AMDGPUInformationCache : public InformationCache {
return Status;
}
+ /// Returns the minimum amount of LDS space used by a workgroup running
+ /// function \p F.
+ static unsigned getLDSSize(const Function &F) {
+ return AMDGPU::getIntegerPairAttribute(F, "amdgpu-lds-size",
+ {0, UINT32_MAX}, true)
+ .first;
----------------
lucas-rami wrote:
> Does this work correctly in the function case without this by assuming the maximum?
If it's not set it will assume no LDS usage and so the range of waves/EU may end up being too optimistic with respect to what occupancy is actually achievable. The range will still always be lower than before the change, just not as low as it should be in theory.
> This won't be set for non-entry kernels
I wasn't clear on that, thanks.
https://github.com/llvm/llvm-project/pull/137807
More information about the llvm-commits
mailing list