Skip to content

[5.7] IRGen: Use the current function name for the swift_suspend_point thunk #42481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

aschwaighofer
Copy link
Contributor

@aschwaighofer aschwaighofer commented Apr 20, 2022

This is an incremental improvement of the debug info at a
(hop_to_executor) suspend site.

Before this patch the debug info at the call site would use the
__swift_suspend_point function name as the current function after
coro lowering has inlined the thunk.

The proper fix is to rewire the debug info such that the thunk name is
never mentioned rather the current function that suspend site sits in is
used.

Until I have figured out how to do that using the current function name
instead of __swift_suspend_point for the thunk is an incremental
improvement in the debug information consumers can observe.

rdar://90859530

This is the same approach as we took for the await suspend points (vs.
hop to executor in this patch) in the PR #41645.

Risk is very low, only a function name of a function that is guaranteed
to be inlined during coroutine splitting is changed.

Matching main PR: #42454

…t thunk

This is an incremental improvement of the debug info at a
(hop_to_executor) suspend site.

Before this patch the debug info at the call site would use the
`__swift_suspend_point` function name as the current function after
coro lowering has inlined the thunk.

The proper fix is to rewire the debug info such that the thunk name is
never mentioned rather the current function that suspend site sits in is
used.

Until I have figured out how to do that using the current function name
instead of `__swift_suspend_point` for the thunk is an incremental
improvement in the debug information consumers can observe.

rdar://90859530

This is the same approach as we took for the await suspend points (vs.
hop to executor in this patch) in the PR swiftlang#41645.

Risk is very low, only a function name of a function that is guaranteed
to be inlined during coroutine splitting is changed.
@aschwaighofer aschwaighofer requested a review from a team as a code owner April 20, 2022 16:37
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

aschwaighofer added a commit to aschwaighofer/swift that referenced this pull request Apr 20, 2022
…pend_point thunk

This is an incremental improvement of the debug info at a
(hop_to_executor) suspend site.

Before this patch the debug info at the call site would use the
`__swift_suspend_point` function name as the current function after
coro lowering has inlined the thunk.

The proper fix is to rewire the debug info such that the thunk name is
never mentioned rather the current function that suspend site sits in is
used.

Until I have figured out how to do that using the current function name
instead of `__swift_suspend_point` for the thunk is an incremental
improvement in the debug information consumers can observe.

rdar://90859530

This is the same approach as we took for the await suspend points (vs.
hop to executor in this patch) in the PR swiftlang#41645.

Risk is very low, only a function name of a function that is guaranteed
to be inlined during coroutine splitting is changed.

Matching `main` PR: swiftlang#42454
Matching `release/5.7` PR: swiftlang#42481
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@aschwaighofer aschwaighofer merged commit fc93c17 into swiftlang:release/5.7 Apr 21, 2022
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants