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
239a0f5b
Commit
239a0f5b
authored
Dec 20, 1999
by
Bernd Schmidt
Committed by
Bernd Schmidt
Dec 20, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change some regsets to regset_heads
From-SVN: r31032
parent
1af373f6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
46 deletions
+53
-46
gcc/ChangeLog
+7
-0
gcc/caller-save.c
+10
-10
gcc/global.c
+5
-5
gcc/reload.h
+2
-2
gcc/reload1.c
+22
-22
gcc/stupid.c
+7
-7
No files found.
gcc/ChangeLog
View file @
239a0f5b
1999
-
12
-
20
Bernd
Schmidt
<
bernds
@cygnus
.
co
.
uk
>
*
reload
.
h
(
struct
insn_chain
)
:
Change
live_throughout
and
dead_or_set
to
be
of
type
regset_head
,
not
regset
.
All
users
changed
by
adding
address
operator
.
*
reload1
.
c
(
new_insn_chain
)
:
Don
'
t
allocate
regsets
,
just
clear
them
.
1999
-
12
-
20
Michael
Hayes
<
m
.
hayes
@elec
.
canterbury
.
ac
.
nz
>
*
config
/
c4x
/
rtems
.
h
:
New
file
.
...
...
gcc/caller-save.c
View file @
239a0f5b
...
...
@@ -379,9 +379,9 @@ save_call_clobbered_regs ()
/* Use the register life information in CHAIN to compute which
regs are live during the call. */
REG_SET_TO_HARD_REG_SET
(
hard_regs_to_save
,
chain
->
live_throughout
);
&
chain
->
live_throughout
);
compute_use_by_pseudos
(
&
hard_regs_to_save
,
chain
->
live_throughout
);
&
chain
->
live_throughout
);
/* Record all registers set in this call insn. These don't need
to be saved. N.B. the call insn might set a subreg of a
...
...
@@ -618,7 +618,7 @@ insert_restore (chain, before_p, regno, maxrestore)
for
(
k
=
0
;
k
<
i
;
k
++
)
{
CLEAR_HARD_REG_BIT
(
hard_regs_saved
,
regno
+
k
);
SET_REGNO_REG_SET
(
new
->
dead_or_set
,
regno
+
k
);
SET_REGNO_REG_SET
(
&
new
->
dead_or_set
,
regno
+
k
);
n_regs_saved
--
;
}
...
...
@@ -687,7 +687,7 @@ insert_save (chain, before_p, regno, to_save)
for
(
k
=
0
;
k
<
numregs
;
k
++
)
{
SET_HARD_REG_BIT
(
hard_regs_saved
,
regno
+
k
);
SET_REGNO_REG_SET
(
new
->
dead_or_set
,
regno
+
k
);
SET_REGNO_REG_SET
(
&
new
->
dead_or_set
,
regno
+
k
);
n_regs_saved
++
;
}
...
...
@@ -735,7 +735,7 @@ insert_one_insn (chain, before_p, code, pat)
new
->
insn
=
emit_insn_before
(
pat
,
insn
);
/* ??? It would be nice if we could exclude the already / still saved
registers from the live sets. */
COPY_REG_SET
(
new
->
live_throughout
,
chain
->
live_throughout
);
COPY_REG_SET
(
&
new
->
live_throughout
,
&
chain
->
live_throughout
);
/* Registers that die in CHAIN->INSN still live in the new insn. */
for
(
link
=
REG_NOTES
(
chain
->
insn
);
link
;
link
=
XEXP
(
link
,
1
))
{
...
...
@@ -754,10 +754,10 @@ insert_one_insn (chain, before_p, code, pat)
continue
;
for
(
i
=
HARD_REGNO_NREGS
(
regno
,
GET_MODE
(
reg
))
-
1
;
i
>=
0
;
i
--
)
SET_REGNO_REG_SET
(
new
->
live_throughout
,
regno
+
i
);
SET_REGNO_REG_SET
(
&
new
->
live_throughout
,
regno
+
i
);
}
}
CLEAR_REG_SET
(
new
->
dead_or_set
);
CLEAR_REG_SET
(
&
new
->
dead_or_set
);
if
(
chain
->
insn
==
BLOCK_HEAD
(
chain
->
block
))
BLOCK_HEAD
(
chain
->
block
)
=
new
->
insn
;
}
...
...
@@ -771,13 +771,13 @@ insert_one_insn (chain, before_p, code, pat)
new
->
insn
=
emit_insn_after
(
pat
,
insn
);
/* ??? It would be nice if we could exclude the already / still saved
registers from the live sets, and observe REG_UNUSED notes. */
COPY_REG_SET
(
new
->
live_throughout
,
chain
->
live_throughout
);
COPY_REG_SET
(
&
new
->
live_throughout
,
&
chain
->
live_throughout
);
/* Registers that are set in CHAIN->INSN live in the new insn.
(Unless there is a REG_UNUSED note for them, but we don't
look for them here.) */
note_stores
(
PATTERN
(
chain
->
insn
),
add_stored_regs
,
new
->
live_throughout
);
CLEAR_REG_SET
(
new
->
dead_or_set
);
&
new
->
live_throughout
);
CLEAR_REG_SET
(
&
new
->
dead_or_set
);
if
(
chain
->
insn
==
BLOCK_END
(
chain
->
block
))
BLOCK_END
(
chain
->
block
)
=
new
->
insn
;
}
...
...
gcc/global.c
View file @
239a0f5b
...
...
@@ -1743,7 +1743,7 @@ reg_dies (regno, mode, chain)
{
CLEAR_REGNO_REG_SET
(
live_relevant_regs
,
regno
);
if
(
!
fixed_regs
[
regno
])
SET_REGNO_REG_SET
(
chain
->
dead_or_set
,
regno
);
SET_REGNO_REG_SET
(
&
chain
->
dead_or_set
,
regno
);
regno
++
;
}
}
...
...
@@ -1751,7 +1751,7 @@ reg_dies (regno, mode, chain)
{
CLEAR_REGNO_REG_SET
(
live_relevant_regs
,
regno
);
if
(
reg_renumber
[
regno
]
>=
0
)
SET_REGNO_REG_SET
(
chain
->
dead_or_set
,
regno
);
SET_REGNO_REG_SET
(
&
chain
->
dead_or_set
,
regno
);
}
}
...
...
@@ -1809,15 +1809,15 @@ build_insn_chain (first)
reg_dies
(
REGNO
(
XEXP
(
link
,
0
)),
GET_MODE
(
XEXP
(
link
,
0
)),
c
);
COPY_REG_SET
(
c
->
live_throughout
,
live_relevant_regs
);
COPY_REG_SET
(
&
c
->
live_throughout
,
live_relevant_regs
);
/* Mark everything born in this instruction as live. */
note_stores
(
PATTERN
(
first
),
reg_becomes_live
,
c
->
dead_or_set
);
&
c
->
dead_or_set
);
}
else
COPY_REG_SET
(
c
->
live_throughout
,
live_relevant_regs
);
COPY_REG_SET
(
&
c
->
live_throughout
,
live_relevant_regs
);
if
(
GET_RTX_CLASS
(
GET_CODE
(
first
))
==
'i'
)
{
...
...
gcc/reload.h
View file @
239a0f5b
...
...
@@ -225,8 +225,8 @@ struct insn_chain
rtx
insn
;
/* Register life information: record all live hard registers, and all
live pseudos that have a hard register. */
regset
live_throughout
;
regset
dead_or_set
;
regset
_head
live_throughout
;
regset
_head
dead_or_set
;
/* Copies of the global variables computed by find_reloads. */
struct
reload
*
rld
;
...
...
gcc/reload1.c
View file @
239a0f5b
...
...
@@ -514,8 +514,8 @@ new_insn_chain ()
{
c
=
(
struct
insn_chain
*
)
obstack_alloc
(
&
reload_obstack
,
sizeof
(
struct
insn_chain
));
c
->
live_throughout
=
OBSTACK_ALLOC_REG_SET
(
&
reload_obstack
);
c
->
dead_or_set
=
OBSTACK_ALLOC_REG_SET
(
&
reload_obstack
);
INIT_REG_SET
(
&
c
->
live_throughout
);
INIT_REG_SET
(
&
c
->
dead_or_set
);
}
else
{
...
...
@@ -1295,8 +1295,8 @@ maybe_fix_stack_asms ()
for
(
i
=
0
;
i
<
FIRST_PSEUDO_REGISTER
;
i
++
)
if
(
TEST_HARD_REG_BIT
(
allowed
,
i
))
{
CLEAR_REGNO_REG_SET
(
chain
->
live_throughout
,
i
);
CLEAR_REGNO_REG_SET
(
chain
->
dead_or_set
,
i
);
CLEAR_REGNO_REG_SET
(
&
chain
->
live_throughout
,
i
);
CLEAR_REGNO_REG_SET
(
&
chain
->
dead_or_set
,
i
);
}
}
...
...
@@ -1516,8 +1516,8 @@ order_regs_for_reload (chain)
/* Test the various reasons why we can't use a register for
spilling in this insn. */
if
(
fixed_regs
[
i
]
||
REGNO_REG_SET_P
(
chain
->
live_throughout
,
i
)
||
REGNO_REG_SET_P
(
chain
->
dead_or_set
,
i
))
||
REGNO_REG_SET_P
(
&
chain
->
live_throughout
,
i
)
||
REGNO_REG_SET_P
(
&
chain
->
dead_or_set
,
i
))
SET_HARD_REG_BIT
(
bad_spill_regs
,
i
);
}
/* Now find out which pseudos are allocated to it, and update
...
...
@@ -1525,12 +1525,12 @@ order_regs_for_reload (chain)
CLEAR_REG_SET
(
&
pseudos_counted
);
EXECUTE_IF_SET_IN_REG_SET
(
chain
->
live_throughout
,
FIRST_PSEUDO_REGISTER
,
j
,
(
&
chain
->
live_throughout
,
FIRST_PSEUDO_REGISTER
,
j
,
{
count_pseudo
(
j
);
});
EXECUTE_IF_SET_IN_REG_SET
(
chain
->
dead_or_set
,
FIRST_PSEUDO_REGISTER
,
j
,
(
&
chain
->
dead_or_set
,
FIRST_PSEUDO_REGISTER
,
j
,
{
count_pseudo
(
j
);
});
...
...
@@ -1645,12 +1645,12 @@ find_reg (chain, order, dumpfile)
rl
->
regno
=
best_reg
;
EXECUTE_IF_SET_IN_REG_SET
(
chain
->
live_throughout
,
FIRST_PSEUDO_REGISTER
,
j
,
(
&
chain
->
live_throughout
,
FIRST_PSEUDO_REGISTER
,
j
,
{
count_spilled_pseudo
(
best_reg
,
rl
->
nregs
,
j
);
});
EXECUTE_IF_SET_IN_REG_SET
(
chain
->
dead_or_set
,
FIRST_PSEUDO_REGISTER
,
j
,
(
&
chain
->
dead_or_set
,
FIRST_PSEUDO_REGISTER
,
j
,
{
count_spilled_pseudo
(
best_reg
,
rl
->
nregs
,
j
);
});
...
...
@@ -3496,13 +3496,13 @@ finish_spills (global, dumpfile)
for
(
chain
=
insns_need_reload
;
chain
;
chain
=
chain
->
next_need_reload
)
{
EXECUTE_IF_SET_IN_REG_SET
(
chain
->
live_throughout
,
FIRST_PSEUDO_REGISTER
,
i
,
(
&
chain
->
live_throughout
,
FIRST_PSEUDO_REGISTER
,
i
,
{
ior_hard_reg_set
(
pseudo_forbidden_regs
+
i
,
&
chain
->
used_spill_regs
);
});
EXECUTE_IF_SET_IN_REG_SET
(
chain
->
dead_or_set
,
FIRST_PSEUDO_REGISTER
,
i
,
(
&
chain
->
dead_or_set
,
FIRST_PSEUDO_REGISTER
,
i
,
{
ior_hard_reg_set
(
pseudo_forbidden_regs
+
i
,
&
chain
->
used_spill_regs
);
...
...
@@ -3535,22 +3535,22 @@ finish_spills (global, dumpfile)
HARD_REG_SET
used_by_pseudos
;
HARD_REG_SET
used_by_pseudos2
;
AND_COMPL_REG_SET
(
chain
->
live_throughout
,
&
spilled_pseudos
);
AND_COMPL_REG_SET
(
chain
->
dead_or_set
,
&
spilled_pseudos
);
AND_COMPL_REG_SET
(
&
chain
->
live_throughout
,
&
spilled_pseudos
);
AND_COMPL_REG_SET
(
&
chain
->
dead_or_set
,
&
spilled_pseudos
);
/* Mark any unallocated hard regs as available for spills. That
makes inheritance work somewhat better. */
if
(
chain
->
need_reload
)
{
REG_SET_TO_HARD_REG_SET
(
used_by_pseudos
,
chain
->
live_throughout
);
REG_SET_TO_HARD_REG_SET
(
used_by_pseudos2
,
chain
->
dead_or_set
);
REG_SET_TO_HARD_REG_SET
(
used_by_pseudos
,
&
chain
->
live_throughout
);
REG_SET_TO_HARD_REG_SET
(
used_by_pseudos2
,
&
chain
->
dead_or_set
);
IOR_HARD_REG_SET
(
used_by_pseudos
,
used_by_pseudos2
);
/* Save the old value for the sanity test below. */
COPY_HARD_REG_SET
(
used_by_pseudos2
,
chain
->
used_spill_regs
);
compute_use_by_pseudos
(
&
used_by_pseudos
,
chain
->
live_throughout
);
compute_use_by_pseudos
(
&
used_by_pseudos
,
chain
->
dead_or_set
);
compute_use_by_pseudos
(
&
used_by_pseudos
,
&
chain
->
live_throughout
);
compute_use_by_pseudos
(
&
used_by_pseudos
,
&
chain
->
dead_or_set
);
COMPL_HARD_REG_SET
(
chain
->
used_spill_regs
,
used_by_pseudos
);
AND_HARD_REG_SET
(
chain
->
used_spill_regs
,
used_spill_regs
);
...
...
@@ -5040,12 +5040,12 @@ choose_reload_regs_init (chain, save_reload_reg_rtx)
CLEAR_HARD_REG_SET
(
reg_used_in_insn
);
{
HARD_REG_SET
tmp
;
REG_SET_TO_HARD_REG_SET
(
tmp
,
chain
->
live_throughout
);
REG_SET_TO_HARD_REG_SET
(
tmp
,
&
chain
->
live_throughout
);
IOR_HARD_REG_SET
(
reg_used_in_insn
,
tmp
);
REG_SET_TO_HARD_REG_SET
(
tmp
,
chain
->
dead_or_set
);
REG_SET_TO_HARD_REG_SET
(
tmp
,
&
chain
->
dead_or_set
);
IOR_HARD_REG_SET
(
reg_used_in_insn
,
tmp
);
compute_use_by_pseudos
(
&
reg_used_in_insn
,
chain
->
live_throughout
);
compute_use_by_pseudos
(
&
reg_used_in_insn
,
chain
->
dead_or_set
);
compute_use_by_pseudos
(
&
reg_used_in_insn
,
&
chain
->
live_throughout
);
compute_use_by_pseudos
(
&
reg_used_in_insn
,
&
chain
->
dead_or_set
);
}
for
(
i
=
0
;
i
<
reload_n_operands
;
i
++
)
{
...
...
gcc/stupid.c
View file @
239a0f5b
...
...
@@ -162,7 +162,7 @@ find_clobbered_regs (reg, setter, data)
nregs
=
HARD_REGNO_NREGS
(
regno
,
GET_MODE
(
reg
));
while
(
nregs
--
>
0
)
{
SET_REGNO_REG_SET
(
current_chain
->
live_throughout
,
regno
++
);
SET_REGNO_REG_SET
(
&
current_chain
->
live_throughout
,
regno
++
);
}
}
...
...
@@ -285,7 +285,7 @@ stupid_life_analysis (f, nregs, file)
chain
->
insn
=
insn
;
for
(
i
=
0
;
i
<
FIRST_PSEUDO_REGISTER
;
i
++
)
if
(
regs_live
[
i
])
SET_REGNO_REG_SET
(
chain
->
live_throughout
,
i
);
SET_REGNO_REG_SET
(
&
chain
->
live_throughout
,
i
);
}
/* Update which hard regs are currently live
...
...
@@ -403,14 +403,14 @@ stupid_life_analysis (f, nregs, file)
continue
;
chain
=
reg_where_dead_chain
[
i
];
SET_REGNO_REG_SET
(
chain
->
dead_or_set
,
i
);
SET_REGNO_REG_SET
(
&
chain
->
dead_or_set
,
i
);
while
((
chain
=
chain
->
prev
)
&&
INSN_SUID
(
chain
->
insn
)
>
reg_where_born_exact
[
i
])
SET_REGNO_REG_SET
(
chain
->
live_throughout
,
i
);
SET_REGNO_REG_SET
(
&
chain
->
live_throughout
,
i
);
if
(
chain
)
SET_REGNO_REG_SET
(
chain
->
dead_or_set
,
i
);
SET_REGNO_REG_SET
(
&
chain
->
dead_or_set
,
i
);
}
if
(
file
)
...
...
@@ -577,7 +577,7 @@ mark_hard_ref (reg, live_before_p, chain)
{
if
(
!
fixed_regs
[
regno
+
j
]
&&
(
!
live_before_p
||
!
live
[
regno
+
j
]))
SET_REGNO_REG_SET
(
chain
->
dead_or_set
,
regno
+
j
);
SET_REGNO_REG_SET
(
&
chain
->
dead_or_set
,
regno
+
j
);
regs_ever_live
[
regno
+
j
]
=
1
;
live
[
regno
+
j
]
=
live_before_p
;
}
...
...
@@ -634,7 +634,7 @@ stupid_mark_refs (x, chain)
they do get stored even though never used again. */
MARK_LIVE_AFTER
(
insn
,
regno
+
j
);
CLEAR_REGNO_REG_SET
(
chain
->
live_throughout
,
regno
+
j
);
CLEAR_REGNO_REG_SET
(
&
chain
->
live_throughout
,
regno
+
j
);
/* When a hard reg is clobbered, mark it in use
just before this insn, so it is live all through. */
...
...
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