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