This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Slightly simplify prolog reserved register handling
ClosedPublic

Authored by arsenm on Apr 11 2017, 1:47 PM.

Details

Reviewers
kzhuravl
Summary

Rely on MachineRegisterInfo's knowledge of used physical
registers. Use addPhysRegUsed to avoid manually trying to avoid
re-picking the same registers rather than specially avoiding it.

Move flat_scratch initialization earlier, so the uses are visible
when making these decisions.

This will make it easier to add another reserved register
at the end for the stack pointer rather than handling another
special case.

Diff Detail

Event Timeline

arsenm created this revision.Apr 11 2017, 1:47 PM
arsenm updated this revision to Diff 95042.Apr 12 2017, 3:38 PM

Don't use addPhysRegUsed

kzhuravl accepted this revision.Apr 24 2017, 9:28 AM

LGTM.

This revision is now accepted and ready to land.Apr 24 2017, 9:28 AM
arsenm closed this revision.Apr 24 2017, 2:21 PM

r301254