This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Clean up tree level value profiling


> Hello,
> 
> this patch rewrites the tree level instrumentation for value profiling.
> The changes in the patch:
> 
> -- The code that gathers the information is moved to separate functions
>    in libgcov.c, instead of emitting it directly to the instrumented
>    functions.  This makes instrumentation much simpler and easier to
>    extend.  Also this should decrease the size of the instrumented
>    binaries, since the (long) instrumentation code is now duplicated at
>    each instrumentation site, while with the patch we put just the function
>    call there.
> 
>    Of course, there will be some slowdowns for the extra calls, but
>    the decreased complexity of the code may cut the overhead
>    significantly, and the minor slowdown of instrumented binary is not
>    that important anyway.  I cannot back up this reasoning by any
>    numbers -- at the moment we only instrument divisions, which are
>    fairly rare and slow by themselves, so in practice the changed
>    way of instrumentation does not make any difference.
> -- The optimization specific pieces of code somehow leaked to the
>    generic instrumentation functions.  The patch moves them back
>    to the optimizations, where they belong.
> -- pow2 profiler is simplified; till now, it also recorded the precise
>    power of two, but this information was not used anywhere.  Now we
>    only record whether the measured value is a power of two or not.
> 
> Profiledbootstrapped (with -fprofile-values -ftree-based-profiling)
> & regtested on i686.

This patch is OK (I guess the force_gimple_operands are pretty trivial).
Would you mind to followup the patch by replacing hand construction of
function decl by build_fn_decl on other places we do the same?

Thanks!
Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]