This is an archive of the discontinued LLVM Phabricator instance.

[Statepoints] FixupStatepoint: Clear isKill flag if COPY is not deleted.
ClosedPublic

Authored by dantrushin on Jun 8 2022, 7:50 AM.

Details

Summary

When spilling CSRs, FixupStatepoint pass does simple copy propagation,
trying to find COPY instruction which defines register being spilled
and spill COPY source instead. I.e., if we have CSR $x and found

$x = COPY $y

we will spill $y instead.
But we may be unable to delete COPY instruction for some reason.
Then, spill will be inserted after it, adding another use of $y.
If COPY instruction was last use of $y (killed it), after insertion of
the spill it is not, so isKill flag must be cleared. We failed to do
so and this patch fixes this issue.

Diff Detail

Event Timeline

dantrushin created this revision.Jun 8 2022, 7:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 7:50 AM
dantrushin requested review of this revision.Jun 8 2022, 7:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 7:50 AM

Can you please land the test first and in this patch upload the diff what changed.

dantrushin updated this revision to Diff 435544.Jun 9 2022, 7:37 AM

Rebase on top of precommitted test

dantrushin updated this revision to Diff 435548.Jun 9 2022, 7:42 AM

Fix spaces in test to minimize differences

skatkov accepted this revision.Jun 9 2022, 8:43 PM

Thanks!

This revision is now accepted and ready to land.Jun 9 2022, 8:43 PM
This revision was landed with ongoing or failed builds.Jun 14 2022, 12:53 AM
This revision was automatically updated to reflect the committed changes.