Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
deca6d60
Commit
deca6d60
authored
Jun 16, 2017
by
Jan Hubicka
Committed by
Jan Hubicka
Jun 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tree-ssa-tail-merge.c (replace_block_by): Fix profile updating.
From-SVN: r249274
parent
4086ef7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
12 deletions
+38
-12
gcc/ChangeLog
+4
-0
gcc/tree-ssa-tail-merge.c
+34
-12
No files found.
gcc/ChangeLog
View file @
deca6d60
2017
-
06
-
16
Jan
Hubicka
<
hubicka
@
ucw
.
cz
>
*
tree
-
ssa
-
tail
-
merge
.
c
(
replace_block_by
):
Fix
profile
updating
.
2017
-
06
-
16
James
Greenhalgh
<
james
.
greenhalgh
@
arm
.
com
>
PR
target
/
71778
...
...
gcc/tree-ssa-tail-merge.c
View file @
deca6d60
...
...
@@ -1555,29 +1555,51 @@ replace_block_by (basic_block bb1, basic_block bb2)
pred_edge
,
UNKNOWN_LOCATION
);
}
bb2
->
frequency
+=
bb1
->
frequency
;
if
(
bb2
->
frequency
>
BB_FREQ_MAX
)
bb2
->
frequency
=
BB_FREQ_MAX
;
bb2
->
count
+=
bb1
->
count
;
/* Merge the outgoing edge counts from bb1 onto bb2. */
profile_count
out_sum
=
profile_count
::
zero
();
int
out_freq_sum
=
0
;
/* Recompute the edge probabilities from the new merged edge count.
Use the sum of the new merged edge counts computed above instead
of bb2's merged count, in case there are profile count insanities
making the bb count inconsistent with the edge weights. */
FOR_EACH_EDGE
(
e1
,
ei
,
bb1
->
succs
)
{
if
(
e1
->
count
.
initialized_p
())
out_sum
+=
e1
->
count
;
out_freq_sum
+=
EDGE_FREQUENCY
(
e1
);
}
FOR_EACH_EDGE
(
e1
,
ei
,
bb2
->
succs
)
{
if
(
e1
->
count
.
initialized_p
())
out_sum
+=
e1
->
count
;
out_freq_sum
+=
EDGE_FREQUENCY
(
e1
);
}
FOR_EACH_EDGE
(
e1
,
ei
,
bb1
->
succs
)
{
e2
=
find_edge
(
bb2
,
e1
->
dest
);
gcc_assert
(
e2
);
e2
->
count
+=
e1
->
count
;
if
(
out_sum
>
0
&&
e2
->
count
.
initialized_p
())
{
e2
->
probability
=
e2
->
count
.
probability_in
(
bb2
->
count
);
}
else
if
(
bb1
->
frequency
&&
bb2
->
frequency
)
e2
->
probability
=
e1
->
probability
;
else
if
(
bb2
->
frequency
&&
!
bb1
->
frequency
)
;
else
if
(
out_freq_sum
)
e2
->
probability
=
GCOV_COMPUTE_SCALE
(
EDGE_FREQUENCY
(
e1
)
+
EDGE_FREQUENCY
(
e2
),
out_freq_sum
);
out_sum
+=
e2
->
count
;
}
/* Recompute the edge probabilities from the new merged edge count.
Use the sum of the new merged edge counts computed above instead
of bb2's merged count, in case there are profile count insanities
making the bb count inconsistent with the edge weights. */
FOR_EACH_EDGE
(
e2
,
ei
,
bb2
->
succs
)
{
e2
->
probability
=
e2
->
count
.
probability_in
(
out_sum
);
}
bb2
->
frequency
+=
bb1
->
frequency
;
if
(
bb2
->
frequency
>
BB_FREQ_MAX
)
bb2
->
frequency
=
BB_FREQ_MAX
;
/* Move over any user labels from bb1 after the bb2 labels. */
gimple_stmt_iterator
gsi1
=
gsi_start_bb
(
bb1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment