[PATCH] D49464: [COFF, ARM64] Decide when to mark struct returns as SRet

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 24 12:09:04 PDT 2018


mgrang added a comment.

In https://reviews.llvm.org/D49464#1172767, @rnk wrote:

> In https://reviews.llvm.org/D49464#1172754, @mgrang wrote:
>
> > The ABI doc just distinguishes between POD and non-POD types.
> >
> >   The address of the memory block shall be passed as an additional argument to the function in x8 for POD type, or in x0 (or x1 if $this is passed in x0) for non-POD type.
> >
> > So even for instance methods returning PODs, X8 should be used.
>
>
> Experimentation shows otherwise: https://godbolt.org/g/jQVW78 X1 is used to pass the sret parameter. Trust but verify. :)


Thanks Reid. Yes, you are correct. Instance methods seem to use X1 for struct returns. I have updated my patch accordingly. I guess the doc needs fixing.


https://reviews.llvm.org/D49464





More information about the llvm-commits mailing list