This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Delete spills of undef values
AcceptedPublic

Authored by arsenm on Mar 28 2022, 11:50 AM.

Details

Reviewers
scott.linder
Group Reviewers
Restricted Project
Summary

It would be a bit more logical to preserve the undef and do the normal
expansion, but this is less work. This avoids verifier errors in a
future patch which starts deleting liveness from registers after
allocation failures which results in spills of undef values.

Diff Detail

Unit TestsFailed

Event Timeline

arsenm created this revision.Mar 28 2022, 11:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2022, 11:50 AM
arsenm requested review of this revision.Mar 28 2022, 11:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2022, 11:50 AM
Herald added a subscriber: wdng. · View Herald Transcript
scott.linder added inline comments.
llvm/test/CodeGen/AMDGPU/sgpr-spill-partially-undef.mir
69

Is there any downside to the VGPR remaining livein, even if no spill to it survives? I can't tell if the VGPR remains reserved in this case, but if not could the liveness end up incorrect?

arsenm added inline comments.Mar 28 2022, 2:35 PM
llvm/test/CodeGen/AMDGPU/sgpr-spill-partially-undef.mir
69

Not really. We both add the VGPRs selected for SGPR spills to live ins and redundantly add them to reserved registers. We should also probably work on spilling to virtual VGPRs now that the passes are split

This revision is now accepted and ready to land.Mar 28 2022, 3:37 PM