Commit ffb9d1b1 by Jan Hubicka Committed by Jan Hubicka

profile.c (edge_gcov_counts): Turn to pointer.

	* 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.

From-SVN: r249056
parent 323eb089
2017-06-09 Jan Hubicka <hubicka@ucw.cz> 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
* 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 <hubicka@ucw.cz>
* gimple.h (gimple_check_failed): Mark cold. * gimple.h (gimple_check_failed): Mark cold.
2017-06-09 Richard Biener <rguenther@suse.de> 2017-06-09 Richard Biener <rguenther@suse.de>
......
...@@ -69,7 +69,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -69,7 +69,7 @@ along with GCC; see the file COPYING3. If not see
/* Map from BBs/edges to gcov counters. */ /* Map from BBs/edges to gcov counters. */
vec<gcov_type> bb_gcov_counts; vec<gcov_type> bb_gcov_counts;
hash_map<edge,gcov_type> edge_gcov_counts; hash_map<edge,gcov_type> *edge_gcov_counts;
struct bb_profile_info { struct bb_profile_info {
unsigned int count_valid : 1; unsigned int count_valid : 1;
...@@ -532,6 +532,7 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum) ...@@ -532,6 +532,7 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum)
return; return;
bb_gcov_counts.safe_grow_cleared (last_basic_block_for_fn (cfun)); bb_gcov_counts.safe_grow_cleared (last_basic_block_for_fn (cfun));
edge_gcov_counts = new hash_map<edge,gcov_type>;
if (profile_info->sum_all < profile_info->sum_max) if (profile_info->sum_all < profile_info->sum_max)
{ {
...@@ -836,7 +837,8 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum) ...@@ -836,7 +837,8 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum)
e->count = profile_count::from_gcov_type (edge_gcov_count (e)); e->count = profile_count::from_gcov_type (edge_gcov_count (e));
} }
bb_gcov_counts.release (); bb_gcov_counts.release ();
edge_gcov_counts.empty (); delete edge_gcov_counts;
edge_gcov_counts = NULL;
counts_to_freqs (); counts_to_freqs ();
......
...@@ -40,13 +40,13 @@ struct edge_profile_info ...@@ -40,13 +40,13 @@ struct edge_profile_info
/* Helpers annotating edges/basic blocks to GCOV counts. */ /* Helpers annotating edges/basic blocks to GCOV counts. */
extern vec<gcov_type> bb_gcov_counts; extern vec<gcov_type> bb_gcov_counts;
extern hash_map<edge,gcov_type> edge_gcov_counts; extern hash_map<edge,gcov_type> *edge_gcov_counts;
inline gcov_type & inline gcov_type &
edge_gcov_count (edge e) edge_gcov_count (edge e)
{ {
bool existed; 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) if (!existed)
c = 0; c = 0;
return c; return c;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment