This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Adjust register allocation priority values down
ClosedPublic

Authored by arsenm on Jul 23 2022, 8:21 AM.

Details

Reviewers
foad
rampitec
Group Reviewers
Restricted Project
Summary

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.

Diff Detail

Event Timeline

arsenm created this revision.Jul 23 2022, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2022, 8:21 AM
arsenm requested review of this revision.Jul 23 2022, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2022, 8:21 AM
Herald added a subscriber: wdng. · View Herald Transcript
foad accepted this revision.Jul 25 2022, 2:19 AM

LGTM, thanks!

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

I wonder if we will need to tweak this when we have properly allocatable 16-bit registers for GFX11.

This revision is now accepted and ready to land.Jul 25 2022, 2:19 AM