[LLVMdev] Basic Block Frequency counting in LLVM 2.9

Rajendra Patel rdpatel55 at yahoo.co.in
Sun Nov 18 04:14:07 PST 2012


Dear All,

I'm using LLVM2.9 for profiling basic block frequency. 
I'm using following commands.

rdpatel55 at ubuntu:~$ llvm-gcc -emit-llvm -O0 -c -o adpcm.bc adpcm.c
rdpatel55 at ubuntu:~$ llvm-gcc -emit-llvm -O0 -c -o rawcaudio.bc rawcaudio.c 
rdpatel55 at ubuntu:~$ llvm-link -o main.bc rawcaudio.bc adpcm.bc 
rdpatel55 at ubuntu:~$ opt -q -f -insert-edge-profiling -o main.inst main.bc 
rdpatel55 at ubuntu:~$ lli -fake-argv0 'main.bc' -load
/home/rdpatel55/RDPATEL/LLVM2.9/OBJ_ROOT/Debug+Profile/lib/profile_rt.so
main.inst < ./small.pcm > op_small.adpcm
rdpatel55 at ubuntu:~$ llvm-prof main.inst > profile.txt
rdpatel55 at ubuntu:~$ llvm-prof -annotated-llvm main.inst > bb.txt (This gives BB
frequency for all Blocks)

It works fine. But I found that for certain blocks the execution frequency
calculated is wrong.

Is there someone to help me to figure out, where something is wrong?

Thank you,

Rajendra Patel




More information about the llvm-dev mailing list