Fix handling of histogram in ipa-profile

Message ID 20211211195450.GB50931@kam.mff.cuni.cz
State Committed
Commit 2f217f7218b621fd7d7fb7ac59b2ddf2e027ed4a
Headers
Series Fix handling of histogram in ipa-profile |

Commit Message

Jan Hubicka Dec. 11, 2021, 7:54 p.m. UTC
  Hi,
this patch removes apparently forgotten debugging hack (which got in during
the speculative call patchset) which reduces hot bb threshold.  This does not
make sense since it is set and reset randomly as the summaries are processed.
One problem is that we set the BB threshold to make certain BBs hot and hten 
unrolling or vectorization may reduce it to some fraction of the count that
makes it cold.  We may want to add some buffer and divide the value by,
say 32, but that shoulid be done independently of speculative calls.

gcc/ChangeLog:

2021-12-11  Jan Hubicka  <hubicka@ucw.cz>

	* ipa-profile.c (ipa_profile): Do not update hot bb threshold.
  

Patch

diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c
index ce32b538976..02f42d9b0f7 100644
--- a/gcc/ipa-profile.c
+++ b/gcc/ipa-profile.c
@@ -854,18 +854,6 @@  ipa_profile (void)
 	      node_map_initialized = true;
 	      ncommon++;
 
-	      if (in_lto_p)
-		{
-		  if (dump_file)
-		    {
-		      fprintf (dump_file,
-			       "Updating hotness threshold in LTO mode.\n");
-		      fprintf (dump_file, "Updated min count: %" PRId64 "\n",
-			       (int64_t) threshold / spec_count);
-		    }
-		  set_hot_bb_threshold (threshold / spec_count);
-		}
-
 	      unsigned speculative_id = 0;
 	      profile_count orig = e->count;
 	      for (unsigned i = 0; i < spec_count; i++)