[llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

Kerry McLaughlin via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 04:32:11 PDT 2024


kmclaughlin-arm wrote:

> On a related note, I'm not sure what we're generating here is really what we want for aarch64_pstate_sm_body. A aarch64_pstate_sm_body has two vector lengths: the length used for spilling the callee-saves, and the length used for local variables. If we only store the former, debuggers can't display local variables.

Thank you for raising this @efriedma-quic , it's something that was not handled correctly in my original patch. After some offline discussion about this scenario, I have made changes to the patch to ensure the correct value of VG can be recovered from locally-streaming functions. As I understand it, we need to store both the streaming and non-streaming vector length in the prologue and additionally save the streaming length before calls which require streaming-mode changes. After such calls, I believe we need to use `.cfi_restore` to set the rule for VG to the same as it was at the beginning of the function (which will be the non-streaming length).

This is based on my understanding of the specification as it is today, but I am happy to try a different implementation if this changes.

> Not sure this is actually the right choice, given the interaction with debug info. Presumably we want debuggers to be able to produce a stack trace for nounwind code.

Do you know if there is something else I could be checking to decide whether to emit VG for the nounwind case, or if it's better to remove the calls to `F.needsUnwindTableEntry()` that I added in the last commit altogether?

https://github.com/llvm/llvm-project/pull/83301


More information about the llvm-commits mailing list