[PATCH] D84044: [AArch64][SVE] Add missing unwind info for SVE registers.
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 27 09:08:29 PDT 2020
sdesmalen added a comment.
In D84044#2172957 <https://reviews.llvm.org/D84044#2172957>, @efriedma wrote:
> > No changes are needed in Clang to support this AFAIK.
>
> (I meant loosely a change to clang and/or LLVM.)
>
> Consider the following testcase:
>
> #include <arm_sve.h>
> void g1(svuint8_t);
> void g2(svuint8_t);
> struct Z { svuint8_t *x; ~Z() { g2(*x); } };
> svuint8_t f(svuint8_t a, svuint8_t b) {
> Z z{&a};
> g1(b);
> return b;
> }
>
>
> If unwind doesn't preserve SVE registers, we need a spill here. clang currently doesn't generate one at -O2.
Yes, great spot! The caller should assume that all SVE registers are clobbered by the unwinder if the function _may_ throw an exception. I think I'll create a separate patch to fix this, as it's not necessarily something to do with how LLVM emits the unwind info, but rather a bug where the caller doesn't honour the right CC.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84044/new/
https://reviews.llvm.org/D84044
More information about the llvm-commits
mailing list