aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorDiana Picus <Diana-Magda.Picus@amd.com>2025-08-08 12:00:37 +0200
committerGitHub <noreply@github.com>2025-08-08 12:00:37 +0200
commita910a6a8b5f96aa247f079016c9553a0aa445ba4 (patch)
tree5cae16ae4a488040a4c474a8bcd4d62645904e4d /llvm/lib/Bitcode
parentde72cca671b962d0149cf880ec44b942a58ed843 (diff)
downloadllvm-a910a6a8b5f96aa247f079016c9553a0aa445ba4.zip
llvm-a910a6a8b5f96aa247f079016c9553a0aa445ba4.tar.gz
llvm-a910a6a8b5f96aa247f079016c9553a0aa445ba4.tar.bz2
[AMDGPU] AsmPrinter: Unify arg handling (#151672)
When computing the number of registers required by entry functions, the `AMDGPUAsmPrinter` needs to take into account both the register usage computed by the `AMDGPUResourceUsageAnalysis` pass, and the number of registers initialized by the hardware. At the moment, the way it computes the latter is different for graphics vs compute, due to differences in the implementation. For kernels, all the information needed is available in the `SIMachineFunctionInfo`, but for graphics shaders we would iterate over the `Function` arguments in the `AMDGPUAsmPrinter`. This pretty much repeats some of the logic from instruction selection. This patch introduces 2 new members to `SIMachineFunctionInfo`, one for SGPRs and one for VGPRs. Both will be computed during instruction selection and then used during `AMDGPUAsmPrinter`, removing the need to refer to the `Function` when printing assembly. This patch is NFC except for the fact that we now add the extra SGPRs (VCC, XNACK etc) to the number of SGPRs computed for graphics entry points. I'm not sure why these weren't included before. It would be nice if someone could confirm if that was just an oversight or if we have some docs somewhere that I haven't managed to find. Only one test is affected (its SGPR usage increases because we now take into account the XNACK registers).
Diffstat (limited to 'llvm/lib/Bitcode')
0 files changed, 0 insertions, 0 deletions