This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Allow to use a whole register file on gfx90a for VGPRs
ClosedPublic

Authored by rampitec on Oct 13 2021, 4:06 PM.

Details

Summary

In a kernel which does not have calls or AGPR usage we can allocate
the whole vector register budget for VGPRs and have no AGPRs as
long as VGPRs stay addressable (i.e. below 256).

Diff Detail

Event Timeline

rampitec created this revision.Oct 13 2021, 4:06 PM
rampitec requested review of this revision.Oct 13 2021, 4:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2021, 4:06 PM
Herald added a subscriber: wdng. · View Herald Transcript
AlexVlx added inline comments.
llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
953

Why not just make this a manipulator (delete the trailing const) and get rid of mutable? It's just a stylistic issue so feel free to ignore.

rampitec added inline comments.Oct 13 2021, 4:54 PM
llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
953

Because getReservedRegs takes const MF. So it is either mutable or I will have to use const_cast somewhere. I prefer mutable in this case as it is just lazily computed and cached rather than actually changing the MFI. The effects of this mutation are unobservable outside of the accessor.

kerbowa accepted this revision.Oct 21 2021, 6:02 PM

LGTM

This revision is now accepted and ready to land.Oct 21 2021, 6:02 PM
This revision was landed with ongoing or failed builds.Oct 21 2021, 6:24 PM
This revision was automatically updated to reflect the committed changes.
hsmhsm added a subscriber: hsmhsm.Mar 21 2022, 9:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2022, 9:47 PM