[all-commits] [llvm/llvm-project] 3ccfa1: [AMDGPU] Ignore inactive VGPRs in .vgpr_count
Diana Picus via All-commits
all-commits at lists.llvm.org
Wed Jul 16 02:48:12 PDT 2025
Branch: refs/heads/users/rovka/vgpr-count-restore
Home: https://github.com/llvm/llvm-project
Commit: 3ccfa1e5284bcafe6f927d89096d26619c23bec1
https://github.com/llvm/llvm-project/commit/3ccfa1e5284bcafe6f927d89096d26619c23bec1
Author: Diana Picus <diana-magda.picus at amd.com>
Date: 2025-07-16 (Wed, 16 Jul 2025)
Changed paths:
M llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
M llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp
M llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
A llvm/test/CodeGen/AMDGPU/init-whole-wave-vgpr-count-large.ll
A llvm/test/CodeGen/AMDGPU/init-whole-wave-vgpr-count-leaf.ll
A llvm/test/CodeGen/AMDGPU/init-whole-wave-vgpr-count-use-inactive.ll
A llvm/test/CodeGen/AMDGPU/init-whole-wave-vgpr-count.ll
M llvm/test/CodeGen/AMDGPU/unnamed-function-resource-info.ll
M llvm/test/CodeGen/AMDGPU/vgpr-agpr-limit-gfx90a.ll
A llvm/test/CodeGen/AMDGPU/vgpr-count-compute.ll
A llvm/test/CodeGen/AMDGPU/vgpr-count-graphics-chain.ll
A llvm/test/CodeGen/AMDGPU/vgpr-count-graphics.ll
Log Message:
-----------
[AMDGPU] Ignore inactive VGPRs in .vgpr_count
When using the `amdgcn.init.whole.wave` intrinsic, we add dummy VGPR
arguments with the purpose of preserving their inactive lanes. The
pattern may look something like this:
```
entry:
call amdgcn.init.whole.wave
branch to shader or tail
shader:
$vInactive = IMPLICIT_DEF ; Tells regalloc it's safe to use the active lanes
actual code...
tail:
call amdgcn.cs.chain [...], implicit $vInactive
```
We should not report these VGPRs in the `.vgpr_count` metadata. This patch
achieves that goal by ignoring IMPLICIT_DEFs and calls. This should be
safe since if those registers are actually used in any other context,
they will be counted there.
It also reduces the scope of the code that counts unused function
arguments to only work on entry functions, since only they need to
handle hardware-initialized registers.
This is a reworked version of #133242, which was reverted in #144039.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list