]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
revert: cgraphbuild.c (compute_call_stmt_bb_frequency): Use counts when these are...
authorJan Hubicka <hubicka@ucw.cz>
Mon, 12 Oct 2015 18:54:01 +0000 (20:54 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 12 Oct 2015 18:54:01 +0000 (18:54 +0000)
revert:
2015-10-11  Jan Hubicka  <hubicka@ucw.cz>
* cgraphbuild.c (compute_call_stmt_bb_frequency): Use
counts when these are more informative.

From-SVN: r228736

gcc/ChangeLog
gcc/cgraphbuild.c

index 32ec554fb9120f7b1df458e9723b3cb214c5b1f3..61e46ff8c5612913b5bcbfa38fc35f87d0766cf5 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-11  Jan Hubicka  <hubicka@ucw.cz>
+
+       revert:
+       2015-10-11  Jan Hubicka  <hubicka@ucw.cz>
+       * cgraphbuild.c (compute_call_stmt_bb_frequency): Use
+       counts when these are more informative.
+
 2015-10-12  Jeff Law  <law@redhat.com>
 
        * tree-ssa-threadbackward.c (fsm_find_thread_path): Remove
index a7b4af6d9fb3aa44347f8ea5ae1a7be83bd6d013..33b01be83acfdd456514aaaf9cbb66ed1664ca86 100644 (file)
@@ -202,21 +202,15 @@ compute_call_stmt_bb_frequency (tree decl, basic_block bb)
 {
   int entry_freq = ENTRY_BLOCK_PTR_FOR_FN
                     (DECL_STRUCT_FUNCTION (decl))->frequency;
-  gcov_type entry_count = ENTRY_BLOCK_PTR_FOR_FN
-                           (DECL_STRUCT_FUNCTION (decl))->count;
-  gcov_type freq = bb->frequency;
+  int freq = bb->frequency;
 
   if (profile_status_for_fn (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT)
     return CGRAPH_FREQ_BASE;
 
-  if (entry_count > entry_freq)
-    freq = RDIV (bb->count * CGRAPH_FREQ_BASE, entry_count);
-  else
-    {
-      if (!entry_freq)
-        entry_freq = 1, freq++;
-      freq = RDIV (freq * CGRAPH_FREQ_BASE, entry_freq);
-    }
+  if (!entry_freq)
+    entry_freq = 1, freq++;
+
+  freq = freq * CGRAPH_FREQ_BASE / entry_freq;
   if (freq > CGRAPH_FREQ_MAX)
     freq = CGRAPH_FREQ_MAX;