This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Handle frame index expansion with no free SGPRs pre gfx9
ClosedPublic

Authored by arsenm on Aug 27 2019, 3:40 PM.

Details

Reviewers
rampitec
Summary

Since an add instruction must produce an unused carry out, this
requires additional SGPRs. This can be avoided by keeping the entire
offset computation in SGPRs. If one SGPR is still available, this only
costs one extra mov. If none are available, the entire computation can
be done in place and reversed.

This does assume the use is a VGPR operand. This was already assumed,
and we currently only select frame indexes to VALU instructions. This
should probably be fixed at some point to handle more possible MIR.

Diff Detail

Event Timeline

arsenm created this revision.Aug 27 2019, 3:40 PM
This revision is now accepted and ready to land.Sep 3 2019, 10:59 AM
arsenm closed this revision.Sep 4 2019, 10:11 AM

r370929