[PATCH] D96470: AMDGPU: Restrict soft clause bundling at half of the available regs

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 16:44:38 PST 2021


arsenm created this revision.
arsenm added reviewers: rampitec, vpykhtin, kerbowa.
Herald added subscribers: hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, qcolombet.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Fixes a testcase that was overcommitting large register tuples to a
bundle, which the register allocator could not possibly satisfy.  This
was producing a bundle which used nearly all of the available SGPRs
with a series of 16-dword loads (not all of which are freely available
to use).

      

This is a quick hack for some deeper issues with how the clause
bundler tracks register pressure.

      

Overall the pressure tracking used here doesn't make sense and is too
imprecise for what it needs to avoid the allocator failing. The
pressure estimate does not account for the alignment requirements of
large SGPR tuples, so this was really underestimating the pressure
impact. This also ignores the impact of the extended live range of the
use registers after the bundle is introduced. Additionally, it didn't
account for some wide tuples not being available due to reserved
registers.

      

This regresses a few cases. These end up introducing more
spilling. This is also a function of the global pressure being used in
the decision to bundle, not the local pressure impact of the bundle
itself.


https://reviews.llvm.org/D96470

Files:
  llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp
  llvm/test/CodeGen/AMDGPU/gfx-callable-argument-types.ll
  llvm/test/CodeGen/AMDGPU/limit-soft-clause-reg-pressure.mir
  llvm/test/CodeGen/AMDGPU/soft-clause-exceeds-register-budget.ll
  llvm/test/CodeGen/AMDGPU/spill-vgpr-to-agpr.ll
  llvm/test/CodeGen/AMDGPU/splitkit-getsubrangeformask.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96470.322861.patch
Type: text/x-patch
Size: 124683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210211/6c6b4337/attachment.bin>


More information about the llvm-commits mailing list