This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Add second emergency slot for SGPR to vmem for large frames
ClosedPublic

Authored by arsenm on Dec 8 2021, 3:09 PM.

Details

Summary

In a future change, we will sometimes use a VGPR offset for doing
spills to memory, in which case we need 2 free VGPRs to do the SGPR
spill. In most cases we could spill the VGPR along with the SGPR being
spilled, but we don't have any free lanes for SGPR_1024 in wave32 so
we could still potentially need a second scavenging slot.

Diff Detail

Event Timeline

arsenm created this revision.Dec 8 2021, 3:09 PM
arsenm requested review of this revision.Dec 8 2021, 3:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2021, 3:09 PM
Herald added a subscriber: wdng. · View Herald Transcript

This seems fine to me, but I am slightly confused the description mentions Wave32, but the test is for GFX9 Wave64.
I can clearly see the test exercises the new code, but do we need to also test/implement the Wave32 part?

arsenm added a comment.Dec 9 2021, 7:42 AM

This seems fine to me, but I am slightly confused the description mentions Wave32, but the test is for GFX9 Wave64.
I can clearly see the test exercises the new code, but do we need to also test/implement the Wave32 part?

The description mentions an alternative strategy which won't always work for wave32, so why it's done this way

sebastian-ne accepted this revision.Dec 13 2021, 10:25 AM

Change looks good to me

This revision is now accepted and ready to land.Dec 13 2021, 10:25 AM