profile.c (compute_branch_probabilities): Do not report hitrates here.
authorJan Hubicka <hubicka@ucw.cz>
Sat, 28 May 2016 16:20:06 +0000 (18:20 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 28 May 2016 16:20:06 +0000 (16:20 +0000)
* profile.c (compute_branch_probabilities): Do not report hitrates
here.
(branch_prob): Report hitrates here.
* predict.c (gimple_predict_edge): Do not assert profile status;
fix formatting issues.

From-SVN: r236849

gcc/ChangeLog
gcc/predict.c
gcc/profile.c

index 3a75b8034e2cdf5f9e753ad9bf4009502c503131..385674508dff07f60ebcdae6ed9a22b3cd39c586 100644 (file)
@@ -1,3 +1,11 @@
+2016-05-27  Jan Hubicka  <hubicka@ucw.cz>
+
+       * profile.c (compute_branch_probabilities): Do not report hitrates
+       here.
+       (branch_prob): Report hitrates here.
+       * predict.c (gimple_predict_edge): Do not assert profile status;
+       fix formatting issues.
+
 2016-05-27  Jan Hubicka  <hubicka@ucw.cz>
 
        * predict.c (edge_predicted_by_p): New function.
index 22ec8a053a015669752a5e7b98fb7ee826010564..3743b0107a603656cd425af0a4f6ef3dbc77b198 100644 (file)
@@ -593,10 +593,10 @@ rtl_predict_edge (edge e, enum br_predictor predictor, int probability)
 void
 gimple_predict_edge (edge e, enum br_predictor predictor, int probability)
 {
-  gcc_assert (profile_status_for_fn (cfun) != PROFILE_GUESSED);
-  if ((e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun) && EDGE_COUNT (e->src->succs) >
-       1)
-      && flag_guess_branch_prob && optimize)
+  if (e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun)
+      && EDGE_COUNT (e->src->succs) > 1
+      && flag_guess_branch_prob
+      && optimize)
     {
       struct edge_prediction *i = XNEW (struct edge_prediction);
       edge_prediction *&preds = bb_predictions->get_or_insert (e->src);
index 39c81d4fbafeb8bd9e6cc1144a1a992bb5fd3ce4..007379baa13ce046a6e2e42d060ff5e06c198f40 100644 (file)
@@ -845,8 +845,6 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum)
       fputc ('\n', dump_file);
       fputc ('\n', dump_file);
     }
-  if (dump_file && (dump_flags & TDF_DETAILS))
-    report_predictor_hitrates ();
 
   free_aux_for_blocks ();
 }
@@ -1331,6 +1329,8 @@ branch_prob (void)
   values.release ();
   free_edge_list (el);
   coverage_end_function (lineno_checksum, cfg_checksum);
+  if (dump_file && (dump_flags & TDF_DETAILS))
+    report_predictor_hitrates ();
 }
 \f
 /* Union find algorithm implementation for the basic blocks using