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

bootrapped/regtested x86_64-linux, comitted.

Honza

	* tree-complex.c (expand_complex_div_wide): update profile.
Index: tree-complex.c
===================================================================
--- tree-complex.c	(revision 249881)
+++ tree-complex.c	(working copy)
@@ -1186,13 +1186,22 @@ expand_complex_div_wide (gimple_stmt_ite
       bb_join = e->dest;
       bb_true = create_empty_bb (bb_cond);
       bb_false = create_empty_bb (bb_true);
+      bb_true->frequency = bb_false->frequency = bb_cond->frequency / 2;
+      bb_true->count = bb_false->count
+	 = bb_cond->count.apply_probability (profile_probability::even ());
 
       /* Wire the blocks together.  */
       e->flags = EDGE_TRUE_VALUE;
+      e->count = bb_true->count;
+      /* TODO: With value profile we could add an historgram to determine real
+	 branch outcome.  */
+      e->probability = profile_probability::even ();
       redirect_edge_succ (e, bb_true);
-      make_edge (bb_cond, bb_false, EDGE_FALSE_VALUE);
-      make_edge (bb_true, bb_join, EDGE_FALLTHRU);
-      make_edge (bb_false, bb_join, EDGE_FALLTHRU);
+      edge e2 = make_edge (bb_cond, bb_false, EDGE_FALSE_VALUE);
+      e2->count = bb_false->count;
+      e2->probability = profile_probability::even ();
+      make_single_succ_edge (bb_true, bb_join, EDGE_FALLTHRU);
+      make_single_succ_edge (bb_false, bb_join, EDGE_FALLTHRU);
       add_bb_to_loop (bb_true, bb_cond->loop_father);
       add_bb_to_loop (bb_false, bb_cond->loop_father);
 

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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-02 22:12 Update profile in tree-complex.c 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).