[PATCH] D48580: [AArch64] Support reserving x1-7 registers.

Tri Vo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 24 09:58:18 PDT 2018


trong added a comment.
Herald added a subscriber: jfb.

In https://reviews.llvm.org/D48580#1168502, @jyknight wrote:

> In https://reviews.llvm.org/D48580#1168490, @jyknight wrote:
>
> > In https://reviews.llvm.org/D48580#1168470, @manojgupta wrote:
> >
> > > @efriedma  Maybe not relevant to the patch here but our kernel devs were looking into preserve_all but it does not seem to work for AArch64.
> > >
> > > $ cat test.c 
> > >  void __attribute__((preserve_all)) foo(void *ptr) { }
> > >
> > > $ clang -c test.c -> compiles for x86_64
> > >  $ clang -c -target aarch64-unknown-linux-gnu
> > >
> > > fatal error: error in backend: Unsupported calling convention.
> >
> >
> > What clang version is that? Works fine for me.
>
>
> Ugh, nevermind -- I take that back. *Old* clang didn't complain about it, new clang does. Haven't checked, maybe it was ignoring it before or something. :(
>
> Anyhow, IMO, we should make that work, and not do this.


It does seem like the kernel only needs registers to be callee-saved for a small number of functions. I agree that calling convention annotation is a nicer solution. 
I'll investigate further if we can support CONFIG_ARM64_LSE_ATOMICS with function attributes instead of -ffixed-, etc.


Repository:
  rL LLVM

https://reviews.llvm.org/D48580





More information about the llvm-commits mailing list