There are lots of benchmarks about LLVM vs GCC but I haven't found any about the MIPS Allregrex code? did anyone tried to compare it?
I'd like to know which one generates "better" code. I really like LLVM and learning its code is simpler than GCC (IMHO).
It could give some people interest to improve the LLVM backend to support VFPU instructions.
Any benchmarks between LLVM vs GCC on Allegrex code?
Yeap it is true, i only tried some simple bitcode:
the just used the commands:
Code: Select all
; Declare the string constant as a global constant...
@.LC0 = internal constant [13 x i8] c"hello world\0A\00" ; [13 x i8]*
; External declaration of the puts function
declare i32 @puts(i8 *) ; i32(i8 *)*
; Definition of main function
define i32 @main() { ; i32()*
; Convert [13x i8 ]* to i8 *...
%cast210 = getelementptr [13 x i8 ]* @.LC0, i64 0, i64 0 ; i8 *
; Call puts function to write out the string to stdout...
call i32 @puts(i8 * %cast210) ; i32
ret i32 0
}
Code: Select all
llvm-as hello.ll
opt hello.bc -o hello.opt.bc
# doesn't give anything extra in optimization
llc -march=mips -mcpu=allegrex hello.bc
psp-gcc -c hello.s -o hello.o
# now i can link the object file with psp-gcc and run it on the PSP but this is no test at all...