This is an archive of the discontinued LLVM Phabricator instance.

[StackSlotColoring] Fixed handling of StackID
AbandonedPublic

Authored by tpr on Jun 21 2018, 12:51 AM.

Details

Reviewers
arsenm
Summary

StackID is a property of a stack slot that allows a target to have
multiple spaces for spilling into. AMDGPU uses it to allow SGPRs to be
spilled into a VGPR, instead of using a real stack slot.

This commit fixes StackSlotColoring to ensure that two stack objects
with different StackID really don't share a slot, even if they are
colored out of order, and that the StackID gets set up in the colored
frame ids for later use.

Change-Id: I6a4d88ad7739d5d0550162b907e394b57fb3e437

Diff Detail

Event Timeline

tpr created this revision.Jun 21 2018, 12:51 AM
tpr added a reviewer: arsenm.Jun 21 2018, 12:52 AM
tpr added a subscriber: dstuttard.Jun 21 2018, 12:53 AM
tpr added a comment.Jun 21 2018, 12:58 AM

Sorry, no test. My reproducer is enormous. I tried to modify test/CodeGen/AMDGPU/stack-slot-color-sgpr-vgpr-spills.mir to color the two slots out of order by adding extra references to one to change the weight, but it still did it in order. So I couldn't get it to fail without this change.

I have a quite small .ll that causes assertion in SIFrameLowering.cpp, if you need

tpr added a comment.Jun 22 2018, 9:15 AM

Thanks Daniil.

tpr abandoned this revision.Jun 23 2018, 1:37 PM

Use D45968 instead.