This is an archive of the discontinued LLVM Phabricator instance.

[SjLj] Insert UnregisterFn before musttail call
ClosedPublic

Authored by lxfind on Jun 23 2021, 11:59 AM.

Details

Summary

When inserting UnregisterFn, if there is a musttail call, we must insert before the call so that we don't break the musttail call contract.

Diff Detail

Event Timeline

lxfind created this revision.Jun 23 2021, 11:59 AM
lxfind requested review of this revision.Jun 23 2021, 11:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2021, 11:59 AM

The change looks good. But...

  • I wonder how many more times we'll have to deal with this.. It indeed seems hard to enforce without IR change :(
  • Are we hitting SJLJ path? I thought there's no usage of that for our codebase.

The change looks good. But...

  • I wonder how many more times we'll have to deal with this.. It indeed seems hard to enforce without IR change :(
  • Are we hitting SJLJ path? I thought there's no usage of that for our codebase.

This was hit in armv7 for iOS.
Yeah I couldn't think of a way to enforce this.

wenlei accepted this revision.Jun 23 2021, 12:21 PM

lgtm, thanks.

This revision is now accepted and ready to land.Jun 23 2021, 12:21 PM

What would an IR change look like to enforce this?

What would an IR change look like to enforce this?

Modify the IR insertion API and adjust insertion point whenever a musttail call is detected?

This revision was automatically updated to reflect the committed changes.
lxfind reopened this revision.Jun 23 2021, 3:32 PM
This revision is now accepted and ready to land.Jun 23 2021, 3:32 PM
This revision was automatically updated to reflect the committed changes.