I download the 2.0 source and compile the llvm-gcc and llvm source code successfully. now try to compile the following two files using linking time optimization:
extern foo(int *x);
int x = 5;
printf(“x = %d\n”,x);
void foo(int *x)
*x = 8;
now after reading some tutorial and documents, I use the following steps to get the result:
- llvm-gcc -O3 -emit-llvm a.c -c -o a.bc
2.llvm-gcc -O3 -emit-llvm b.c -c -o b.bc
- llvm-link -o final.bc a.bc b.bc
x = 8
I want to know what’s the standard process to compile programs at inter-procedural level? for example, how can I write the config file in SPEC CPU2000 if I want to
compile them at “-O3 -ipo”, is there any way as intel compiler did? or is there any document for this?
thanks very much.