[LLVMdev] First class aggregates of small size: split when used in function call

Reid Kleckner rnk at google.com
Wed Dec 31 10:10:20 PST 2014


On Wed, Dec 31, 2014 at 10:05 AM, Reid Kleckner <rnk at google.com> wrote:

> The current recommendation for matching external C ABIs is actually "use
> Clang", as in literally link it into your program and try to leverage the
> methods of clang::CodeGen::CodeGenFunction. This is the only way to get the
> lowering 100% correct, but it's a lot of work, so depending on your needs,
> you may want to roll your own lowering of high-level function prototype to
> LLVM function prototype.
>

I should mention this was the topic of a talk by John McCall at the LLVM
dev meeting:
http://llvm.org/devmtg/2014-10/Slides/Skip%20the%20FFI.pdf

See slides starting around #101 for why this is hard and the many different
ways of lowering this C function prototype into LLVM IR:

typedef struct {
 float x, y;
} Point2f;
Point2f flipOverXAxis(Point2f point) {
 // ...
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141231/7579cc05/attachment.html>


More information about the llvm-dev mailing list