Apple will use LLVM

Adam Jackson ajax at redhat.com
Thu Feb 16 15:02:05 UTC 2012


On Thu, 2012-02-16 at 10:22 +0530, Rahul Sundaram wrote:
> On 02/16/2012 10:08 AM, Genes MailLists wrote:
> 
> >   Not to mention that the kernel devs use gcc to compile the kernel -
> > and it most certainly puts a lot of pressure on the compiler. I suspect
> > unless linus drops gcc as well, we'll at a minimum need to keep it to
> > build the kernel itself. 
> 
> Not quite.  LLVM can be used to build the kernel and what Linus does
> doesn't matter as much (kernel is important but only one component) as
> showing that Fedora on the whole will actually benefit from moving to
> LLVM.  For that,  LLVM has to so much better than GCC and someone has to
> do the work within Fedora to show that it is the case.

Since I was a bit (intentionally) curt and dismissive in my other
response in this thread, I'll add some anecdata here.  I have actually
tried building xserver with clang and running the standard set of
microbenchmarks.  I found one relevant path where the clang build was
~15% faster [1].  Something like 60% of the rest were within ±3%.  For
everything else clang was uniformly worse by usually about 5%.

This isn't especially surprising.  Both llvm and gcc have a robust set
of high quality optimization passes.  Changing compiler is in this sense
little different from changing CFLAGS.  It's ricer-tuning at best.  The
performance problems in Linux - in software in general - are almost
always algorithmic, and no compiler is going to magically fix broken
algorithms.  I know it's tempting to look for silver bullets, but we've
pretty much run out of those. [2]

Also, LLVM doesn't support anything newer than DWARF3.  I'm not thrilled
about the idea of generating worse code _and_ worse debugging info.
Particularly not if it means switching to a compiler written in a far
worse language, with far less tribal knowledge in the community I have
to interact with.

LLVM has a role to play.  It's nicely lit a fire under gcc's ass about
plugins being a thing that we really have needed for the last 20+ years,
dammit.  Maybe someday it'll prompt gcc into being usable as a JIT too.
It happens to be the code generation backend for a number of languages,
and it's an okay JIT which is pretty sweet for things like llvmpipe.

But from where I sit, trying to switch to llvm wholesale would make my
life measurably worse on every axis.  I feel like even _cursory_
investigation into the question would have reached this conclusion, and
I kind of resent that it's considered remotely appropriate to suggest
HAY GUYS HAVE YOU HEARD ABOUT THIS NEW COMPILER without having done some
research and maybe gathering some data.

I expect better from a development list.

[1] - I should probably re-do this test and file a gcc bug.

[2] - Much as I hate linking to techcrunch:
http://techcrunch.com/2011/10/25/lead-bullets/

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.fedoraproject.org/pipermail/devel/attachments/20120216/0f994d9f/attachment.sig>


More information about the devel mailing list