glasgow haskell appears to be adopting LLVM

everyone--

File this under Advocacy.

See this thread <http://www.haskell.org/pipermail/glasgow-haskell-users/2010-February/018425.html> for more information, but the short summary is that they're deprecating their old "compile to GCC" backend in favor of David Terei's new LLVM backend. They're still planning for their C-- backend to be the primary backend for native code generation, but by bundling LLVM with the GHC sources, they'll be able to remove a whole passle of Perl and GCC-related crawling horrors. They're hoping to get some performance improvements out of the migration.

Let us all now give a warm welcome to our new Haskell comrades!

Very nice, care to add a GHC entry to the LLVM Users page?

-Chris

This is very cool!

I thought when I first read Terei's paper's abstract that there would not be a motivation to progress
ghc toward an llvm backend given no improvement in speed even with llvm optimizations turned
on. I completely missed the part about simplicity. I now need to read the paper. :slight_smile: Interesting thread
by the way.

Garrison

Hopefully Mono will be next.

Mono has already used LLVM for various things.

But the various things Mono has used LLVM for have not yet been formally
adopted.

I'll prepare a patch that could be applied when the merge is formally released by the GHC developers.

Just to correct, the GCC back-end isn't being depreciated in favour of the LLVM back-end (as much as I would to claim it was). The GCC back-end has been on the list of things GHC developers wanted to remove for a while now and the larger reason its being done now is that SSE support has recently been added to the native code generator, fixing one of the last advantages the C back-end had. LLVM and a new back-end architecture that should land in GHC soon are somewhat responsible in that a lot of GHC developers see them as the more promising and interesting future than using GCC.

Oh by the way (probably should have posted this a while ago but just lost track of it) here is my honours thesis paper that I wrote about the LLVM back-end for GHC for the interested:

http://www.cse.unsw.edu.au/~pls/thesis/davidt-thesis.pdf

~ David

Hi David,

Your paper is linked on an LLVM site, but I can't give you the url as we are
currently down for maintenance. If I remember correctly it was under "recent papers"
off of the home site.

Garrison

Hi David,

Your paper is linked on an LLVM site, but I can't give you the url as we are
currently down for maintenance. If I remember correctly it was under "recent papers"
off of the home site.

It's here:
http://llvm.org/pubs/2009-10-TereiThesis.html

-Chris

People may be interested in this:

http://donsbot.wordpress.com/2010/02/21/smoking-fast-haskell-code-using-ghcs-new-llvm-codegen/

Benchmarking of the 3 GHC back-ends for code which LLVM particularly excels. Very nice display of how impressive LLVM can be.