]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cfgloopmanip.cc
Fix profiledbootstrap
[thirdparty/gcc.git] / gcc / cfgloopmanip.cc
index fe452ecf60f09c1e7b9e0f5293e65333bb911859..b237ad4e8ac2db5a6baa93ec90a97864c57d1d2e 100644 (file)
@@ -525,33 +525,6 @@ scale_dominated_blocks_in_loop (class loop *loop, basic_block bb,
       }
 }
 
-/* Compute how many times loop is entered.  */
-
-profile_count
-loop_count_in (class loop *loop)
-{
-  /* Compute number of invocations of the loop.  */
-  profile_count count_in = profile_count::zero ();
-  edge e;
-  edge_iterator ei;
-  bool found_latch = false;
-
-  if (loops_state_satisfies_p (LOOPS_MAY_HAVE_MULTIPLE_LATCHES))
-    FOR_EACH_EDGE (e, ei, loop->header->preds)
-      if (!flow_bb_inside_loop_p (loop, e->src))
-       count_in += e->count ();
-      else
-       found_latch = true;
-  else
-    FOR_EACH_EDGE (e, ei, loop->header->preds)
-      if (e->src != loop->latch)
-       count_in += e->count ();
-      else
-       found_latch = true;
-  gcc_checking_assert (found_latch);
-  return count_in;
-}
-
 /* Return exit that suitable for update when loop iterations
    changed.  */
 
@@ -739,14 +712,14 @@ scale_loop_profile (class loop *loop, profile_probability p,
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
       fprintf (dump_file,
-              ";; guessed iterations of loop %i:%f new upper bound %i:\n",
+              ";; Guessed iterations of loop %i is %f. New upper bound %i.\n",
               loop->num,
               iterations.to_double (),
               (int)iteration_bound);
     }
 
   /* See if loop is predicted to iterate too many times.  */
-  if (iterations <= iteration_bound)
+  if (iterations <= (sreal)iteration_bound)
     return;
 
   profile_count count_in = loop_count_in (loop);
@@ -769,7 +742,7 @@ scale_loop_profile (class loop *loop, profile_probability p,
   /* In a consistent profile unadjusted_exit_count should be same as count_in,
      however to preserve as much of the original info, avoid recomputing
      it.  */
-  profile_count unadjusted_exit_count;
+  profile_count unadjusted_exit_count = profile_count::uninitialized ();
   if (exit_edge)
     unadjusted_exit_count = exit_edge->count ();
   scale_loop_frequencies (loop, scale_prob);