* Update profile in gimple-ssa-isolate-paths.c
@ 2017-06-16 17:45 Jan Hubicka
0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2017-06-16 17:45 UTC (permalink / raw)
To: gcc-patches
Hi,
while separating an impossible path, we shoud make sure it is seen as cold
by profile.
Bootstrapped/regtested x86_64-linux, will commit it later today.
Honza
* gimple-ssa-isolate-paths.c (isolate_path): Set edge leading to path
as unlikely; update profile.
Index: gimple-ssa-isolate-paths.c
===================================================================
--- gimple-ssa-isolate-paths.c (revision 249244)
+++ gimple-ssa-isolate-paths.c (working copy)
@@ -137,6 +137,15 @@ isolate_path (basic_block bb, basic_bloc
gimple_stmt_iterator si, si2;
edge_iterator ei;
edge e2;
+ bool impossible = true;
+
+ for (si = gsi_start_bb (bb); gsi_stmt (si) != stmt; gsi_next (&si))
+ if (stmt_can_terminate_bb_p (gsi_stmt (si)))
+ {
+ impossible = false;
+ break;
+ }
+ force_edge_cold (e, impossible);
/* First duplicate BB if we have not done so already and remove all
the duplicate's outgoing edges as duplicate is going to unconditionally
@@ -145,10 +154,14 @@ isolate_path (basic_block bb, basic_bloc
if (!duplicate)
{
duplicate = duplicate_block (bb, NULL, NULL);
+ bb->frequency = 0;
+ bb->count = profile_count::zero ();
if (!ret_zero)
for (ei = ei_start (duplicate->succs); (e2 = ei_safe_edge (ei)); )
remove_edge (e2);
}
+ bb->frequency += EDGE_FREQUENCY (e);
+ bb->count += e->count;
/* Complete the isolation step by redirecting E to reach DUPLICATE. */
e2 = redirect_edge_and_branch (e, duplicate);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-16 17:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 17:45 Update profile in gimple-ssa-isolate-paths.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).