This is an archive of the discontinued LLVM Phabricator instance.

[NFC][X86] Sret return register cleanup
ClosedPublic

Authored by urnathan on Aug 26 2021, 6:09 AM.

Details

Summary

In working on the in-memory sret tail-calling problem, I ran into this. As I want to adjust this code for sret, I figured it best to get this change in first. It turns out that there are no paths into LowerFormalParms that have already specified the sret register. We always materialize a virtual and then assign it to the physical reg at the point of the return. Thus the 'if (!reg)' body is always reachable. Tested by (a) grepping for setSRetReturnReg calls (there are no others), and (b) building and testing with this assert added.

Diff Detail

Event Timeline

urnathan created this revision.Aug 26 2021, 6:09 AM
urnathan requested review of this revision.Aug 26 2021, 6:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2021, 6:09 AM
rnk accepted this revision.Aug 26 2021, 11:41 AM

lgtm

This revision is now accepted and ready to land.Aug 26 2021, 11:41 AM
This revision was automatically updated to reflect the committed changes.