* libffi & LLVM
@ 2009-10-23 11:41 Anthony Green
2009-10-23 12:02 ` Andrew Haley
2009-10-28 11:15 ` Gary Benson
0 siblings, 2 replies; 3+ messages in thread
From: Anthony Green @ 2009-10-23 11:41 UTC (permalink / raw)
To: libffi-discuss
The latest MacRuby version replaced libffi with LLVM for closure
support, the result of which is 3 to 4 times performance boost:
http://www.macruby.org/blog/2009/10/07/macruby05b1.html
I've been thinking for a while that a LLVM backend to libffi makes
sense. Does anybody have any thoughts or opinions on this?
Is this what libffi 4 should be?
AG
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: libffi & LLVM
2009-10-23 11:41 libffi & LLVM Anthony Green
@ 2009-10-23 12:02 ` Andrew Haley
2009-10-28 11:15 ` Gary Benson
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Haley @ 2009-10-23 12:02 UTC (permalink / raw)
To: Anthony Green; +Cc: libffi-discuss
Anthony Green wrote:
> The latest MacRuby version replaced libffi with LLVM for closure
> support, the result of which is 3 to 4 times performance boost:
> http://www.macruby.org/blog/2009/10/07/macruby05b1.html
I wonder if they measured the overhead for generating the closures.
If they didn't, perhaps we should. Also, LLVM has a pretty big
footprint. So, it's not all positive.
> I've been thinking for a while that a LLVM backend to libffi makes
> sense. Does anybody have any thoughts or opinions on this?
It makes some sense, but I warn you: while working on Shark we've
found that the JIT interfaces to LLVM are rather unstable. We'd be
setting libffi up for an eternal game of catch-up every time the
LLVM interfaces change. (Perhaps not eternal: there's every chance
that as LLVM matures its JIT interface will stabilize.)
A better solution for libffi closures would be for libffi to generate
its own code, but I think that would be too much effort, given the
complexity of some of the ABIs we have to work with.
Andrew.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: libffi & LLVM
2009-10-23 11:41 libffi & LLVM Anthony Green
2009-10-23 12:02 ` Andrew Haley
@ 2009-10-28 11:15 ` Gary Benson
1 sibling, 0 replies; 3+ messages in thread
From: Gary Benson @ 2009-10-28 11:15 UTC (permalink / raw)
To: libffi-discuss
Anthony Green wrote:
> The latest MacRuby version replaced libffi with LLVM for closure
> support, the result of which is 3 to 4 times performance boost:
> http://www.macruby.org/blog/2009/10/07/macruby05b1.html
I'm looking at doing something similar for Shark. In this case,
it wouldn't be a straight replacement; methods would default to
using libffi, and hot methods would be replaced with LLVM-build
wrappers (in much the same way as interpreted methods default to
using the interpreter and get replaced with LLVM-compiled code
when hot).
> I've been thinking for a while that a LLVM backend to libffi
> makes sense. Does anybody have any thoughts or opinions on
> this?
Note that LLVM does not have JIT backends for anything like as
many platforms as libffi supports. x86, x86_64, ppc, ppc64
(maybe), alpha and arm is I think it.
Cheers,
Gary
--
http://gbenson.net/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-28 11:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-23 11:41 libffi & LLVM Anthony Green
2009-10-23 12:02 ` Andrew Haley
2009-10-28 11:15 ` Gary Benson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).