What are the greatest benefits of LLVM?

Does anyone have experience with LLVM , llvm-gcc , or Clang ?

The whole idea of โ€‹โ€‹llvm seems very intriguing to me, and I am interested to know how it works. I just do not want to spend a lot of time trying tools if the tools are not ready for production.

If you have experience working with tools, what do you think of them? What are the main limitations you encountered? What are the biggest benefits?

Thank you very much!

+44
c ++ c clang llvm
Oct 05 '08 at 23:48
source share
4 answers

I had an initial game with LLVM and working through this tutorial left me very excited about this potential; The idea that I can use it to create JIT in an application with relative ease made me calm.

I did not go deep enough to be able to offer any useful opinion on these limitations, stability, performance, etc. I understand that this is good on all counts, but these are purely rumors.

+21
06 Oct '08 at 0:03
source share

I cannot say enough good things about LLVM. This is easy to work with compared to other compiler projects that I have looked at. I am not a compiler, but when I get frustrated with some LLVM or clang limitations, it is usually pretty easy to dive and modify it.

We (Nate Begeman, I and some others) wrote a PPC backend without real experience in compiler development, but it looked simple enough for non-specialists to fit it. We were very familiar with the PPC assembly, but it was incredibly incredible that we managed to get LLVM-gcc, which displays the PPC code for several weeks of our free time. Definitely one of the most satisfying Hello World I've ever compiled.

+39
Nov 01 '08 at 1:17
source share

I played with LLVM for many months. I have written two articles of the OCaml Journal on the use of LLVM from the OCaml programming language. This is especially interesting because the OCaml language is ideal for writing compilers and has many powerful and mature parsing tools and libraries, etc.

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

I have only two problems with LLVM. First, it uses abort () whenever something goes wrong, instead of throwing an exception. It was a deliberate design decision by its authors, who seek to remove all applications of exceptions from LLVM, but it makes it impossible to get backtracks from OCaml when trying to debug a compiler that uses LLVM: your program just dies with a text explanation from LLVM but donโ€™t know where it happened error in your source. Secondly, the LLVM compiled library is monstrously large (20Mb). I assume this is due to the bloat caused by C ++, but this makes compilation difficult.

EDIT: My work on LLVM resulted in a high-performance virtual machine with a high level of garbage collection. Download here and check the related tests (wow!). @Alex: I will get this BF compiler for you somewhere as soon as possible.

+25
Nov 22 '08 at 7:22
source share

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

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

It is located in the Programming Languages โ€‹โ€‹section and is called "C / C ++ LLVM-Family Compiler Build Support".

+2
May 13, '11 at 8:46 a.m.
source share



All Articles