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
2fa692c0
Commit
2fa692c0
authored
Nov 03, 2010
by
Xinliang David Li
Committed by
Xinliang David Li
Nov 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PR/46200
From-SVN: r166280
parent
9451da74
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
+41
-2
gcc/ChangeLog
+6
-0
gcc/testsuite/ChangeLog
+5
-0
gcc/testsuite/g++.dg/tree-ssa/ivopts-2.C
+11
-0
gcc/tree-ssa-loop-ivopts.c
+19
-2
No files found.
gcc/ChangeLog
View file @
2fa692c0
2010
-
11
-
03
Xinliang
David
Li
<
davidxl
@google
.
com
>
PR
target
/
46200
*
tree
-
ssa
-
loop
-
ivopts
.
c
(
get_computation_cost_at
)
:
Adjust
cbase
if
the
use
stmt
is
after
iv
update
.
2010
-
11
-
03
Kaz
Kojima
<
kkojima
@gcc
.
gnu
.
org
>
2010
-
11
-
03
Kaz
Kojima
<
kkojima
@gcc
.
gnu
.
org
>
*
config
.
gcc
(
sh64
*
)
<
tm_file
>:
Add
newlib
-
stdint
.
h
for
*
config
.
gcc
(
sh64
*
)
<
tm_file
>:
Add
newlib
-
stdint
.
h
for
gcc/testsuite/ChangeLog
View file @
2fa692c0
2010
-
11
-
03
Xinliang
David
Li
<
davidxl
@google
.
com
>
PR
target
/
46200
*
g
++
.
dg
/
tree
-
ssa
/
ivopts
-
2
.
C
:
New
test
.
2010
-
11
-
03
H
.
J
.
Lu
<
hongjiu
.
lu
@intel
.
com
>
2010
-
11
-
03
H
.
J
.
Lu
<
hongjiu
.
lu
@intel
.
com
>
PR
target
/
46295
PR
target
/
46295
...
...
gcc/testsuite/g++.dg/tree-ssa/ivopts-2.C
0 → 100644
View file @
2fa692c0
/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
/* { dg-options "-O2 -fdump-tree-ivopts-details" } */
void
test
(
int
*
b
,
int
*
e
,
int
stride
)
{
for
(
int
*
p
=
b
;
p
!=
e
;
p
+=
stride
)
*
p
=
1
;
}
/* { dg-final { scan-tree-dump-times "PHI <p" 1 "ivopts"} } */
/* { dg-final { cleanup-tree-dump "ivopts" } } */
gcc/tree-ssa-loop-ivopts.c
View file @
2fa692c0
...
@@ -4027,6 +4027,8 @@ get_computation_cost_at (struct ivopts_data *data,
...
@@ -4027,6 +4027,8 @@ get_computation_cost_at (struct ivopts_data *data,
STRIP_NOPS
(
cbase
);
STRIP_NOPS
(
cbase
);
ctype
=
TREE_TYPE
(
cbase
);
ctype
=
TREE_TYPE
(
cbase
);
stmt_is_after_inc
=
stmt_after_increment
(
data
->
current_loop
,
cand
,
at
);
/* use = ubase + ratio * (var - cbase). If either cbase is a constant
/* use = ubase + ratio * (var - cbase). If either cbase is a constant
or ratio == 1, it is better to handle this like
or ratio == 1, it is better to handle this like
...
@@ -4045,8 +4047,24 @@ get_computation_cost_at (struct ivopts_data *data,
...
@@ -4045,8 +4047,24 @@ get_computation_cost_at (struct ivopts_data *data,
}
}
else
if
(
ratio
==
1
)
else
if
(
ratio
==
1
)
{
{
tree
real_cbase
=
cbase
;
/* Check to see if any adjustment is needed. */
if
(
cstepi
==
0
&&
stmt_is_after_inc
)
{
aff_tree
real_cbase_aff
;
aff_tree
cstep_aff
;
tree_to_aff_combination
(
cbase
,
TREE_TYPE
(
real_cbase
),
&
real_cbase_aff
);
tree_to_aff_combination
(
cstep
,
TREE_TYPE
(
cstep
),
&
cstep_aff
);
aff_combination_add
(
&
real_cbase_aff
,
&
cstep_aff
);
real_cbase
=
aff_combination_to_tree
(
&
real_cbase_aff
);
}
cost
=
difference_cost
(
data
,
cost
=
difference_cost
(
data
,
ubase
,
cbase
,
ubase
,
real_
cbase
,
&
symbol_present
,
&
var_present
,
&
offset
,
&
symbol_present
,
&
var_present
,
&
offset
,
depends_on
);
depends_on
);
cost
.
cost
/=
avg_loop_niter
(
data
->
current_loop
);
cost
.
cost
/=
avg_loop_niter
(
data
->
current_loop
);
...
@@ -4088,7 +4106,6 @@ get_computation_cost_at (struct ivopts_data *data,
...
@@ -4088,7 +4106,6 @@ get_computation_cost_at (struct ivopts_data *data,
/* If we are after the increment, the value of the candidate is higher by
/* If we are after the increment, the value of the candidate is higher by
one iteration. */
one iteration. */
stmt_is_after_inc
=
stmt_after_increment
(
data
->
current_loop
,
cand
,
at
);
if
(
stmt_is_after_inc
)
if
(
stmt_is_after_inc
)
offset
-=
ratio
*
cstepi
;
offset
-=
ratio
*
cstepi
;
...
...
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