public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Update profile in gimple_flow_call_edges_add
@ 2017-07-01 12:34 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2017-07-01 12:34 UTC (permalink / raw)
  To: gcc-patches

Hi,
another place we produce edges without profile are fake edges in flow_call_edges_add.
These are probably not that important, but it is better to have things consistent.

Bootstrapped/regtested x86_64-linux, comitted.

Honza

	* cfgrtl.c (rtl_flow_call_edges_add): Update profile.
	* tree-cfg.c (gimple_flow_call_edges_add): Likewise.
	* profile-count.h (max_safe_multiplier): Make unsigned.
	(profile_count::guessed_zero): New.
Index: cfgrtl.c
===================================================================
--- cfgrtl.c	(revision 249866)
+++ cfgrtl.c	(working copy)
@@ -4904,7 +4904,9 @@ rtl_flow_call_edges_add (sbitmap blocks)
 		    blocks_split++;
 		}
 
-	      make_edge (bb, EXIT_BLOCK_PTR_FOR_FN (cfun), EDGE_FAKE);
+	      edge ne = make_edge (bb, EXIT_BLOCK_PTR_FOR_FN (cfun), EDGE_FAKE);
+	      ne->probability = profile_probability::guessed_never ();
+	      ne->count = profile_count::guessed_zero ();
 	    }
 
 	  if (insn == BB_HEAD (bb))
Index: profile-count.h
===================================================================
--- profile-count.h	(revision 249866)
+++ profile-count.h	(working copy)
@@ -506,7 +506,7 @@ class GTY(()) profile_count
   /* Assume numbers smaller than this to multiply.  This is set to make
      testsuite pass, in future we may implement precise multiplication in higer
      rangers.  */
-  static const int64_t max_safe_multiplier = 131072;
+  static const uint64_t max_safe_multiplier = 131072;
 public:
 
   /* Used for counters which are expected to be never executed.  */
@@ -514,6 +514,13 @@ public:
     {
       return from_gcov_type (0);
     }
+  static profile_count guessed_zero ()
+    {
+      profile_count c;
+      c.m_val = 0;
+      c.m_quality = profile_guessed;
+      return c;
+    }
   static profile_count one ()
     {
       return from_gcov_type (1);
Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 249866)
+++ tree-cfg.c	(working copy)
@@ -8211,7 +8211,9 @@ gimple_flow_call_edges_add (sbitmap bloc
 		      if (e)
 			blocks_split++;
 		    }
-		  make_edge (bb, EXIT_BLOCK_PTR_FOR_FN (cfun), EDGE_FAKE);
+		  e = make_edge (bb, EXIT_BLOCK_PTR_FOR_FN (cfun), EDGE_FAKE);
+		  e->probability = profile_probability::guessed_never ();
+		  e->count = profile_count::guessed_zero ();
 		}
 	      gsi_prev (&gsi);
 	    }
@@ -8220,7 +8222,7 @@ gimple_flow_call_edges_add (sbitmap bloc
     }
 
   if (blocks_split)
-    verify_flow_info ();
+    checking_verify_flow_info ();
 
   return blocks_split;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-01 12:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-01 12:34 Update profile in gimple_flow_call_edges_add Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).