I am currently working on running some llvm passes and would like to benchmark their usefulness using the SPEC 2006 CPU benchmark suite. However, I've not figured out how to modify the SPEC setup to do anything other than use llvm-gcc to output llvm bitcode. Here is what I'd like to modify the workflow of SPEC to do:
compile the .o files with llvm into llvm-bytecode
llvm-gcc -emit-llvm *.c
For each .o file, run opt (llvm's optimization pass):
opt -adce -mem2reg cfline.o
Link with llvm-link:
llvm-link *.o -o out.o.linked
Turn the llvm bytecode into assembly
llc out.o.linked
And finally turn that into executable code:
gcc out.o.linked -o out.executable
Is there a way I can do this? I know I can edit the .cfg files to emit llvm, but then I don't know how to choose a different linking/pre-linking procedure.
Thanks!