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
6efcd268
Commit
6efcd268
authored
Feb 12, 2003
by
Jan Hubicka
Committed by
Jan Hubicka
Feb 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* predict.c (estimate_probability): Fix roundoff error.
From-SVN: r62765
parent
9083b5da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
gcc/ChangeLog
+4
-0
gcc/predict.c
+8
-3
No files found.
gcc/ChangeLog
View file @
6efcd268
Wed
Feb
12
15
:
19
:
42
CET
2003
Jan
Hubicka
<
jh
@suse
.
cz
>
*
predict
.
c
(
estimate_probability
)
:
Fix
roundoff
error
.
2003
-
02
-
12
Kazu
Hirata
<
kazu
@cs
.
umass
.
edu
>
2003
-
02
-
12
Kazu
Hirata
<
kazu
@cs
.
umass
.
edu
>
*
config
/
h8300
/
h8300
.
md
(
a
peephole2
)
:
Don
'
t
handle
65535
.
*
config
/
h8300
/
h8300
.
md
(
a
peephole2
)
:
Don
'
t
handle
65535
.
...
...
gcc/predict.c
View file @
6efcd268
...
@@ -449,14 +449,19 @@ estimate_probability (loops_info)
...
@@ -449,14 +449,19 @@ estimate_probability (loops_info)
if
(
simple_loop_p
(
loops_info
,
loop
,
&
desc
)
if
(
simple_loop_p
(
loops_info
,
loop
,
&
desc
)
&&
desc
.
const_iter
)
&&
desc
.
const_iter
)
{
{
int
prob
;
niter
=
desc
.
niter
+
1
;
niter
=
desc
.
niter
+
1
;
if
(
niter
==
0
)
/* We might overflow here. */
if
(
niter
==
0
)
/* We might overflow here. */
niter
=
desc
.
niter
;
niter
=
desc
.
niter
;
prob
=
(
REG_BR_PROB_BASE
-
(
REG_BR_PROB_BASE
+
niter
/
2
)
/
niter
);
/* Branch prediction algorithm gives 0 frequency for everything
after the end of loop for loop having 0 probability to finish. */
if
(
prob
==
REG_BR_PROB_BASE
)
prob
=
REG_BR_PROB_BASE
-
1
;
predict_edge
(
desc
.
in_edge
,
PRED_LOOP_ITERATIONS
,
predict_edge
(
desc
.
in_edge
,
PRED_LOOP_ITERATIONS
,
REG_BR_PROB_BASE
prob
);
-
(
REG_BR_PROB_BASE
+
niter
/
2
)
/
niter
);
}
}
bbs
=
get_loop_body
(
loop
);
bbs
=
get_loop_body
(
loop
);
...
...
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