[llvm-commits] sret-demotion for large struct returns working on x86!

Sandeep Patel deeppatel1987 at gmail.com
Mon Nov 9 12:42:29 PST 2009


On Mon, Nov 9, 2009 at 2:37 AM, Kenneth Uildriks <kennethuil at gmail.com> wrote:
> If a struct can't be returned in registers, have SelectionDAGBuild
> insert a hidden sret parameter and have return instructions store the
> return value through the hidden pointer.  Formal arguments, return
> instructions, and calls are all updated as needed.
>
> Only x86 has the code to actually check whether sret-demotion is
> needed.... other platforms invariably report that they can return
> values in registers, even when they can't.

There is definitely an ABI issue here. For ARM AAPCS-VFP, we need to
decide that a aggregate is to be passed in registers based on
information like unions which aren't represented in the LLVM IR.

Perhaps I've missed the overall goal. If the CC is "fast" then this
sort of thing makes a lot of sense, but "C" and other CCs need to be
established by the front-end and not perturbed by the backend.

deep




More information about the llvm-commits mailing list