[LLVMdev] Query on llvm-gcc v/s llc/as

Duncan Sands
Fri, 17 Sep 2010 19:20:45 -0000

Hi Raghu,

> 1) llvm-gcc -O3 test.c -o testExecutable
>
> 2) llvm-gcc -O3 -emit-llvm -c test.c -o test.bc
>     llc -O3 test.bc -o test.s
>     as test.s -o test.o
>     gcc test.o -o testExecutable2
>
> My question is, are the two executables (testExecutable and
testExecutable2) basically the same ? Is there any huge difference between the
two processes which will impact the executable's running time ? I am asking
this because I compared the executables by their wordcounts (wc -c), and there
was a slight difference. However, when I timed the test runs, both performances
were identical.

the default options are different, for example llc eliminates the frame pointer
by default while llvm-gcc doesn't (on the 32 bit x86 platform).  Also, I
think
llc automatically turns on features (eg: SSE) if your cpu supports it, while
with llvm-gcc this is not automatic.

Ciao,

Duncan.