aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/reg-stack.c5
-rw-r--r--gcc/shrink-wrap.c18
-rw-r--r--gcc/tracer.c2
4 files changed, 16 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 35cf703..3aa83fe 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2017-11-13 Jan Hubicka <hubicka@ucw.cz>
+ * tracer.c (better_p): Do not compare frequencies.
+ * reg-stack.c (better_edge): Likewise.
+ * shrink-wrap.c (try_shrink_wrapping): Do not convert to gcov counts
+ and back.
+
+2017-11-13 Jan Hubicka <hubicka@ucw.cz>
+
* auto-profile.c (afdo_annotate_cfg): Use update_max_bb_count.
* cgraphunit.c (cgraph_node::expand_thunk): Use update_max_bb_count.
* ipa-utils.c (ipa_merge_profiles): Use update_max_bb_count.
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 83fc476..4f67a7b 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -2954,11 +2954,6 @@ better_edge (edge e1, edge e2)
if (!e1)
return e2;
- if (EDGE_FREQUENCY (e1) > EDGE_FREQUENCY (e2))
- return e1;
- if (EDGE_FREQUENCY (e1) < EDGE_FREQUENCY (e2))
- return e2;
-
if (e1->count () > e2->count ())
return e1;
if (e1->count () < e2->count ())
diff --git a/gcc/shrink-wrap.c b/gcc/shrink-wrap.c
index 0e4ff6c..ce2ddfc 100644
--- a/gcc/shrink-wrap.c
+++ b/gcc/shrink-wrap.c
@@ -880,19 +880,18 @@ try_shrink_wrapping (edge *entry_edge, rtx_insn *prologue_seq)
the correct answer for reducible flow graphs; for irreducible flow graphs
our profile is messed up beyond repair anyway. */
- gcov_type num = 0;
- gcov_type den = 0;
+ profile_count num = profile_count::zero ();
+ profile_count den = profile_count::zero ();
FOR_EACH_EDGE (e, ei, pro->preds)
if (!dominated_by_p (CDI_DOMINATORS, e->src, pro))
{
- num += EDGE_FREQUENCY (e);
- den += e->src->count.to_frequency (cfun);
+ if (e->count ().initialized_p ())
+ num += e->count ();
+ if (e->src->count.initialized_p ())
+ den += e->src->count;
}
- if (den == 0)
- den = 1;
-
/* All is okay, so do it. */
crtl->shrink_wrapped = true;
@@ -919,8 +918,9 @@ try_shrink_wrapping (edge *entry_edge, rtx_insn *prologue_seq)
if (dump_file)
fprintf (dump_file, "Duplicated %d to %d\n", bb->index, dup->index);
-
- bb->count = bb->count.apply_scale (num, den);
+
+ if (num == profile_count::zero () || den.nonzero_p ())
+ bb->count = bb->count.apply_scale (num, den);
dup->count -= bb->count;
}
diff --git a/gcc/tracer.c b/gcc/tracer.c
index 58caf13..0c7a953 100644
--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -135,8 +135,6 @@ better_p (const_edge e1, const_edge e2)
if (e1->count ().initialized_p () && e2->count ().initialized_p ()
&& ((e1->count () > e2->count ()) || (e1->count () < e2->count ())))
return e1->count () > e2->count ();
- if (EDGE_FREQUENCY (e1) != EDGE_FREQUENCY (e2))
- return EDGE_FREQUENCY (e1) > EDGE_FREQUENCY (e2);
/* This is needed to avoid changes in the decision after
CFG is modified. */
if (e1->src != e2->src)