* haifa-sched.c (sched_create_recovery_edges): Update profile.
authorJan Hubicka <hubicka@ucw.cz>
Tue, 4 Jul 2017 13:42:22 +0000 (15:42 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 4 Jul 2017 13:42:22 +0000 (13:42 +0000)
From-SVN: r249967

gcc/ChangeLog
gcc/haifa-sched.c

index 5a1659d01c0fa07e86036f706270c219dad8c137..89678c226fdc5d07558331df29f2117511f36d3b 100644 (file)
@@ -1,3 +1,7 @@
+2017-07-04  Jan Hubicka  <hubicka@ucw.cz>
+
+       * haifa-sched.c (sched_create_recovery_edges): Update profile.
+
 2017-07-04  Jan Hubicka  <hubicka@ucw.cz>
 
        * bb-reorder.c (better_edge_p): Fix handling of uninitialized
index 9632a6d75dbac8e82d131c252c2ffda3cdcb8f48..af0ed27b18ff250b4b3cf8a964c9d94aeed61d3a 100644 (file)
@@ -8302,7 +8302,19 @@ sched_create_recovery_edges (basic_block first_bb, basic_block rec,
   else
     edge_flags = 0;
 
-  make_edge (first_bb, rec, edge_flags);
+  edge e2 = single_succ_edge (first_bb);
+  edge e = make_edge (first_bb, rec, edge_flags);
+
+  /* TODO: The actual probability can be determined and is computed as
+     'todo_spec' variable in create_check_block_twin and
+     in sel-sched.c `check_ds' in create_speculation_check.  */
+  e->probability = profile_probability::very_unlikely ();
+  e->count = first_bb->count.apply_probability (e->probability);
+  rec->count = e->count;
+  rec->frequency = EDGE_FREQUENCY (e);
+  e2->probability = e->probability.invert ();
+  e2->count = first_bb->count - e2->count;
+
   rtx_code_label *label = block_label (second_bb);
   rtx_jump_insn *jump = emit_jump_insn_after (targetm.gen_jump (label),
                                              BB_END (rec));