This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Conditional count update for fast coverage test in multi-threaded programs
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Rong Xu <xur at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Fri, 22 Nov 2013 13:03:10 +0100
- Subject: Re: [PATCH] Conditional count update for fast coverage test in multi-threaded programs
- Authentication-results: sourceware.org; auth=none
- References: <CAF1bQ=Sz3B0o-sU7v4OjsJCscDaEoPoKrDEqG2cSyYpc0oXaKw at mail dot gmail dot com>
On Fri, Nov 22, 2013 at 4:51 AM, Rong Xu <xur@google.com> wrote:
> Hi,
>
> This patch injects a condition into the instrumented code for edge
> counter update. The counter value will not be updated after reaching
> value 1.
>
> The feature is under a new parameter --param=coverage-exec_once.
> Default is disabled and setting to 1 to enable.
>
> This extra check usually slows the program down. For SPEC 2006
> benchmarks (all single thread programs), we usually see around 20%-35%
> slow down in -O2 coverage build. This feature, however, is expected to
> improve the coverage run speed for multi-threaded programs, because
> there virtually no data race and false sharing in updating counters.
> The improvement can be significant for highly threaded programs -- we
> are seeing 7x speedup in coverage test run for some non-trivial google
> applications.
>
> Tested with bootstrap.
Err - why not simply emit
counter = 1
for the counter update itself with that --param (I don't like a --param
for this either).
I assume that CPUs can avoid data-races and false sharing for
non-changing accesses?
Richard.
> Thanks,
>
> -Rong