reload.c (find_reloads): In code to promote RELOAD_FOR_X_ADDR_ADDR reloads to RELOAD_FOR_X_ADDRESS...

* reload.c (find_reloads): In code to promote RELOAD_FOR_X_ADDR_ADDR
	reloads to RELOAD_FOR_X_ADDRESS reloads, test for reload sharing.
	Properly keep track of first RELOAD_FOR_X_ADDRESS also for
	more than 3 such reloads.
	If there is not more than one RELOAD_FOR_X_ADDRESS, don't change
	RELOAD_FOR_X_ADDR_ADDR reload.

From-SVN: r22568
This commit is contained in:
J"orn Rennecke 1998-09-24 10:51:35 +00:00 committed by Joern Rennecke
parent 34c7390981
commit c10638c922
2 changed files with 34 additions and 6 deletions

View File

@ -1,3 +1,14 @@
Thu Sep 24 18:48:43 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* reload.c (find_reloads): In code to promote RELOAD_FOR_X_ADDR_ADDR
reloads to RELOAD_FOR_X_ADDRESS reloads, test for reload sharing.
Properly keep track of first RELOAD_FOR_X_ADDRESS also for
more than 3 such reloads.
If there is not more than one RELOAD_FOR_X_ADDRESS, don't change
RELOAD_FOR_X_ADDR_ADDR reload.
Thu Sep 24 17:45:55 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* expr.c (store_constructor): When initializing a field that is smaller

View File

@ -4018,7 +4018,8 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
a single operand.
We can reduce the register pressure by exploiting that a
RELOAD_FOR_X_ADDR_ADDR that precedes all RELOAD_FOR_X_ADDRESS reloads
does not conflict with any of them. */
does not conflict with any of them, if it is only used for the first of
the RELOAD_FOR_X_ADDRESS reloads. */
{
int first_op_addr_num = -2;
int first_inpaddr_num[MAX_RECOG_OPERANDS];
@ -4037,21 +4038,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
switch (reload_when_needed[i])
{
case RELOAD_FOR_OPERAND_ADDRESS:
if (! ++first_op_addr_num)
if (++first_op_addr_num >= 0)
{
first_op_addr_num= i;
first_op_addr_num = i;
need_change = 1;
}
break;
case RELOAD_FOR_INPUT_ADDRESS:
if (! ++first_inpaddr_num[reload_opnum[i]])
if (++first_inpaddr_num[reload_opnum[i]] >= 0)
{
first_inpaddr_num[reload_opnum[i]] = i;
need_change = 1;
}
break;
case RELOAD_FOR_OUTPUT_ADDRESS:
if (! ++first_outpaddr_num[reload_opnum[i]])
if (++first_outpaddr_num[reload_opnum[i]] >= 0)
{
first_outpaddr_num[reload_opnum[i]] = i;
need_change = 1;
@ -4085,8 +4086,24 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
default:
continue;
}
if (i > first_num)
if (first_num < 0)
continue;
else if (i > first_num)
reload_when_needed[i] = type;
else
{
/* Check if the only TYPE reload that uses reload I is
reload FIRST_NUM. */
for (j = n_reloads - 1; j > first_num; j--)
{
if (reload_when_needed[j] == type
&& reg_mentioned_p (reload_in[i], reload_in[j]))
{
reload_when_needed[i] = type;
break;
}
}
}
}
}
}