From 25689b69f1c7cf9b07fd07ba0e6fcc1cc28a0a4a Mon Sep 17 00:00:00 2001 From: hubicka Date: Fri, 9 Jun 2017 11:38:35 +0000 Subject: [PATCH] * profile.c (edge_gcov_counts): Turn to pointer. (compute_branch_probabilities, compute_branch_probabilities): Update. * profile.h (edge_gcov_counts): Turn to pointer. (edge_gcov_count): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249056 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/profile.c | 6 ++++-- gcc/profile.h | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f62b6d59824..73bf358ec57 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2017-06-09 Jan Hubicka + * profile.c (edge_gcov_counts): Turn to pointer. + (compute_branch_probabilities, compute_branch_probabilities): Update. + * profile.h (edge_gcov_counts): Turn to pointer. + (edge_gcov_count): Update. + +2017-06-09 Jan Hubicka + * gimple.h (gimple_check_failed): Mark cold. 2017-06-09 Richard Biener diff --git a/gcc/profile.c b/gcc/profile.c index d0dc3b835b3..d6f2084a47d 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -69,7 +69,7 @@ along with GCC; see the file COPYING3. If not see /* Map from BBs/edges to gcov counters. */ vec bb_gcov_counts; -hash_map edge_gcov_counts; +hash_map *edge_gcov_counts; struct bb_profile_info { unsigned int count_valid : 1; @@ -532,6 +532,7 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum) return; bb_gcov_counts.safe_grow_cleared (last_basic_block_for_fn (cfun)); + edge_gcov_counts = new hash_map; if (profile_info->sum_all < profile_info->sum_max) { @@ -836,7 +837,8 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum) e->count = profile_count::from_gcov_type (edge_gcov_count (e)); } bb_gcov_counts.release (); - edge_gcov_counts.empty (); + delete edge_gcov_counts; + edge_gcov_counts = NULL; counts_to_freqs (); diff --git a/gcc/profile.h b/gcc/profile.h index 5ff806e5535..4e3f482fa5a 100644 --- a/gcc/profile.h +++ b/gcc/profile.h @@ -40,13 +40,13 @@ struct edge_profile_info /* Helpers annotating edges/basic blocks to GCOV counts. */ extern vec bb_gcov_counts; -extern hash_map edge_gcov_counts; +extern hash_map *edge_gcov_counts; inline gcov_type & edge_gcov_count (edge e) { bool existed; - gcov_type &c = edge_gcov_counts.get_or_insert (e, &existed); + gcov_type &c = edge_gcov_counts->get_or_insert (e, &existed); if (!existed) c = 0; return c; -- 2.11.4.GIT