[LLVMdev] no differnce in the execution time between seq. and parallel programs

Duncan Sands baldrick at free.fr
Thu Jun 7 11:37:51 PDT 2012


Hi Esraa,

> I want to check with you the compilation steps witout turn on any optimazation
> in both gcc and llvm :
>
> Fft_x.c      The first program before the transformation
> Fft_dswp.c   The second program after the transformation
>
> In gcc compiler I used the following steps
> --Before the transformation
> gcc  –Wall  fft_x.c  –o  samp  -lm
> Time  ./samp
>      0.544         the execution time before transformation
>
> --After the transformation
> Gcc –Wall   fftx_dswp.c  –o  samp  -lm  -lpthread
> Time  ./samp
> 0.319        the execution time after transformation
> -------------------------------------------------------
>
> Then I repeat the same Pervious steps with the llvm
>
> In llvm compiler I used the following steps
>
> --Before the transformation
>
> Llvm-gcc   -c  -emit-llvm    fft_x.c   -o  sam.o
> Llvm-ld  sam.o  -lm
> Time  ./a.out
>      0.320         the execution time before transformation
>
> --After the transformation
> Llvm-gcc   -c  -emit-llvm    fft_dswp.c   -o  sam.o
> Llvm-ld   sam.o  -lm
> Time  ./a.out
>      0.350         the execution time after transformation
> ------------------------------------------------------
>
> Realy I don’t care which one is faster llvm or gcc , but the thing that I care
> about is
> In gcc there was difference in the execution time  before and after the
> transformation, but in llvm I didn’t see any difference in llvm.

By default llvm-ld produces bitcode and a.out is a script that runs it in the
interpreter.  This is not what you want.  You should just do exactly the same
as with gcc, only replacing "gcc" with "llvm-gcc" everywhere, and not bother
with llvm-ld.  Alternatively, pass -native to llvm-ld.

>   In llvm the execution time after the transformation became worse .
>
> if evey thing is ok and no error
>
> My question is
> Are there any strategies that llvm use it to treat with threads that make the
> performance worse.

No.  And since you didn't do any optimization, even if it did have such
strategies they wouldn't be applied.  The difference is probably due to
your accidental use of the interpreter.

Best wishes, Duncan.



More information about the llvm-dev mailing list