[LLVMdev] Profile-Guided Optimization status

Andreas Neustifter astifter-llvm at gmx.at
Wed Apr 7 04:21:17 PDT 2010


sorry to be so late with my answer, I was busy finishing my master thesis.

On 03/21/2010 11:06 PM, Gener Omer wrote:
> I have finally started my project which is supposed to implement some
> algorithms that uses profile information in order to optimize programs.
> I have a very basic question for you. I have a very simple source code,
> I compiled it with LLVM
> llvm-gcc -emit-llvm -c test.c -o test.bc,
> then I used the script named `profile.pl <http://profile.pl>`
> perl /home/gener/LLVM/llvm-2.6/utils/profile.pl <http://profile.pl> test.bc.
> After several runs, I have used the `opt` tool in this way:
> opt -profile-loader test.bc -f -o test1.bc
> in order to rearrange the bitcode file taking into account the profiling
> information. However, I saw that the bitcode file didn't changed, even
> if the profiling information shows that one basic block need to be
> moved. I know that BBs reordering is implemented in LLVM.

I guess that the profiling information is not surviving other passes.

You can enable the pass debuging with "--debug-pass=Details" and see 
what passes are called and when and how the analysis info generated by 
the profile-loader is destroyed again.

Also I guess you have to request the optimisation explicitly by using 
something like

$> opt -debug-pass=Details -debug -profile-loader -block-placement 
<infile> -o <outfile>

I have tried this and it seems to work in r96682 already.


More information about the llvm-dev mailing list