[patch] Profiling infrastructure TLC (1/n)

Steven Bosscher stevenb.gcc@gmail.com
Sat Jul 21 22:41:00 GMT 2012


Hello,

This patch cleans up some "interesting" things in GCC's profiling
support. The most significant changes are the removal of
BB_TO_GCOV_INDEX and after_tree_profile. Another visible cleanup is
that -profile-generate no longer sets
flag_value_profile_transformations.

The rest is mostly just comment updates, because the comments (and the
code, see BB_TO_GCOV_INDEX ;-) have not been maintained very well for
everything that has changed since, oh, tree-ssa was merged?

For example, in value-prof.c:"the flow graph is annotated with actual
execution counts, which are later propagated into the rtl for
optimization purposes."

Or before profile.c:branch_prob():
-/* Instrument and/or analyze program behavior based on program flow graph.
-   In either case, this function builds a flow graph for the function being
-   compiled.  The flow graph is stored in BB_GRAPH.
...
- (...) In this case, the flow graph is
-   annotated with actual execution counts, which are later propagated into the
-   rtl for optimization purposes.

But (a) branch_prob doesn't build a CFG; (b) the flow graph it doesn't
build is not stored in BB_GRAPH; and (c) the execution counts are not
"propagated into the rtl".

The whole profiling infrastructure needs a lot of TLC before it looks
somewhat decent again. This is just the first step :-)

Bootstrapped and tested on powerpc64-unknown-linux-gnu.
Profilebootstrapped and tested on x86_64-unknown-linux-gnu.
OK for trunk?

Ciao!
Steven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prof_cleanup.diff
Type: application/octet-stream
Size: 24481 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120721/a235c2d7/attachment.obj>


More information about the Gcc-patches mailing list