[LLVMdev] Edge Profiling

Roel Jordans r.jordans at tue.nl
Thu Jan 31 02:18:58 PST 2013


See answers below

On 31/01/13 00:23, C├ęsar wrote:
> Hello.
> I'm using these commands to compile the code below in order to collect
> edge/blocks profiling:
> clang -emit-llvm -c sort.c -o sort.bc
> opt -insert-edge-profiling sort.bc -o sort_prof.bc
> clang sort_prof.bc -lprofile_rt -L/llvms/lib -o sort_prof
> then I run the program and display the profiling information using

You can also skip the compilation step and run directly through the 

lli -load /llvms/lib/libprofile_rt.so sort_prof.bc

> llvm-prof sort_prof.bc, and the result is:

try running llvm-prof on the original (non instrumented) code, that 
should give you the correct results

llvm-prof sort.bc


More information about the llvm-dev mailing list