[LLVMdev] libFirm library

Daniel Berlin dberlin at dberlin.org
Tue Dec 2 22:33:24 PST 2008


On Mon, Dec 1, 2008 at 6:26 PM, Roman Levenstein <romixlev at yahoo.com> wrote:
> Hi,
>
> The libFirm library ( http://www.info.uni-karlsruhe.de/software/libfirm/index.php?title=Main_Page ) is GPLed some time ago.
> libFirm is a library that provides an intermediate representation and optimizations for compilers.
> Programs are represented in a graph based SSA form. Several targets are supported, especially the x86.
>
> Many optimizations are very similar to those of LLVM. But there are also some differences.
> This is what I could find out by quickly looking at the source code:
> - It seems to have a different register allocator that works directly on the SSA form and performs chordal graph register allocation.
>  This is implemented by Sebastian Hack who is one of the pioneers working on the register allocation by means of chordal graph coloring.
>
> - libFirm seems to have more advanced spilling and coalescing heuristics
>
> - libFirm contains the implementation of the very fast liveness analysis based on the dominance information.
>  There was a discussion on this mailing list about including this algorithm into LLVM recently, if I remember correctly.
>
> There is a discussion about libFirm on the FreeBSD mailing lists:
> http://groups.google.co.kr/group/mailing.freebsd.hackers/browse_thread/thread/9dd9b232a5ab6a52
>
> Apparently, people have asked how it compares to LLVM, both architecturally and performance-wise.
> And there are some replies from the libFirm developers in the thread mentioned above.
> BTW, on the project page there are some SPEC2000 performance comparisons with GCC, LLVM-GCC and Intel  Compilers.
> It would be interesting to hear an opinion regarding those issues from the LLVM developers as well, I guess.
> Anyone willing to comment?
>
> In any case, this library contains a lot of interesting and related things and worse looking at it and investigating a bit deeper what it is and what it provides.
> May be some ideas could be interesting and beneficial for LLVM.
>
> Any opinions about it?

Look at the algorithm implementations that i am familiar with (GVNPRE,
for example), i know i can make FIRM run ridiculously slow on even
trivial code.

Also, it appears to have some "interesting" viewpoints on aliasing and
when things alias.
My guess would be these + good regalloc account for it's good spec scores.
SPEC2000 is a very easy benchmark to game on an aliasing because it's
mostly single file programs that you can make all kinds of wildly
incorrect aliasing assumptions about and still get the right answer.

I wonder what percent of gcc's simple c torture and execute testsuite
(which is small programs that 99% of the time don't use gcc extensions
and will abort if they get the wrong answer) it would pass.



More information about the llvm-dev mailing list