[PATCH] profile feedback: -fprofile-use= and -fprofile-correction, correctness fixes and option semantic changes.

Seongbae Park (박성배, 朴成培) seongbae.park@gmail.com
Fri Mar 28 02:11:00 GMT 2008


On Thu, Mar 27, 2008 at 1:52 AM, Jan Hubicka <jh@suse.cz> wrote:
> Hi,
>  note that if we make -fprofile-use= shortcut, we probably could have
>  also -fprofile-gen=
>
> > (or maybe even submitted, don't remember now).
>  > But using atomic increment on highly multithreaded programs on high
>  > core count systems
>  > incur significant performance overhead.
>  > So I'd rather like to see TLS counters than atomic increments.
>  > Regardless, this option (-fprofile-correction) is completely
>  > orthogonal to either atomic increment or TLS.
>
>  Zdenek also had equivalent of TLS counters (before TLS architecture was
>  added to GCC).  The problem here that the counters can get pretty big,
>  so for instance for Mozilla, you can end up producing quite few
>  megabytes of extra data.
>
>  Lets see where the patches are and try to get some to mainline.
>  Profiling threaded applications is definitly important thing.

I think -fprofile-correction is orthogonal to atomic counter updates or TLS,
since it provides alternative way to other two methods.

Attached is the update patch for the first patch
- it now adds new options -fprofile-dir=, -fprofile-use=, -fprofile-generate=.
Changelog is below.
Profiled bootstrap and regtest in progress.

Seongbae

ChangeLog:
2008-03-27  Seongbae Park <seongbae.park@gmail.com>

        * Makefile.tpl (.NOTPARALLEL): Serialize stageprofile libiberty.
        * Makefile.in (.NOTPARALLEL): Serialize stageprofile libiberty
(updated through autogen).

gcc/ChangeLog:
2008-03-27  Seongbae Park <seongbae.park@gmail.com>

        * common.opt (fprofile-dir=, fprofile-use=, fprofile-generate=):
        New options
        (fprofile-use): Add var flag_profile_use
        * coverage.c (coverage_begin_output): Do not open a gcno file for output
        only if -ftest-coverage is set.
        Do not add getpwd() to gcda file path.
        (build_gcov_info): Check the new flag
        flag_profile_datafile_relative_path.
        (coverage_init): Use profile_data_prefix.
        Read profile counter only if flag_profile_use is set.
        * opts.c (common_handle_option): New option fprofile-use=,
        fprofile-dir=, fprofile-generate=.
        * toplev.c (profile_data_prefix): New variable definition.
        * toplev.h (profile_data_prefix): New declaration.
        * doc/invoke.tex (Option Summary, Optimization Options):
        Add new options.

gcc/testsuite/ChanceLog:
2008-03-27  Seongbae Park <seongbae.park@gmail.com>

        * g++.db/bprob/bprob.exp: Do not check gcno files.
        Use -fprofile-use for profile use.
        * gcc.misc-tests/bprob.exp: Ditto.
        * g++.dg/tree-pro/tree-prof.exp: Do not check gcno files.
        * gcc.dg/matrix/matrix.exp: Ditto.
        * gcc.dg/struct/struct-reorg.exp: Ditto.
        * gcc.dg/tree-prof/tree-prof.exp: Ditto.
        * gcc.dg/profile-dir-1.c: New test.
        * gcc.dg/profile-dir-2.c: New test.
        * gcc.dg/profile-dir-3.c: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: profile-use-20080327.patch
Type: text/x-patch
Size: 13779 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080328/f3b8267d/attachment.bin>


More information about the Gcc-patches mailing list