Commit e1a921dd by Jan Hubicka Committed by Jan Hubicka

* tree-cfg.c (gimple_find_sub_bbs): Fix profile updating.

From-SVN: r249908
parent b5db8b44
2017-07-02 Jan Hubicka <hubicka@ucw.cz>
* tree-cfg.c (gimple_find_sub_bbs): Fix profile updating.
2017-07-02 Jan Hubicka <hubicka@ucw.cz>
* tree-cfgcleanup.c (want_merge_blocks_p): New function.
(cleanup_tree_cfg_bb): Use it.
* profile-count.h (profile_count::of_for_merging, profile_count::merge):
......
......@@ -1051,6 +1051,7 @@ gimple_find_sub_bbs (gimple_seq seq, gimple_stmt_iterator *gsi)
struct omp_region *cur_region = NULL;
profile_count cnt = profile_count::zero ();
int freq = 0;
bool all = true;
int cur_omp_region_idx = 0;
int mer = make_edges_bb (bb, &cur_region, &cur_omp_region_idx);
......@@ -1061,12 +1062,16 @@ gimple_find_sub_bbs (gimple_seq seq, gimple_stmt_iterator *gsi)
edge_iterator ei;
FOR_EACH_EDGE (e, ei, bb->preds)
{
if (e->count.initialized_p ())
cnt += e->count;
else
all = false;
freq += EDGE_FREQUENCY (e);
}
tree_guess_outgoing_edge_probabilities (bb);
if (all || profile_status_for_fn (cfun) == PROFILE_READ)
bb->count = cnt;
bb->frequency = freq;
tree_guess_outgoing_edge_probabilities (bb);
FOR_EACH_EDGE (e, ei, bb->succs)
e->count = bb->count.apply_probability (e->probability);
......
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