public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: gcc-patches@gcc.gnu.org
Subject: Update profile in gimple_flow_call_edges_add
Date: Sat, 01 Jul 2017 12:34:00 -0000	[thread overview]
Message-ID: <20170701123440.GC29094@kam.mff.cuni.cz> (raw)

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;
 }

                 reply	other threads:[~2017-07-01 12:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170701123440.GC29094@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).