Skip to content

[lldb][swift] Increase number of Rows inspected when unwinding async functions #10698

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

Open
wants to merge 1 commit into
base: swift/release/6.2
Choose a base branch
from

Conversation

felipepiovezan
Copy link

We were overly conservatives in our initial estimations: if callee saved registers are used, they are usually spilled first, increasing the number of rows in the prologue.

@felipepiovezan felipepiovezan requested a review from a team as a code owner May 17, 2025 02:02
@felipepiovezan
Copy link
Author

@swift-ci test

…functions

We were overly conservatives in our initial estimations: if callee saved
registers are used, they are usually spilled first, increasing the
number of rows in the prologue.

This also revealed an embarrassing bug in how we computed the offset of
a iterator in the vector:

```
-  int row_idx = fp_locs.end() - it;
+  int row_idx = it - fp_locs.begin();
```
@felipepiovezan felipepiovezan force-pushed the felipe/tweak_unwind_rows branch from 9c8ca42 to 8137dee Compare May 19, 2025 04:06
@felipepiovezan
Copy link
Author

@swift-ci test

@jasonmolenda
Copy link

jasonmolenda commented May 19, 2025

I spoke in DM with Felipe about one small concern, the AAPCS ABI has 10 general purpose registers marked callee-preserved, and 8 floating point registers. If they're stored with STP instructions, that means we can have the initial unwind state row, two standard prologue rows, and then 9 rows of registers being stored to stack before the stack pointer is copied into the frame pointer, worst possible case?
This is very UNLIKELY, and if the function is a leaf function the compiler will prefer to use volatile registers that don't need to be saved, but I think it is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants