-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[DebugInfo] Dont generate info for __swift_async_resume_project_conte… #75553
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
[DebugInfo] Dont generate info for __swift_async_resume_project_conte… #75553
Conversation
Requires swiftlang/llvm-project#9025 |
@@ -2603,7 +2603,7 @@ llvm::Function *IRGenFunction::getOrCreateResumePrjFn(bool forPrologue) { | |||
auto callerContext = IGF.emitAsyncResumeProjectContext(addr); | |||
Builder.CreateRet(callerContext); | |||
}, | |||
false /*isNoInline*/, forPrologue)); | |||
false /*isNoInline*/, true/*for prologue*/)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove the forPrologue
parameter from getOrCreateResumePrjFn
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't, because this function is used in a ton of places, most of them with "for prologue" == false.
What it would be nice is to rename this parameter to something more meaningful like "skip debug info", since this is what this parameter does. The original patch mixed the motivation from call sites with the effect inside this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry I missed that this could be called for one of two async resume functions, and it uses forPrologue
to pick the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test for this, so it's more obvious what changes?
…xt or __swift_async_resume_get_context These functions are alwaysinline and their instructions are created with line 0 as a location. As a result, the instructions all get inlined with line 0 into funclets. In practice, this makes it so that the first instruction of the funclet containing a debug location happens much later. This is important because the inlined instructions do meaningful work, like overwriting the contents of `fp - 8`. If we try to set a breakpoint into this funclet, we *must* break before these instructions, by allowing the line 0 locations to propagate, we fail to do. This patch changes this by removing all debug locations from the helper functions. By doing so, when they are inlined, instructions will inherit the location of the call site.
f333324
to
768f391
Compare
Superseded by #75881 |
…xt or __swift_async_resume_get_context
These functions just return their own parameter and are inlined. We don't want to see any debug information nor inlined frames for these when looking at async backtraces.
Not only is it a bad user experience, but these inlined frames are involved in tail calls in virtual backtraces, which thoroughly confuse the debugger.