[PATCH] D130424: AMDGPU: Adjust register allocation priority values down

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 23 08:21:21 PDT 2022


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

Set the priorities consistently to number of registers in the tuple -

1. Previously we started at 1, and also tried to give SGPR higher

values than VGPRs. There's no point in assigning SGPRs higher values
now that those are allocated in a separate regalloc run.

      

This avoids overflowing the 5 bits used for the class priority in the
allocation heuristic for 32 element tuples. This avoids some cases
where smaller registers unexpectedly get prioritized over larger.


https://reviews.llvm.org/D130424

Files:
  llvm/lib/Target/AMDGPU/SIRegisterInfo.td
  llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers.ll
  llvm/test/CodeGen/AMDGPU/constant-address-space-32bit.ll
  llvm/test/CodeGen/AMDGPU/extend-phi-subrange-not-in-parent.mir
  llvm/test/CodeGen/AMDGPU/indirect-call.ll
  llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wqm.demote.ll
  llvm/test/CodeGen/AMDGPU/spill-vgpr.ll
  llvm/test/CodeGen/AMDGPU/srem64.ll
  llvm/test/CodeGen/AMDGPU/unstructured-cfg-def-use-issue.ll
  llvm/test/CodeGen/AMDGPU/urem64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130424.447072.patch
Type: text/x-patch
Size: 38134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220723/54359907/attachment.bin>


More information about the llvm-commits mailing list