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

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 12:54:13 PST 2024


efriedma-quic wrote:

> In the latest commit I have made changes to ensure that functions marked with 'nounwind' will not store VG to the stack.

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.

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.

> The mechanism is intended to be more general than simply streaming VL vs non-streaming VL. It is possible to change the non-streaming VL from one value to another, such as via a linux prctl. In those cases there would be no way for the unwinder to recover the previous VL unless the previous VL was specifically saved.

You don't necessarily need to use the same mechanism for this.  And I suspect using the same mechanism is going to be sort of awkward.

> FWIW, there are already other situations where unwinding constrains code generation.

Yes, I know, there are situations where this comes up.  Particularly on Windows.  But I'd like to avoid it when it isn't necessary, and if we're defining the spec, we should consider this situation as we write the spec.

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


More information about the llvm-commits mailing list