diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2017-06-05 19:41:32 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2017-06-05 17:41:32 +0000 |
commit | aea5e79a63f965a9ed5fd2ef1943e3865495e987 (patch) | |
tree | 52c60043f6ed486d65cb1a8a38cb71979166465c /gcc/tree-ssa-threadupdate.c | |
parent | 2f20e7db2caea4909ddff539b2419c9f34c907c4 (diff) | |
download | gcc-aea5e79a63f965a9ed5fd2ef1943e3865495e987.zip gcc-aea5e79a63f965a9ed5fd2ef1943e3865495e987.tar.gz gcc-aea5e79a63f965a9ed5fd2ef1943e3865495e987.tar.bz2 |
cfgexpand.c (expand_gimple_tailcall): Initialize profile of new edge.
* cfgexpand.c (expand_gimple_tailcall): Initialize profile of
new edge.
* ipa-inline.c (want_inline_self_recursive_call_p): Watch for missing
profile in callgraph edge.
* profile-count.h (apply_probability): If THIS is 0, then result is 0
(apply_scale): Likewise.
* tree-inline.c (copy_bb, copy_edges_for_bb, copy_cfg_body):
Also scale profile when inlining function with zero profile.
(initialize_cfun): Update exit block profile even when it is zero.
* tree-ssa-threadupdate.c (clear_counts_path): Handle correctly case
when profile is read.
From-SVN: r248885
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r-- | gcc/tree-ssa-threadupdate.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index a77c279..df4c6de 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -1084,16 +1084,20 @@ clear_counts_path (struct redirection_data *rd) vec<jump_thread_edge *> *path = THREAD_PATH (e); edge ein, esucc; edge_iterator ei; + profile_count val = profile_count::uninitialized (); + if (profile_status_for_fn (cfun) == PROFILE_READ) + val = profile_count::zero (); + FOR_EACH_EDGE (ein, ei, e->dest->preds) - ein->count = profile_count::uninitialized (); + ein->count = val; /* First clear counts along original path. */ for (unsigned int i = 1; i < path->length (); i++) { edge epath = (*path)[i]->e; FOR_EACH_EDGE (esucc, ei, epath->src->succs) - esucc->count = profile_count::uninitialized (); - epath->src->count = profile_count::uninitialized (); + esucc->count = val; + epath->src->count = val; } /* Also need to clear the counts along duplicated path. */ for (unsigned int i = 0; i < 2; i++) @@ -1102,8 +1106,8 @@ clear_counts_path (struct redirection_data *rd) if (!dup) continue; FOR_EACH_EDGE (esucc, ei, dup->succs) - esucc->count = profile_count::uninitialized (); - dup->count = profile_count::uninitialized (); + esucc->count = val; + dup->count = val; } } |