What are the greatest benefits of LLVM? [closed]

I can't say enough good things about LLVM. It is so easy to work with compared to other compiler projects I have looked at. I am not a compiler guy, but when I get frustrated with some limitation of LLVM or clang it is usually pretty easy to dive in and change it.

We (Nate Begeman, myself, and a few others) wrote the PPC backend with no real experience in compiler design, but it looked simple enough that non-experts could approach it. We were pretty familiar with PPC assembly, but it was still pretty incredible we managed to get LLVM-gcc outputting PPC code in a few weeks of our spare time. Definitely one of the most satisfying Hello World's I have ever compiled.


I have been playing with LLVM on and off for many months now. I wrote two OCaml Journal articles covering the use of LLVM from the OCaml programming language. That is particularly interesting because the OCaml language is ideal for writing compilers and has a wealth of powerful and mature tools and libraries for parsing and so on.

Overall, my experience has been extremely positive. LLVM does what it says on the tin and is very easy to use. The performance of the generated code is superb. One of the programs I wrote was a simple little Brainf*ck compiler that generates some of the fastest executables of any compiler I tested (including GCC).

I have only two gripes with LLVM. Firstly, it uses abort() whenever anything goes wrong instead of raising an exception. This was a deliberate design decision by its authors who are striving to remove all uses of exceptions from LLVM but it makes it impossible to get backtraces from OCaml when trying to debug a compiler that uses LLVM: your program just dies with a textual explanation from LLVM but no clue as to where the error occurred in your source. Secondly, LLVM's compiled library is monstrously big (20Mb). I assume this is due to the bloat incurred by C++ but it makes compilation painfully slow.

EDIT: My work on LLVM culminated in the creation of a high-performance high-level garbage-collected virtual machine. Free download here and check out the corresponding benchmarks (wow!). @Alex: I'll get that BF compiler up for you somewhere ASAP.


I've had an initial play around with LLVM and working through this tutorial left me very very excited about it's potential; the idea that I can use it to build a JIT into an app with relative ease has me stoked.

I haven't gone deep enough to be able to offer any kind of useful opinion on it's limitations, stability, performance and suchlike. I understand that it's good on all counts but that's purely hearsay.


You asked about tools and I would like to mention that there is LLVM plugin for Eclipse CDT (for Windows, Linux and Mac). It integrates LLVM nicely to IDE and the user does not need to know anything about LLVM. Pressing build button is enough to produce .bc and executable files (and intermediate files on the background not visible for the user).

The latest version is available via official Eclipse update site: http://download.eclipse.org/releases/mars

It is under Programming Languages and is named "C/C++ LLVM-Family Compiler Build Support".