This is an archive of the discontinued LLVM Phabricator instance.

Add an ID field to StackObjects
ClosedPublic

Authored by arsenm on Jul 14 2017, 7:10 PM.

Details

Reviewers
MatzeB
qcolombet
Summary

On AMDGPU SGPR spills are really spilled to another register.
The spiller creates the spills to new frame index objects,
which is used as a placeholder.

This will eventually be replaced with a reference to a position
in a VGPR to write to and the frame index deleted. It is
most likely not a real stack location that can be shared
with another stack object.

This is a problem when StackSlotColoring decides it should
combine a frame index used for a normal VGPR spill with
a real stack location and a frame index used for an SGPR.

Add an ID field so that StackSlotColoring has a way
of knowing the different frame index types are
incompatible.

Diff Detail

Event Timeline

arsenm created this revision.Jul 14 2017, 7:10 PM

I tried to make the stack-id field not print if 0, but the mapOptional feature of adding a 0 as the last argument seems to not work as advertised

MatzeB edited edge metadata.

Seems fine to me, but needs more documentation and this touching a core regalloc datastructure I'm including Quentin in the reviewers.

include/llvm/CodeGen/MachineFrameInfo.h
105–106

This should have a more in-depth explanation. The notion that there is more than 1 stack will be very foreign to most people so there should be more than this sentence.

612–619

Should have some comments (could of course use something like \see StackID so you don't need to repeat the definition of what a StackID is).

arsenm updated this revision to Diff 107448.Jul 20 2017, 12:08 AM
arsenm marked an inline comment as done.

Add documentation

This revision is now accepted and ready to land.Jul 20 2017, 11:29 AM
MatzeB accepted this revision.Jul 20 2017, 12:15 PM

LGTM

arsenm closed this revision.Jul 20 2017, 2:04 PM

r308673