diff mbox

Profile housekeeping 3/4 (call-cddce fix)

Message ID 20120928204330.GA13653@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka Sept. 28, 2012, 8:43 p.m. UTC
Hi,
shrink_wrap_one_built_in_call forgets to update counts.

	* tree-call-cdce.c (shrink_wrap_one_built_in_call):
	Update counts.
diff mbox

Patch

Index: tree-call-cdce.c
===================================================================
--- tree-call-cdce.c	(revision 191823)
+++ tree-call-cdce.c	(working copy)
@@ -773,8 +773,13 @@  shrink_wrap_one_built_in_call (gimple bi
                                           EDGE_FALSE_VALUE);
 
   bi_call_in_edge0->probability = REG_BR_PROB_BASE * ERR_PROB;
+  bi_call_in_edge0->count =
+      apply_probability (guard_bb0->count,
+			 bi_call_in_edge0->probability);
   join_tgt_in_edge_fall_thru->probability =
-      REG_BR_PROB_BASE - bi_call_in_edge0->probability;
+      inverse_probability (bi_call_in_edge0->probability);
+  join_tgt_in_edge_fall_thru->count =
+      guard_bb0->count - bi_call_in_edge0->count;
 
   /* Code generation for the rest of the conditions  */
   guard_bb = guard_bb0;
@@ -804,8 +809,12 @@  shrink_wrap_one_built_in_call (gimple bi
       bi_call_in_edge = make_edge (guard_bb, bi_call_bb, EDGE_TRUE_VALUE);
 
       bi_call_in_edge->probability = REG_BR_PROB_BASE * ERR_PROB;
+      bi_call_in_edge->count =
+	  apply_probability (guard_bb->count,
+			     bi_call_in_edge->probability);
       guard_bb_in_edge->probability =
-          REG_BR_PROB_BASE - bi_call_in_edge->probability;
+          inverse_probability (bi_call_in_edge->probability);
+      guard_bb_in_edge->count = guard_bb->count - bi_call_in_edge->count;
     }
 
   VEC_free (gimple, heap, conds);