This is an archive of the discontinued LLVM Phabricator instance.

MIR: Preserve incoming frame index numbers
ClosedPublic

Authored by arsenm on Dec 3 2018, 3:35 PM.

Details

Summary

Don't skip incrementing the frame index number
if the object is dead. Instructions can still be
referencing the old frame index number, and this
doesn't attempt to remap those. The resulting
MIR then fails to load because the use instructions
use a higher frame index number than recorded
list of stack objects.

I'm not sure it's possible to craft a testcase
with the existing set of passes. It requires
selectively marking some stack objects
dead in an essentially random order.
StackSlotColoring condenses towards
the low indexes. This avoids a regression in a
future AMDGPU commit when some frame indexes
are lowered separately from PEI.

Diff Detail

Event Timeline

arsenm created this revision.Dec 3 2018, 3:35 PM
arsenm updated this revision to Diff 176692.Dec 4 2018, 12:35 PM

Attach correct patch

Why is it valid for instructions to reference a dead frame index?

Why is it valid for instructions to reference a dead frame index?

That's not what's happening. The instructions are accessing live frame frame indexes, but there are dead ones in the frame object list. This was just arbitrarily renumbering them so the instructions are now accessing the incorrect, dead frame indexes.

aemerson accepted this revision.Feb 22 2019, 11:11 AM

I see. LGTM then.

This revision is now accepted and ready to land.Feb 22 2019, 11:11 AM
arsenm closed this revision.Feb 22 2019, 11:30 AM

r354688