This is an archive of the discontinued LLVM Phabricator instance.

AArch64: support compact unwind with swifterror parameters.
Needs ReviewPublic

Authored by t.p.northover on Feb 23 2023, 3:08 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Swifterror parameters are essentially "inout" ones that are passed in x21. Because they're also returned they can't be restored in the epilogue and so must be removed from the callee-saved register list. Unfortunately this leads to a frame layout that compact unwind can't describe (it assumes that if x20 is saved then x21 always will be too).

This patch sort of adds it back into the CSR list, but in epilogues we discard the value by loading xzr instead of x21, which makes the frames look normal again as far as an unwinder is concerned (swifterror isn't live along the unwind path anyway so restoring it there is harmless). The regmask is intentionally left as-is (i.e. with x21 removed).

Diff Detail

Event Timeline

t.p.northover created this revision.Feb 23 2023, 3:08 AM
t.p.northover requested review of this revision.Feb 23 2023, 3:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2023, 3:08 AM