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
39379e67
Commit
39379e67
authored
Jun 02, 1997
by
Michael Meissner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Widen some short fields to int; Use allocate_reg_info to allocate the reg_renumber array
From-SVN: r14142
parent
2808652a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
37 deletions
+78
-37
gcc/flow.c
+1
-1
gcc/local-alloc.c
+2
-3
gcc/loop.c
+6
-6
gcc/regclass.c
+59
-12
gcc/regs.h
+3
-3
gcc/sched.c
+4
-7
gcc/stupid.c
+3
-5
No files found.
gcc/flow.c
View file @
39379e67
...
...
@@ -1286,7 +1286,7 @@ allocate_for_life_analysis ()
information, explicitly reset it here. The allocation should have
already happened on the previous reg_scan pass. Make sure in case
some more registers were allocated. */
allocate_reg_info
(
max_regno
,
FALSE
);
allocate_reg_info
(
max_regno
,
FALSE
,
FALSE
);
for
(
i
=
0
;
i
<
max_regno
;
i
++
)
REG_N_SETS
(
i
)
=
0
;
...
...
gcc/local-alloc.c
View file @
39379e67
...
...
@@ -453,9 +453,8 @@ local_alloc ()
reg_offset
=
(
char
*
)
alloca
(
max_regno
*
sizeof
(
char
));
reg_next_in_qty
=
(
int
*
)
alloca
(
max_regno
*
sizeof
(
int
));
reg_renumber
=
(
short
*
)
oballoc
(
max_regno
*
sizeof
(
short
));
for
(
i
=
0
;
i
<
max_regno
;
i
++
)
reg_renumber
[
i
]
=
-
1
;
/* Allocate the reg_renumber array */
allocate_reg_info
(
max_regno
,
FALSE
,
TRUE
);
/* Determine which pseudo-registers can be allocated by local-alloc.
In general, these are the registers used only in a single block and
...
...
gcc/loop.c
View file @
39379e67
...
...
@@ -139,13 +139,13 @@ static rtx loop_continue;
Therefore, at all times, == 0 indicates an invariant register;
< 0 a conditionally invariant one. */
static
shor
t
*
n_times_set
;
static
in
t
*
n_times_set
;
/* Original value of n_times_set; same except that this value
is not set negative for a reg whose sets have been made candidates
and not set to 0 for a reg that is moved. */
static
shor
t
*
n_times_used
;
static
in
t
*
n_times_used
;
/* Index by register number, 1 indicates that the register
cannot be moved or strength reduced. */
...
...
@@ -497,8 +497,8 @@ scan_loop (loop_start, end, nregs)
/* Nonzero if we are scanning instructions in a sub-loop. */
int
loop_depth
=
0
;
n_times_set
=
(
short
*
)
alloca
(
nregs
*
sizeof
(
shor
t
));
n_times_used
=
(
short
*
)
alloca
(
nregs
*
sizeof
(
shor
t
));
n_times_set
=
(
int
*
)
alloca
(
nregs
*
sizeof
(
in
t
));
n_times_used
=
(
int
*
)
alloca
(
nregs
*
sizeof
(
in
t
));
may_not_optimize
=
(
char
*
)
alloca
(
nregs
);
/* Determine whether this loop starts with a jump down to a test at
...
...
@@ -581,7 +581,7 @@ scan_loop (loop_start, end, nregs)
the setting of register I. If this loop has calls, set
reg_single_usage[I]. */
bzero
((
char
*
)
n_times_set
,
nregs
*
sizeof
(
shor
t
));
bzero
((
char
*
)
n_times_set
,
nregs
*
sizeof
(
in
t
));
bzero
(
may_not_optimize
,
nregs
);
if
(
loop_has_call
)
...
...
@@ -595,7 +595,7 @@ scan_loop (loop_start, end, nregs)
for
(
i
=
0
;
i
<
FIRST_PSEUDO_REGISTER
;
i
++
)
may_not_optimize
[
i
]
=
1
,
n_times_set
[
i
]
=
1
;
bcopy
((
char
*
)
n_times_set
,
(
char
*
)
n_times_used
,
nregs
*
sizeof
(
shor
t
));
bcopy
((
char
*
)
n_times_set
,
(
char
*
)
n_times_used
,
nregs
*
sizeof
(
in
t
));
if
(
loop_dump_stream
)
{
...
...
gcc/regclass.c
View file @
39379e67
/* Compute register class preferences for pseudo-registers.
Copyright (C) 1987, 88, 91, 92, 93, 94,
1996
Free Software Foundation, Inc.
Copyright (C) 1987, 88, 91, 92, 93, 94,
96, 1997
Free Software Foundation, Inc.
This file is part of GNU CC.
...
...
@@ -1651,37 +1651,84 @@ auto_inc_dec_reg_p (reg, mode)
/* Allocate enough space to hold NUM_REGS registers for the tables used for
reg_scan and flow_analysis that are indexed by the register number. If
NEW_P is set, initialize all of the registers, otherwise only initialize the
new registers allocated. The same table is kept from function to function,
only reallocating it when we need more room. */
NEW_P is non zero, initialize all of the registers, otherwise only
initialize the new registers allocated. The same table is kept from
function to function, only reallocating it when we need more room. If
RENUMBER_P is non zero, allocate the reg_renumber array also. */
void
allocate_reg_info
(
num_regs
,
new_p
)
allocate_reg_info
(
num_regs
,
new_p
,
renumber_p
)
int
num_regs
;
int
new_p
;
int
renumber_p
;
{
static
int
regno_allocated
=
0
;
static
int
regno_max
=
0
;
static
short
*
renumber
=
(
short
*
)
0
;
int
i
;
int
size
;
int
size_info
;
int
size_renumber
;
int
min
=
(
new_p
)
?
0
:
regno_max
+
1
;
/* If this message come up, and you want to fix it, then all of the tables
like reg_renumber, etc. that use short will have to be found and lengthed
to int or HOST_WIDE_INT. */
/* Free up all storage allocated */
if
(
num_regs
<
0
)
{
if
(
reg_n_info
)
{
free
((
char
*
)
reg_n_info
);
free
((
char
*
)
renumber
);
reg_n_info
=
(
reg_info
*
)
0
;
renumber
=
(
short
*
)
0
;
}
regno_allocated
=
0
;
regno_max
=
0
;
return
;
}
if
(
num_regs
>
regno_allocated
)
{
regno_allocated
=
num_regs
+
(
num_regs
/
20
);
/* add some slop space */
size
=
regno_allocated
*
sizeof
(
reg_info
);
reg_n_info
=
((
reg_n_info
)
?
(
reg_info
*
)
xrealloc
((
char
*
)
reg_n_info
,
size
)
:
(
reg_info
*
)
xmalloc
(
size
));
size_info
=
regno_allocated
*
sizeof
(
reg_info
);
size_renumber
=
regno_allocated
*
sizeof
(
short
);
if
(
!
reg_n_info
)
{
reg_n_info
=
(
reg_info
*
)
xmalloc
(
size_info
);
renumber
=
(
short
*
)
xmalloc
(
size_renumber
);
}
else
if
(
new_p
)
/* if we're zapping everything, no need to realloc */
{
free
((
char
*
)
reg_n_info
);
free
((
char
*
)
renumber
);
reg_n_info
=
(
reg_info
*
)
xmalloc
(
size_info
);
renumber
=
(
short
*
)
xmalloc
(
size_renumber
);
}
else
{
reg_n_info
=
(
reg_info
*
)
xrealloc
((
char
*
)
reg_n_info
,
size_info
);
renumber
=
(
short
*
)
xrealloc
((
char
*
)
renumber
,
size_renumber
);
}
}
if
(
min
<
num_regs
)
{
bzero
((
char
*
)
&
reg_n_info
[
min
],
(
num_regs
-
min
)
*
sizeof
(
reg_info
));
for
(
i
=
min
;
i
<
num_regs
;
i
++
)
REG_BASIC_BLOCK
(
i
)
=
REG_BLOCK_UNKNOWN
;
{
REG_BASIC_BLOCK
(
i
)
=
REG_BLOCK_UNKNOWN
;
renumber
[
i
]
=
-
1
;
}
}
if
(
renumber_p
)
reg_renumber
=
renumber
;
regno_max
=
num_regs
;
}
...
...
@@ -1709,7 +1756,7 @@ reg_scan (f, nregs, repeat)
{
register
rtx
insn
;
allocate_reg_info
(
nregs
,
TRUE
);
allocate_reg_info
(
nregs
,
TRUE
,
FALSE
);
max_parallel
=
3
;
for
(
insn
=
f
;
insn
;
insn
=
NEXT_INSN
(
insn
))
...
...
gcc/regs.h
View file @
39379e67
/* Define per-register tables for data flow info and register allocation.
Copyright (C) 1987, 1993, 1994, 1995 Free Software Foundation, Inc.
Copyright (C) 1987, 1993, 1994, 1995
, 1997
Free Software Foundation, Inc.
This file is part of GNU CC.
...
...
@@ -124,7 +124,7 @@ extern reg_info *reg_n_info;
This can't be folded into reg_n_info without changing all of the
machine dependent directories, since the reload functions
access it. */
in the machine dependent files
access it. */
extern
short
*
reg_renumber
;
...
...
@@ -214,4 +214,4 @@ extern int *scratch_block;
extern
int
scratch_list_length
;
/* Allocate reg_n_info tables */
extern
void
allocate_reg_info
PROTO
((
int
,
int
));
extern
void
allocate_reg_info
PROTO
((
int
,
int
,
int
));
gcc/sched.c
View file @
39379e67
...
...
@@ -135,7 +135,6 @@ Boston, MA 02111-1307, USA. */
Values of these arrays are copied at the end of this pass into the
arrays set up by flow analysis. */
static
short
*
sched_reg_n_deaths
;
static
int
*
sched_reg_n_calls_crossed
;
static
int
*
sched_reg_live_length
;
...
...
@@ -290,8 +289,10 @@ static int *insn_tick;
struct
sometimes
{
short
offset
;
short
bit
;
short
live_length
;
short
calls_crossed
;
int
offset
;
int
bit
;
int
live_length
;
int
calls_crossed
;
};
/* Forward declarations. */
...
...
@@ -4872,20 +4873,16 @@ schedule_insns (dump_file)
if
(
reload_completed
==
0
)
{
sched_reg_n_deaths
=
(
short
*
)
alloca
(
max_regno
*
sizeof
(
short
));
sched_reg_n_calls_crossed
=
(
int
*
)
alloca
(
max_regno
*
sizeof
(
int
));
sched_reg_live_length
=
(
int
*
)
alloca
(
max_regno
*
sizeof
(
int
));
bb_dead_regs
=
(
regset
)
alloca
(
regset_bytes
);
bb_live_regs
=
(
regset
)
alloca
(
regset_bytes
);
bzero
((
char
*
)
sched_reg_n_calls_crossed
,
max_regno
*
sizeof
(
int
));
bzero
((
char
*
)
sched_reg_live_length
,
max_regno
*
sizeof
(
int
));
for
(
i
=
0
;
i
<
max_regno
;
i
++
)
sched_reg_n_deaths
[
i
]
=
REG_N_DEATHS
(
i
);
init_alias_analysis
();
}
else
{
sched_reg_n_deaths
=
0
;
sched_reg_n_calls_crossed
=
0
;
sched_reg_live_length
=
0
;
bb_dead_regs
=
0
;
...
...
gcc/stupid.c
View file @
39379e67
/* Dummy data flow analysis for GNU compiler in nonoptimizing mode.
Copyright (C) 1987, 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 1987, 1991, 1994, 1995, 1996
, 1997
Free Software Foundation, Inc.
This file is part of GNU CC.
...
...
@@ -179,13 +179,11 @@ stupid_life_analysis (f, nregs, file)
regs_crosses_setjmp
=
(
char
*
)
alloca
(
nregs
*
sizeof
(
char
));
bzero
((
char
*
)
regs_crosses_setjmp
,
nregs
*
sizeof
(
char
));
reg_renumber
=
(
short
*
)
oballoc
(
nregs
*
sizeof
(
short
));
/* Allocate the reg_renumber array */
allocate_reg_info
(
max_regno
,
FALSE
,
TRUE
);
for
(
i
=
0
;
i
<
FIRST_PSEUDO_REGISTER
;
i
++
)
reg_renumber
[
i
]
=
i
;
for
(
i
=
FIRST_VIRTUAL_REGISTER
;
i
<
max_regno
;
i
++
)
reg_renumber
[
i
]
=
-
1
;
after_insn_hard_regs
=
(
HARD_REG_SET
*
)
alloca
(
max_suid
*
sizeof
(
HARD_REG_SET
));
...
...
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