diff options
author | Martin Liska <mliska@suse.cz> | 2016-11-03 16:24:22 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2016-11-03 15:24:22 +0000 |
commit | 7d29f8e3dc105bcc948377a3c68250f555119d8c (patch) | |
tree | c52598610873862306ffb6e9daafae7f170aa0f9 /libgcc | |
parent | 5de3e2d862e02f7b0c8efe8fbec2c15592302ba9 (diff) | |
download | gcc-7d29f8e3dc105bcc948377a3c68250f555119d8c.tar.gz |
Make direct emission of time profiler counter
* libgcov-profiler.c (__gcov_time_profiler): Remove.
(__gcov_time_profiler_atomic): Likewise.
* profile.c (instrument_values): Fix coding style.
(branch_prob): Use renamed function.
* tree-profile.c (init_ic_make_global_vars): Likewise.
(gimple_init_edge_profiler): Rename to
gimple_init_gcov_profiler.
tree_time_profiler_counter variable declaration.
(gimple_gen_time_profiler): Rewrite to do a direct gimple code
emission.
* value-prof.h: Remove an argument.
* gcc.dg/no_profile_instrument_function-attr-1.c: Update scanned
output.
* gcc.dg/tree-prof/time-profiler-3.c: New test.
From-SVN: r241821
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 5 | ||||
-rw-r--r-- | libgcc/libgcov-profiler.c | 23 |
2 files changed, 6 insertions, 22 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e81444c841c..e3a81f6b026 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2016-11-03 Martin Liska <mliska@suse.cz> + + * libgcov-profiler.c (__gcov_time_profiler): Remove. + (__gcov_time_profiler_atomic): Likewise. + 2016-11-03 Bernd Edlinger <bernd.edlinger@hotmail.de> PR libgcc/78067 diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 38ed5f113e7..4f0a40675a2 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -342,30 +342,9 @@ __gcov_indirect_call_profiler_v2 (gcov_type value, void* cur_func) #ifdef L_gcov_time_profiler /* Counter for first visit of each function. */ -static gcov_type function_counter; +gcov_type __gcov_time_profiler_counter ATTRIBUTE_HIDDEN; -/* Sets corresponding COUNTERS if there is no value. */ - -void -__gcov_time_profiler (gcov_type* counters) -{ - if (!counters[0]) - counters[0] = ++function_counter; -} - -#if GCOV_SUPPORTS_ATOMIC -/* Sets corresponding COUNTERS if there is no value. - Function is thread-safe. */ - -void -__gcov_time_profiler_atomic (gcov_type* counters) -{ - if (!counters[0]) - counters[0] = __atomic_add_fetch (&function_counter, 1, __ATOMIC_RELAXED); -} #endif -#endif - #ifdef L_gcov_average_profiler /* Increase corresponding COUNTER by VALUE. FIXME: Perhaps we want |