Hi Grigori,

Hope my question will not completely divert the topic of this discussion -
just curious what do you mean by better code? Better execution time, code size,
compilation time?..

this depends on each persons needs of course.  The dragonegg plugin makes it
easy for people to see if the LLVM optimizers and code generators are helpful
for their projects.  Evaluating whether replacing whole-sale the gcc middle and
backends with LLVM (which I consider pretty unlikely) is an overall win is much
harder, but I doubt anyone on this mailing list needs to be told that.

If yes, then why not to compare different compilers by just compiling multiple 
programs
with GCC, LLVM, Open64, ICC, etc, separately to compare those characteristics 
and then
find missing optimizations or better combinations of optimizations to achieve 
the result?

how do you compile a program with LLVM?  It's not a compiler, it's a set of
optimization and codegen libraries.  You also need a front-end, which takes
the users code and turns it into the LLVM intermediate representation [IR].  The
dragonegg plugin takes the output of the gcc-4.5 front-ends, turns it into LLVM
IR and runs the LLVM optimizers and code generators on it.  In other words, it
is exactly what you need in order to compile programs with LLVM.  There is also
llvm-gcc, which is a hacked version of gcc-4.2 that does much the same thing,
and for C and C++ there is now the clang front-end to LLVM.  The big advantage
of dragonegg is that it isolates the effect of the LLVM optimizers and code
generators by removing the effect of having a different front-end.  For example,
if llvm-gcc produces slower code than gcc-4.5, this might be due to front-end
changes between gcc-4.2 and gcc-4.5 rather than because the gcc optimizers are
doing a better job.  This confounding factor goes away with the dragonegg
plugin.

Ciao,

Duncan.

Reply via email to