Commit 09a308fe by J"orn Rennecke Committed by Joern Rennecke

reload.h (earlyclobber_operand_p): Declare.

	* reload.h (earlyclobber_operand_p): Declare.
	* reload.c (earlyclobber_operand_p): Don't declare.  No longer static.
	* reload1.c (reload_reg_free_for_value_p):  RELOAD_OTHER reloads with
	an earlyclobbered output conflict with RELOAD_INPUT reloads - handle
	case where the RELOAD_OTHER reload is new.  Use earlyclobber_operand_p.

From-SVN: r30202
parent a05924f9
Wed Oct 27 03:09:23 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* reload.h (earlyclobber_operand_p): Declare.
* reload.c (earlyclobber_operand_p): Don't declare. No longer static.
* reload1.c (reload_reg_free_for_value_p): RELOAD_OTHER reloads with
an earlyclobbered output conflict with RELOAD_INPUT reloads - handle
case where the RELOAD_OTHER reload is new. Use earlyclobber_operand_p.
Tue Oct 26 18:23:38 1999 Jan Hubicka <hubicka@freesoft.cz> Tue Oct 26 18:23:38 1999 Jan Hubicka <hubicka@freesoft.cz>
Richard Henderson <rth@cygnus.com> Richard Henderson <rth@cygnus.com>
......
...@@ -252,7 +252,6 @@ static int find_reusable_reload PROTO((rtx *, rtx, enum reg_class, ...@@ -252,7 +252,6 @@ static int find_reusable_reload PROTO((rtx *, rtx, enum reg_class,
static rtx find_dummy_reload PROTO((rtx, rtx, rtx *, rtx *, static rtx find_dummy_reload PROTO((rtx, rtx, rtx *, rtx *,
enum machine_mode, enum machine_mode, enum machine_mode, enum machine_mode,
enum reg_class, int, int)); enum reg_class, int, int));
static int earlyclobber_operand_p PROTO((rtx));
static int hard_reg_set_here_p PROTO((int, int, rtx)); static int hard_reg_set_here_p PROTO((int, int, rtx));
static struct decomposition decompose PROTO((rtx)); static struct decomposition decompose PROTO((rtx));
static int immune_p PROTO((rtx, rtx, struct decomposition)); static int immune_p PROTO((rtx, rtx, struct decomposition));
...@@ -1921,7 +1920,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc, ...@@ -1921,7 +1920,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc,
/* Return 1 if X is an operand of an insn that is being earlyclobbered. */ /* Return 1 if X is an operand of an insn that is being earlyclobbered. */
static int int
earlyclobber_operand_p (x) earlyclobber_operand_p (x)
rtx x; rtx x;
{ {
......
...@@ -354,6 +354,9 @@ extern rtx find_equiv_reg PROTO((rtx, rtx, enum reg_class, int, short *, ...@@ -354,6 +354,9 @@ extern rtx find_equiv_reg PROTO((rtx, rtx, enum reg_class, int, short *,
/* Return 1 if register REGNO is the subject of a clobber in insn INSN. */ /* Return 1 if register REGNO is the subject of a clobber in insn INSN. */
extern int regno_clobbered_p PROTO((int, rtx)); extern int regno_clobbered_p PROTO((int, rtx));
/* Return 1 if X is an operand of an insn that is being earlyclobbered. */
int earlyclobber_operand_p PROTO((rtx));
/* Functions in reload1.c: */ /* Functions in reload1.c: */
extern int reloads_conflict PROTO ((int, int)); extern int reloads_conflict PROTO ((int, int));
......
...@@ -5291,6 +5291,10 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5291,6 +5291,10 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
int ignore_address_reloads; int ignore_address_reloads;
{ {
int time1; int time1;
/* Set if we see an input reload that must not share its reload register
with any new earlyclobber, but might otherwise share the reload
register with an output or input-output reload. */
int check_earlyclobber = 0;
int i; int i;
int copy = 0; int copy = 0;
...@@ -5372,7 +5376,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5372,7 +5376,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
if (! rld[i].in || ! rtx_equal_p (rld[i].in, value) if (! rld[i].in || ! rtx_equal_p (rld[i].in, value)
|| rld[i].out || out) || rld[i].out || out)
{ {
int j, time2; int time2;
switch (rld[i].when_needed) switch (rld[i].when_needed)
{ {
case RELOAD_FOR_OTHER_ADDRESS: case RELOAD_FOR_OTHER_ADDRESS:
...@@ -5411,6 +5415,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5411,6 +5415,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
break; break;
case RELOAD_FOR_INPUT: case RELOAD_FOR_INPUT:
time2 = rld[i].opnum * 4 + 4; time2 = rld[i].opnum * 4 + 4;
check_earlyclobber = 1;
break; break;
/* rld[i].opnum * 4 + 4 <= (MAX_RECOG_OPERAND - 1) * 4 + 4 /* rld[i].opnum * 4 + 4 <= (MAX_RECOG_OPERAND - 1) * 4 + 4
== MAX_RECOG_OPERAND * 4 */ == MAX_RECOG_OPERAND * 4 */
...@@ -5423,6 +5428,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5423,6 +5428,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
break; break;
case RELOAD_FOR_OPERAND_ADDRESS: case RELOAD_FOR_OPERAND_ADDRESS:
time2 = MAX_RECOG_OPERANDS * 4 + 2; time2 = MAX_RECOG_OPERANDS * 4 + 2;
check_earlyclobber = 1;
break; break;
case RELOAD_FOR_INSN: case RELOAD_FOR_INSN:
time2 = MAX_RECOG_OPERANDS * 4 + 3; time2 = MAX_RECOG_OPERANDS * 4 + 3;
...@@ -5452,9 +5458,8 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5452,9 +5458,8 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
{ {
time2 = MAX_RECOG_OPERANDS * 4 + 4; time2 = MAX_RECOG_OPERANDS * 4 + 4;
/* Earlyclobbered outputs must conflict with inputs. */ /* Earlyclobbered outputs must conflict with inputs. */
for (j = 0; j < n_earlyclobbers; j++) if (earlyclobber_operand_p (rld[i].out))
if (rld[i].out == reload_earlyclobbers[j]) time2 = MAX_RECOG_OPERANDS * 4 + 3;
time2 = MAX_RECOG_OPERANDS * 4 + 3;
break; break;
} }
...@@ -5478,6 +5483,11 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5478,6 +5483,11 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
} }
} }
} }
/* Earlyclobbered outputs must conflict with inputs. */
if (check_earlyclobber && out && earlyclobber_operand_p (out))
return 0;
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment