[llvm-dev] C returning struct by value

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 28 09:28:20 PDT 2016


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.


More information about the llvm-dev mailing list