[PATCH] D140242: [AMDGPU] Modify adjustInliningThreshold to also consider the cost of passing function arguments through the stack
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 13:25:10 PST 2022
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp:1204
+ adjustThreshold += std::max(0, SGPRsInUse - 26) * ArgStackInlinePenalty;
+ adjustThreshold += std::max(0, VGPRsInUse - 32) * ArgStackInlinePenalty;
+ return adjustThreshold;
----------------
scchan wrote:
> I guess it's subtracting the number of clobbered registers - instead of a hardcoded value, could that be replaced by something more meaningful like a const variable or a getter?
>
> Also shouldn't VGPRs have a higher penalty relative to SGPRs since they'd occupy more stack space?
We only sort of handle SGPR arguments today, and not for compute. We also do not currently implement the optimization of packing SGPRs into a VGPR for the argument spill
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140242/new/
https://reviews.llvm.org/D140242
More information about the llvm-commits
mailing list