]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* tree-complex.c (expand_complex_div_wide): update profile.
authorJan Hubicka <hubicka@ucw.cz>
Sun, 2 Jul 2017 22:11:14 +0000 (00:11 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 2 Jul 2017 22:11:14 +0000 (22:11 +0000)
From-SVN: r249884

gcc/ChangeLog
gcc/tree-complex.c

index f90ed507a47623c6c065be31d3e33f691bc3af79..953b38413c25186f5314f1eb00e73c4a2dfc3388 100644 (file)
@@ -1,3 +1,7 @@
+2017-07-02  Jan Hubicka  <hubicka@ucw.cz>
+
+       * tree-complex.c (expand_complex_div_wide): update profile.
+
 2017-07-02  Richard Sandiford  <richard.sandiford@linaro.org>
            Alan Hayward  <alan.hayward@arm.com>
            David Sherwood  <david.sherwood@arm.com>
index e0dd3d9922b024b71a7500b2912d4a256431e25a..d61047bbf5f809f8d4cb4f41df846aa2cf77cc82 100644 (file)
@@ -1186,13 +1186,22 @@ expand_complex_div_wide (gimple_stmt_iterator *gsi, tree inner_type,
       bb_join = e->dest;
       bb_true = create_empty_bb (bb_cond);
       bb_false = create_empty_bb (bb_true);
+      bb_true->frequency = bb_false->frequency = bb_cond->frequency / 2;
+      bb_true->count = bb_false->count
+        = bb_cond->count.apply_probability (profile_probability::even ());
 
       /* Wire the blocks together.  */
       e->flags = EDGE_TRUE_VALUE;
+      e->count = bb_true->count;
+      /* TODO: With value profile we could add an historgram to determine real
+        branch outcome.  */
+      e->probability = profile_probability::even ();
       redirect_edge_succ (e, bb_true);
-      make_edge (bb_cond, bb_false, EDGE_FALSE_VALUE);
-      make_edge (bb_true, bb_join, EDGE_FALLTHRU);
-      make_edge (bb_false, bb_join, EDGE_FALLTHRU);
+      edge e2 = make_edge (bb_cond, bb_false, EDGE_FALSE_VALUE);
+      e2->count = bb_false->count;
+      e2->probability = profile_probability::even ();
+      make_single_succ_edge (bb_true, bb_join, EDGE_FALLTHRU);
+      make_single_succ_edge (bb_false, bb_join, EDGE_FALLTHRU);
       add_bb_to_loop (bb_true, bb_cond->loop_father);
       add_bb_to_loop (bb_false, bb_cond->loop_father);