Commit b3411d7e by Daniel Berlin Committed by Daniel Berlin

2003-03-20 Daniel Berlin <dberlin@dberlin.org>

	Merge changes from new-regalloc-branch

	From Michael Matz  <matz@suse.de>
	* df.c (df_ref_record_1): Move init of loc to safe point.
	Only recurse on interesting things in parallels.
	Handle CLASS_CANNOT_CHANGE_MODE smarter.
	(df_uses_record): Ditto.

	* df.h (DF_REF_MEM_OK): New enum member, used to mark ref's which
	it's already okay to use memory operands in (IE doesn't require
	adding another insn or anything).

From-SVN: r64629
parent 05d482b9
2003-03-20 Daniel Berlin <dberlin@dberlin.org>
Merge changes from new-regalloc-branch
From Michael Matz <matz@suse.de>
* df.c (df_ref_record_1): Move init of loc to safe point.
Only recurse on interesting things in parallels.
Handle CLASS_CANNOT_CHANGE_MODE smarter.
(df_uses_record): Ditto.
* df.h (DF_REF_MEM_OK): New enum member, used to mark ref's which
it's already okay to use memory operands in (IE doesn't require
adding another insn or anything).
2003-03-20 Richard Henderson <rth@redhat.com> 2003-03-20 Richard Henderson <rth@redhat.com>
PR middle-end/6348 PR middle-end/6348
......
...@@ -906,10 +906,18 @@ df_def_record_1 (df, x, bb, insn) ...@@ -906,10 +906,18 @@ df_def_record_1 (df, x, bb, insn)
basic_block bb; basic_block bb;
rtx insn; rtx insn;
{ {
rtx *loc = &SET_DEST (x); rtx *loc;
rtx dst = *loc; rtx dst;
enum df_ref_flags flags = 0; enum df_ref_flags flags = 0;
/* We may recursivly call ourselves on EXPR_LIST when dealing with PARALLEL
construct. */
if (GET_CODE (x) == EXPR_LIST || GET_CODE (x) == CLOBBER)
loc = &XEXP (x, 0);
else
loc = &SET_DEST (x);
dst = *loc;
/* Some targets place small structures in registers for /* Some targets place small structures in registers for
return values of functions. */ return values of functions. */
if (GET_CODE (dst) == PARALLEL && GET_MODE (dst) == BLKmode) if (GET_CODE (dst) == PARALLEL && GET_MODE (dst) == BLKmode)
...@@ -917,12 +925,19 @@ df_def_record_1 (df, x, bb, insn) ...@@ -917,12 +925,19 @@ df_def_record_1 (df, x, bb, insn)
int i; int i;
for (i = XVECLEN (dst, 0) - 1; i >= 0; i--) for (i = XVECLEN (dst, 0) - 1; i >= 0; i--)
df_def_record_1 (df, XVECEXP (dst, 0, i), bb, insn); {
rtx temp = XVECEXP (dst, 0, i);
if (GET_CODE (temp) == EXPR_LIST || GET_CODE (temp) == CLOBBER
|| GET_CODE (temp) == SET)
df_def_record_1 (df, temp, bb, insn);
}
return; return;
} }
#ifdef CLASS_CANNOT_CHANGE_MODE #ifdef CLASS_CANNOT_CHANGE_MODE
if (GET_CODE (dst) == SUBREG) if (GET_CODE (dst) == SUBREG
&& CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (dst),
GET_MODE (SUBREG_REG (dst))))
flags |= DF_REF_MODE_CHANGE; flags |= DF_REF_MODE_CHANGE;
#endif #endif
...@@ -942,7 +957,9 @@ df_def_record_1 (df, x, bb, insn) ...@@ -942,7 +957,9 @@ df_def_record_1 (df, x, bb, insn)
dst = *loc; dst = *loc;
} }
#ifdef CLASS_CANNOT_CHANGE_MODE #ifdef CLASS_CANNOT_CHANGE_MODE
if (GET_CODE (dst) == SUBREG) if (GET_CODE (dst) == SUBREG
&& CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (dst),
GET_MODE (SUBREG_REG (dst))))
flags |= DF_REF_MODE_CHANGE; flags |= DF_REF_MODE_CHANGE;
#endif #endif
loc = &XEXP (dst, 0); loc = &XEXP (dst, 0);
...@@ -1042,6 +1059,8 @@ df_uses_record (df, loc, ref_type, bb, insn, flags) ...@@ -1042,6 +1059,8 @@ df_uses_record (df, loc, ref_type, bb, insn, flags)
return; return;
} }
#ifdef CLASS_CANNOT_CHANGE_MODE #ifdef CLASS_CANNOT_CHANGE_MODE
if (CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (x),
GET_MODE (SUBREG_REG (x))))
flags |= DF_REF_MODE_CHANGE; flags |= DF_REF_MODE_CHANGE;
#endif #endif
...@@ -1067,6 +1086,8 @@ df_uses_record (df, loc, ref_type, bb, insn, flags) ...@@ -1067,6 +1086,8 @@ df_uses_record (df, loc, ref_type, bb, insn, flags)
{ {
use_flags = DF_REF_READ_WRITE; use_flags = DF_REF_READ_WRITE;
#ifdef CLASS_CANNOT_CHANGE_MODE #ifdef CLASS_CANNOT_CHANGE_MODE
if (CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (dst),
GET_MODE (SUBREG_REG (dst))))
use_flags |= DF_REF_MODE_CHANGE; use_flags |= DF_REF_MODE_CHANGE;
#endif #endif
df_uses_record (df, &SUBREG_REG (dst), DF_REF_REG_USE, bb, df_uses_record (df, &SUBREG_REG (dst), DF_REF_REG_USE, bb,
...@@ -1091,6 +1112,8 @@ df_uses_record (df, loc, ref_type, bb, insn, flags) ...@@ -1091,6 +1112,8 @@ df_uses_record (df, loc, ref_type, bb, insn, flags)
abort (); abort ();
use_flags = DF_REF_READ_WRITE; use_flags = DF_REF_READ_WRITE;
#ifdef CLASS_CANNOT_CHANGE_MODE #ifdef CLASS_CANNOT_CHANGE_MODE
if (CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (dst),
GET_MODE (SUBREG_REG (dst))))
use_flags |= DF_REF_MODE_CHANGE; use_flags |= DF_REF_MODE_CHANGE;
#endif #endif
df_uses_record (df, &SUBREG_REG (dst), DF_REF_REG_USE, bb, df_uses_record (df, &SUBREG_REG (dst), DF_REF_REG_USE, bb,
...@@ -2142,6 +2165,7 @@ df_analyse_1 (df, blocks, flags, update) ...@@ -2142,6 +2165,7 @@ df_analyse_1 (df, blocks, flags, update)
{ {
df_reg_info_compute (df, df->all_blocks); df_reg_info_compute (df, df->all_blocks);
} }
free (df->dfs_order); free (df->dfs_order);
free (df->rc_order); free (df->rc_order);
free (df->rts_order); free (df->rts_order);
......
...@@ -63,7 +63,12 @@ enum df_ref_flags ...@@ -63,7 +63,12 @@ enum df_ref_flags
/* This flag is set, if we stripped the subreg from the reference. /* This flag is set, if we stripped the subreg from the reference.
In this case we must make conservative guesses, at what the In this case we must make conservative guesses, at what the
outer mode was. */ outer mode was. */
DF_REF_STRIPPED = 4 DF_REF_STRIPPED = 4,
/* This flag is set during register allocation if it's okay for
the reference's INSN to have one of its operands replaced with a
memory reference. */
DF_REF_MEM_OK = 8
}; };
......
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