[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
Fri Apr 12 10:12:51 PDT 2024
kmclaughlin-arm wrote:
> What if you compile the code with SVE disabled, and the target actually does end up having SVE at runtime? (e.g. you compile a library in SME-but-not-SVE mode, but it gets linked into an application that uses SVE.)
I believe checking for `hasSVE` will be sufficient for non-streaming functions which contain a call to a streaming-mode function. Even if the target does end up having SVE, there shouldn't be any relevant VG value in the function to save if it was only compiled with SME.
However, there are a couple of cases not covered here if the code is compiled without SVE, but the target has SVE:
- Streaming caller -> non-streaming callee.
- Streaming-compatible caller -> non-streaming callee.
It should be quite straightforward to extend this patch to cover the first of the cases above, as we can still emit `cntd` in the prologue if the function is in streaming mode. However, the second will be more involved as we can only emit the `cntd` & `.cfi_offset` if the condition guarding the `smstart`/`smstop` is true at runtime. To keep this first patch simpler, would you be happy for this to be limited to handle only the typical cases where the target has SVE?
https://github.com/llvm/llvm-project/pull/83301
More information about the llvm-commits
mailing list