Profiling questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Profiling questions

Pertti Kellomäki-2
I looked at the profiling support in LLVM, and it seems that all
the bits needed for profile guided transformations are there.

We are using LLVM as a cross compiler, and the target is simulation
only at the moment. Would it be possible to use the native llvm
installation for profiling? That is, compile the application and
run it on the host, collecting profile data. Then use the profile
to guide optimization during cross compilation.

Obviously there are corner cases where this will not work, such
as conditionals involving sizeof(int) etc., but it seems that
for many applications it should work. Is there anything I am
missing that would prevent such use?

As an aside, a minor point about the profiling runtime library
is that it installs as profile_rt.*, not libprofile_rt.* as one
would expect.
--
Pertti
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Profiling questions

Chris Lattner
On Jan 11, 2008, at 4:56 AM, Pertti Kellomäki wrote:

> I looked at the profiling support in LLVM, and it seems that all
> the bits needed for profile guided transformations are there.
>
> We are using LLVM as a cross compiler, and the target is simulation
> only at the moment. Would it be possible to use the native llvm
> installation for profiling? That is, compile the application and
> run it on the host, collecting profile data. Then use the profile
> to guide optimization during cross compilation.
>
> Obviously there are corner cases where this will not work, such
> as conditionals involving sizeof(int) etc., but it seems that
> for many applications it should work. Is there anything I am
> missing that would prevent such use?

This seems like it would work.  If you've dug in, you've seen that the  
profile is associated with (f.e.) basic block numbers.  The more the  
code is different between what you're profiling and optimizing the  
more the profile won't make sense.  It would be possible and useful to  
make the profile info less susceptible to breakage (e.g. by storing  
function name + bb instead of just BB ID or something) which could  
also help.

-Chris
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev