tree-switch-conversion.c (do_jump_if_equal, [...]): Update profile.
authorJan Hubicka <hubicka@ucw.cz>
Sat, 7 Oct 2017 16:33:26 +0000 (18:33 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 7 Oct 2017 16:33:26 +0000 (16:33 +0000)
* tree-switch-conversion.c (do_jump_if_equal, emit_cmp_and_jump_insns):
Update profile.

From-SVN: r253512

gcc/ChangeLog
gcc/tree-switch-conversion.c

index b56f7e637e08f13bba4e692f274aca2a48bdad3a..e8e18d813b1f3595a5de1fd8fff5de599cc93107 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-06  Jan Hubicka  <hubicka@ucw.cz>
+
+       * tree-switch-conversion.c (do_jump_if_equal, emit_cmp_and_jump_insns):
+       Update profile.
+
 2017-10-06  Martin Liska  <mliska@suse.cz>
 
        * sanopt.c (struct sanopt_tree_triplet_hash): Remove inline
index 6d7c2c4902fa75c6fcdcf6765953373d747b9d1b..19f0a73fbe2efd17a3fdce9d365f787f03787067 100644 (file)
@@ -2248,10 +2248,12 @@ do_jump_if_equal (basic_block bb, tree op0, tree op1, basic_block label_bb,
   edge false_edge = split_block (bb, cond);
   false_edge->flags = EDGE_FALSE_VALUE;
   false_edge->probability = prob.invert ();
+  false_edge->count = bb->count.apply_probability (false_edge->probability);
 
   edge true_edge = make_edge (bb, label_bb, EDGE_TRUE_VALUE);
   fix_phi_operands_for_edge (true_edge, phi_mapping);
   true_edge->probability = prob;
+  true_edge->count = bb->count.apply_probability (true_edge->probability);
 
   return false_edge->dest;
 }
@@ -2291,10 +2293,12 @@ emit_cmp_and_jump_insns (basic_block bb, tree op0, tree op1,
   edge false_edge = split_block (bb, cond);
   false_edge->flags = EDGE_FALSE_VALUE;
   false_edge->probability = prob.invert ();
+  false_edge->count = bb->count.apply_probability (false_edge->probability);
 
   edge true_edge = make_edge (bb, label_bb, EDGE_TRUE_VALUE);
   fix_phi_operands_for_edge (true_edge, phi_mapping);
   true_edge->probability = prob;
+  true_edge->count = bb->count.apply_probability (true_edge->probability);
 
   return false_edge->dest;
 }