summaryrefslogtreecommitdiff
path: root/gcc/cfghooks.c
diff options
context:
space:
mode:
authordehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-16 20:40:29 +0000
committerdehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-16 20:40:29 +0000
commitfe0ef478fca2735cf6255623363df1407aa29b54 (patch)
tree59a5a32e9cc23f9622626883d23a53b71387ac68 /gcc/cfghooks.c
parent7b89cd4f3f63aba6e1bf12dbe1e7774a36eba883 (diff)
downloadgcc-fe0ef478fca2735cf6255623363df1407aa29b54.tar.gz
2014-05-16 Dehao Chen <dehao@google.com>
* cfghooks.c (make_forwarder_block): Use direct computation to get fall-through edge's count and frequency. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210528 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r--gcc/cfghooks.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index bc1634aac87..66313df85ac 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -833,6 +833,9 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
fallthru = split_block_after_labels (bb);
dummy = fallthru->src;
+ dummy->count = 0;
+ dummy->frequency = 0;
+ fallthru->count = 0;
bb = fallthru->dest;
/* Redirect back edges we want to keep. */
@@ -842,20 +845,13 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
if (redirect_edge_p (e))
{
+ dummy->frequency += EDGE_FREQUENCY (e);
+ dummy->count += e->count;
+ fallthru->count += e->count;
ei_next (&ei);
continue;
}
- dummy->frequency -= EDGE_FREQUENCY (e);
- dummy->count -= e->count;
- if (dummy->frequency < 0)
- dummy->frequency = 0;
- if (dummy->count < 0)
- dummy->count = 0;
- fallthru->count -= e->count;
- if (fallthru->count < 0)
- fallthru->count = 0;
-
e_src = e->src;
jump = redirect_edge_and_branch_force (e, bb);
if (jump != NULL)