shrink-wrap.c (handle_simple_exit): Update profile.
authorJan Hubicka <hubicka@ucw.cz>
Tue, 6 Jun 2017 08:08:58 +0000 (10:08 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 6 Jun 2017 08:08:58 +0000 (08:08 +0000)
* shrink-wrap.c (handle_simple_exit): Update profile.
(try_shrink_wrapping): Upate profile.

From-SVN: r248913

gcc/ChangeLog
gcc/shrink-wrap.c

index 7d6eb885a67cb4a437a2957914f730927b4e5991..baee1e65eb47220992967b42f16fb7dbcfdbb114 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-06  Jan Hubicka  <hubicka@ucw.cz>
+
+       * shrink-wrap.c (handle_simple_exit): Update profile.
+       (try_shrink_wrapping): Upate profile.
+
 2017-06-06  Jan Hubicka  <hubicka@ucw.cz>
 
        * predict.c (tree_estimate_probability_bb): Add LOCAL_ONLY.
index eaa1522bb0db28ce90905f9434e28175b09b74cf..3cad7760f9c4eee1cd369a735294f6b00cdfac5a 100644 (file)
@@ -561,9 +561,11 @@ handle_simple_exit (edge e)
       BB_END (old_bb) = end;
 
       redirect_edge_succ (e, new_bb);
+      new_bb->count = e->count;
+      new_bb->frequency = EDGE_FREQUENCY (e);
       e->flags |= EDGE_FALLTHRU;
 
-      e = make_edge (new_bb, EXIT_BLOCK_PTR_FOR_FN (cfun), 0);
+      e = make_single_succ_edge (new_bb, EXIT_BLOCK_PTR_FOR_FN (cfun), 0);
     }
 
   e->flags &= ~EDGE_FALLTHRU;
@@ -981,6 +983,7 @@ try_shrink_wrapping (edge *entry_edge, rtx_insn *prologue_seq)
 
   basic_block new_bb = create_empty_bb (EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb);
   BB_COPY_PARTITION (new_bb, pro);
+  new_bb->count = profile_count::zero ();
   if (dump_file)
     fprintf (dump_file, "Made prologue block %d\n", new_bb->index);