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
1a46d33d
Commit
1a46d33d
authored
Dec 19, 2007
by
Revital Eres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix generation of reg-moves
From-SVN: r131060
parent
5259c813
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
2 deletions
+105
-2
gcc/ChangeLog
+8
-0
gcc/modulo-sched.c
+46
-2
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.dg/sms-5.c
+47
-0
No files found.
gcc/ChangeLog
View file @
1a46d33d
2007
-
12
-
19
Alexander
Monakov
<
amonakov
@
ispras
.
ru
>
Revital
Eres
<
eres
@
il
.
ibm
.
com
>
*
modulo
-
sched
.
c
(
generate_reg_moves
):
Insert
the
reg
-
moves
right
before
the
notes
which
precedes
the
insn
,
if
they
exists
.
(
loop_canon_p
):
Add
dump
info
.
(
sms_schedule
):
Likewise
.
2007
-
12
-
19
Richard
Sandiford
<
rsandifo
@
nildram
.
co
.
uk
>
*
tree
.
h
(
set_decl_incoming_rtl
):
Add
a
by_reference_p
parameter
.
gcc/modulo-sched.c
View file @
1a46d33d
...
...
@@ -506,7 +506,9 @@ generate_reg_moves (partial_schedule_ptr ps, bool rescan)
/* Now generate the reg_moves, attaching relevant uses to them. */
SCHED_NREG_MOVES
(
u
)
=
nreg_moves
;
old_reg
=
prev_reg
=
copy_rtx
(
SET_DEST
(
single_set
(
u
->
insn
)));
last_reg_move
=
u
->
insn
;
/* Insert the reg-moves right before the notes which precede
the insn they relates to. */
last_reg_move
=
u
->
first_note
;
for
(
i_reg_move
=
0
;
i_reg_move
<
nreg_moves
;
i_reg_move
++
)
{
...
...
@@ -794,7 +796,11 @@ loop_canon_p (struct loop *loop)
{
if
(
loop
->
inner
||
!
loop_outer
(
loop
))
{
if
(
dump_file
)
fprintf
(
dump_file
,
"SMS loop inner or !loop_outer
\n
"
);
return
false
;
}
if
(
!
single_exit
(
loop
))
{
...
...
@@ -910,6 +916,12 @@ sms_schedule (void)
We use loop->num as index into this array. */
g_arr
=
XCNEWVEC
(
ddg_ptr
,
number_of_loops
());
if
(
dump_file
)
{
fprintf
(
dump_file
,
"
\n\n
SMS analysis phase
\n
"
);
fprintf
(
dump_file
,
"===================
\n\n
"
);
}
/* Build DDGs for all the relevant loops and hold them in G_ARR
indexed by the loop index. */
FOR_EACH_LOOP
(
li
,
loop
,
0
)
...
...
@@ -926,11 +938,24 @@ sms_schedule (void)
break
;
}
if
(
dump_file
)
{
rtx
insn
=
BB_END
(
loop
->
header
);
fprintf
(
dump_file
,
"SMS loop num: %d, file: %s, line: %d
\n
"
,
loop
->
num
,
insn_file
(
insn
),
insn_line
(
insn
));
}
if
(
!
loop_canon_p
(
loop
))
continue
;
if
(
!
loop_single_full_bb_p
(
loop
))
{
if
(
dump_file
)
fprintf
(
dump_file
,
"SMS not loop_single_full_bb_p
\n
"
);
continue
;
}
bb
=
loop
->
header
;
...
...
@@ -971,7 +996,11 @@ sms_schedule (void)
/* Make sure this is a doloop. */
if
(
!
(
count_reg
=
doloop_register_get
(
head
,
tail
)))
{
if
(
dump_file
)
fprintf
(
dump_file
,
"SMS doloop_register_get failed
\n
"
);
continue
;
}
/* Don't handle BBs with calls or barriers, or !single_set insns,
or auto-increment insns (to avoid creating invalid reg-moves
...
...
@@ -1021,7 +1050,15 @@ sms_schedule (void)
}
g_arr
[
loop
->
num
]
=
g
;
if
(
dump_file
)
fprintf
(
dump_file
,
"...OK
\n
"
);
}
if
(
dump_file
)
{
fprintf
(
dump_file
,
"
\n
SMS transformation phase
\n
"
);
fprintf
(
dump_file
,
"=========================
\n\n
"
);
}
/* We don't want to perform SMS on new loops - created by versioning. */
FOR_EACH_LOOP
(
li
,
loop
,
0
)
...
...
@@ -1036,7 +1073,14 @@ sms_schedule (void)
continue
;
if
(
dump_file
)
print_ddg
(
dump_file
,
g
);
{
rtx
insn
=
BB_END
(
loop
->
header
);
fprintf
(
dump_file
,
"SMS loop num: %d, file: %s, line: %d
\n
"
,
loop
->
num
,
insn_file
(
insn
),
insn_line
(
insn
));
print_ddg
(
dump_file
,
g
);
}
get_ebb_head_tail
(
loop
->
header
,
loop
->
header
,
&
head
,
&
tail
);
...
...
gcc/testsuite/ChangeLog
View file @
1a46d33d
2007
-
12
-
19
Revital
Eres
<
eres
@il
.
ibm
.
com
>
*
gcc
.
dg
/
sms
-
5
.
c
:
New
testcase
.
2007
-
12
-
19
Jerry
DeLisle
<
jvdelisle
@gcc
.
gnu
.
org
>
PR
fortran
/
34325
gcc/testsuite/gcc.dg/sms-5.c
0 → 100644
View file @
1a46d33d
/* { dg-do run } */
/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -funroll-loops" } */
/* This is the same test as loop-2e.c test. It is related to a fix in
the generation of the prolog and epilog. */
extern
void
abort
(
void
);
void
f
(
int
*
p
,
int
**
q
)
{
int
i
;
for
(
i
=
0
;
i
<
40
;
i
++
)
{
*
q
++
=
&
p
[
i
];
}
}
int
main
()
{
void
*
p
;
int
*
q
[
40
];
__SIZE_TYPE__
start
;
/* Find the signed middle of the address space. */
if
(
sizeof
(
start
)
==
sizeof
(
int
))
start
=
(
__SIZE_TYPE__
)
__INT_MAX__
;
else
if
(
sizeof
(
start
)
==
sizeof
(
long
))
start
=
(
__SIZE_TYPE__
)
__LONG_MAX__
;
else
if
(
sizeof
(
start
)
==
sizeof
(
long
long
))
start
=
(
__SIZE_TYPE__
)
__LONG_LONG_MAX__
;
else
return
0
;
/* Arbitrarily align the pointer. */
start
&=
-
32
;
/* Pretend that's good enough to start address arithmetic. */
p
=
(
void
*
)
start
;
/* Verify that GIV replacement computes the correct results. */
q
[
39
]
=
0
;
f
(
p
,
q
);
if
(
q
[
39
]
!=
(
int
*
)
p
+
39
)
abort
();
return
0
;
}
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