[llvm-dev] C returning struct by value

Michael Nicolella via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 28 14:14:53 PDT 2016


Thanks for the explanation. It's good to hear the situation isn't felt to
be ideal.

The details here are going to be sensitive to the OS + target that I'm
compiling for, right? So the effort here will be to understand and get
right the calling convention details for each supported target, yes?

Is there any current plan to change the way this works, or is it more of a
dreamy cleanup item that maybe will get addressed some day?

Appreciate the tip.

On Mon, Mar 28, 2016 at 9:28 AM, Tim Northover <t.p.northover at gmail.com>
wrote:

> On 27 March 2016 at 21:48, Michael Nicolella via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > Can someone help me understand why this detail needs to be understood by
> the frontend,
>
> Many of the backends can do automatic demotion to sret, but the
> front-end still needs to be aware of the issues (particularly around
> unions, since whether demotion is necessary can depend on more than
> just the size of the type).
>
> I'd also expect marginally better code in some cases by using sret
> explicitly: the demotion occurs pretty late on and a "%type *sret"
> parameter better represents what will actually be happening later on.
>
> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160328/01db01b7/attachment.html>


More information about the llvm-dev mailing list