This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Enable frame index scavenging during PrologEpilogueInserter
ClosedPublic

Authored by tstellarAMD on Feb 24 2016, 6:42 PM.

Details

Summary

This allows us to use virtual registers when we need extra registers
for inserting spill instructions in SIRegisterInfo:eliminateFrameIndex().

Once all the frame indices have been eliminated, the
PrologEpilogueInserter does an extra pass over the program to replace
all virtual registers with physical ones.

This allows us to make more efficient use of our emergency spill slots,
so we only need to create one.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Enable frame index scavenging during PrologEpilogueInserter.
tstellarAMD updated this object.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
arsenm accepted this revision.Feb 29 2016, 5:03 PM
arsenm edited edge metadata.

LGTM. I looked at doing this before and thought it was pointless because seems like it's just deferring the scavengeRegister call

This revision is now accepted and ready to land.Feb 29 2016, 5:03 PM
This revision was automatically updated to reflect the committed changes.

LGTM. I looked at doing this before and thought it was pointless because seems like it's just deferring the scavengeRegister call

It seems to do a better job of using the emergency stack slot when you do it this way. Otherwise I was having to add multiple emergency stack slots to the register scavenger.