diff mbox series

Fix funcition level hot/cold partitionig

Message ID 20180124161847.GA9330@kam.mff.cuni.cz
State New
Headers show
Series Fix funcition level hot/cold partitionig | expand

Commit Message

Jan Hubicka Jan. 24, 2018, 4:18 p.m. UTC
Hi,
this patch fixes another issue found by Martin Liska's patch to trap in unlikely
section (last one which I need to bootstrap).

Here we confused local and global counts, which was misupdate at a time I
introudced them.  Bootstrapped/regtested x86_64-linux.

Honza

	* ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls
	with zero counts.
diff mbox series

Patch

Index: ipa-profile.c
===================================================================
--- ipa-profile.c	(revision 257011)
+++ ipa-profile.c	(working copy)
@@ -331,16 +331,14 @@  ipa_propagate_frequency_1 (struct cgraph
 	 it is executed by the train run.  Transfer the function only if all
 	 callers are unlikely executed.  */
       if (profile_info
-	  && edge->callee->count.initialized_p ()
-	  /* Thunks are not profiled.  This is more or less implementation
-	     bug.  */
-	  && !d->function_symbol->thunk.thunk_p
+	  && !(edge->callee->count.ipa () == profile_count::zero ())
 	  && (edge->caller->frequency != NODE_FREQUENCY_UNLIKELY_EXECUTED
 	      || (edge->caller->global.inlined_to
 		  && edge->caller->global.inlined_to->frequency
 		     != NODE_FREQUENCY_UNLIKELY_EXECUTED)))
 	  d->maybe_unlikely_executed = false;
-      if (edge->count.initialized_p () && !edge->count.nonzero_p ())
+      if (edge->count.ipa ().initialized_p ()
+	  && !edge->count.ipa ().nonzero_p ())
 	continue;
       switch (edge->caller->frequency)
         {