This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Remove SIPrepareScratchRegs
ClosedPublic

Authored by arsenm on Nov 6 2015, 1:41 PM.

Details

Summary

It does not work because of emergency stack slots.
This pass was supposed to eliminate dummy registers for the
spill instructions, but the register scavenger can introduce
more during PrologEpilogInserter, so some would end up
left behind if they were needed.

The potential for spilling the scratch resource descriptor
and offset register makes doing something like this
overly complicated. Reserve registers to use for the resource
descriptor and use them directly in eliminateFrameIndex.

Also removes creating another scratch resource descriptor
when directly selecting scratch MUBUF instructions.

The choice of which registers are reserved is temporary.
For now it attempts to pick the next available registers
after the user and system SGPRs.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 39581.Nov 6 2015, 1:41 PM
arsenm retitled this revision from to AMDGPU: Remove SIPrepareScratchRegs.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
arsenm accepted this revision.Nov 30 2015, 1:19 PM
arsenm added a reviewer: arsenm.

r254331

This revision is now accepted and ready to land.Nov 30 2015, 1:19 PM
arsenm closed this revision.Nov 30 2015, 1:20 PM
test/CodeGen/AMDGPU/large-alloca-graphics.ll