]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/predict.cc
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / predict.cc
index 6777e6cb9c5216b0f6e454b065adaa4fd9045a50..5a1a561cc2461c6f82d3883337f7201ddcc46fc3 100644 (file)
@@ -790,7 +790,7 @@ dump_prediction (FILE *file, enum br_predictor predictor, int probability,
     {
       fprintf (file, "  exec ");
       bb->count.dump (file);
-      if (e)
+      if (e && e->count ().initialized_p () && bb->count.to_gcov_type ())
        {
          fprintf (file, " hit ");
          e->count ().dump (file);
@@ -4634,43 +4634,6 @@ force_edge_cold (edge e, bool impossible)
     }
 }
 
-/* Change E's probability to NEW_E_PROB, redistributing the probabilities
-   of other outgoing edges proportionally.
-
-   Note that this function does not change the profile counts of any
-   basic blocks.  The caller must do that instead, using whatever
-   information it has about the region that needs updating.  */
-
-void
-change_edge_frequency (edge e, profile_probability new_e_prob)
-{
-  profile_probability old_e_prob = e->probability;
-  profile_probability old_other_prob = old_e_prob.invert ();
-  profile_probability new_other_prob = new_e_prob.invert ();
-
-  e->probability = new_e_prob;
-  profile_probability cumulative_prob = new_e_prob;
-
-  unsigned int num_other = EDGE_COUNT (e->src->succs) - 1;
-  edge other_e;
-  edge_iterator ei;
-  FOR_EACH_EDGE (other_e, ei, e->src->succs)
-    if (other_e != e)
-      {
-       num_other -= 1;
-       if (num_other == 0)
-         /* Ensure that the probabilities add up to 1 without
-            rounding error.  */
-         other_e->probability = cumulative_prob.invert ();
-       else
-         {
-           other_e->probability /= old_other_prob;
-           other_e->probability *= new_other_prob;
-           cumulative_prob += other_e->probability;
-         }
-      }
-}
-
 #if CHECKING_P
 
 namespace selftest {