diff mbox series

Remove scale_bbs_frequencies_int, scale_bbs_frequencies_int

Message ID 20171116163440.GD76038@kam.mff.cuni.cz
State New
Headers show
Series Remove scale_bbs_frequencies_int, scale_bbs_frequencies_int | expand

Commit Message

Jan Hubicka Nov. 16, 2017, 4:34 p.m. UTC
Hi,
since all uses of those functions are now updated to profile counts and probabilities,
we can rmeove these.

Bootstrapped/retested x86_64-linux, comitted.

Honza

	* cfg.c (scale_bbs_frequencies_int,
	cale_bbs_frequencies_gcov_type): Remove.
	* cfg.h (scale_bbs_frequencies_int,
	cale_bbs_frequencies_gcov_type): Remove.
diff mbox series

Patch

Index: cfg.c
===================================================================
--- cfg.c	(revision 254767)
+++ cfg.c	(working copy)
@@ -917,48 +917,6 @@  update_bb_profile_for_threading (basic_b
 }
 
 /* Multiply all frequencies of basic blocks in array BBS of length NBBS
-   by NUM/DEN, in int arithmetic.  May lose some accuracy.  */
-void
-scale_bbs_frequencies_int (basic_block *bbs, int nbbs, int num, int den)
-{
-  int i;
-  if (num < 0)
-    num = 0;
-
-  /* Scale NUM and DEN to avoid overflows.  Frequencies are in order of
-     10^4, if we make DEN <= 10^3, we can afford to upscale by 100
-     and still safely fit in int during calculations.  */
-  if (den > 1000)
-    {
-      if (num > 1000000)
-	return;
-
-      num = RDIV (1000 * num, den);
-      den = 1000;
-    }
-  if (num > 100 * den)
-    return;
-
-  for (i = 0; i < nbbs; i++)
-    {
-      bbs[i]->count = bbs[i]->count.apply_scale (num, den);
-    }
-}
-
-/* Multiply all frequencies of basic blocks in array BBS of length NBBS
-   by NUM/DEN, in gcov_type arithmetic.  More accurate than previous
-   function but considerably slower.  */
-void
-scale_bbs_frequencies_gcov_type (basic_block *bbs, int nbbs, gcov_type num,
-				 gcov_type den)
-{
-  int i;
-
-  for (i = 0; i < nbbs; i++)
-    bbs[i]->count = bbs[i]->count.apply_scale (num, den);
-}
-
-/* Multiply all frequencies of basic blocks in array BBS of length NBBS
    by NUM/DEN, in profile_count arithmetic.  More accurate than previous
    function but considerably slower.  */
 void
Index: cfg.h
===================================================================
--- cfg.h	(revision 254767)
+++ cfg.h	(working copy)
@@ -107,9 +107,6 @@  extern basic_block debug_bb_n (int);
 extern void dump_bb_info (FILE *, basic_block, int, dump_flags_t, bool, bool);
 extern void brief_dump_cfg (FILE *, dump_flags_t);
 extern void update_bb_profile_for_threading (basic_block, profile_count, edge);
-extern void scale_bbs_frequencies_int (basic_block *, int, int, int);
-extern void scale_bbs_frequencies_gcov_type (basic_block *, int, gcov_type,
-					     gcov_type);
 extern void scale_bbs_frequencies_profile_count (basic_block *, int,
 					     profile_count, profile_count);
 extern void scale_bbs_frequencies (basic_block *, int, profile_probability);