Commit 502ef838 by Paolo Bonzini Committed by Paolo Bonzini

df.h (enum df_ref_class): Remove DF_REF_EXTRACT.

2010-09-04  Paolo Bonzini  <bonzini@gnu.org>

	* df.h (enum df_ref_class): Remove DF_REF_EXTRACT.
	(struct df_extract_ref): Remove.
	(union df_ref_d): Remove extract_ref member.
	(df_ref_create): Remove last three arguments.
	(DF_REF_LOC): Remove DF_REF_EXTRACT case.
	* df-scan.c (df_ref_record): Remove last three arguments, do not
	pass them to df_ref_create_structure.
	(df_uses_record): Remove first and last three arguments.  Replace
	first argument with DF_REF_REGULAR, adjust calls to remove the
	width, offset and mode.  Always call recursively on the second
	and third argument of ZERO_EXTRACT and SIGN_EXTRACT.
	(df_ref_create_structure): Remove first argument.
	(struct df_scan_problem_data): Remove ref_extract_pool.
	(df_scan_free_internal): Do not free it.
	(df_scan_alloc): Do not allocate it.
	(df_ref_create): Remove last three arguments, do not pass them to
	df_ref_create_structure.
	(df_free_ref): Remove DF_REF_EXTRACT case.
	(df_notes_rescan): Adjust call to df_uses_record.
	(df_ref_equal_p, df_ref_compare, df_ref_create_structure):
	Remove DF_REF_EXTRACT case.
	(df_def_record_1): Do not special case class for a ZERO_EXTRACT lhs.
	Adjust calls to df_ref_record, using DF_REF_REGULAR for all REG
	and SUBREG definitions.
	(df_get_conditional_uses): Remove references to width/offset/mode,
	adjust call to df_ref_create_structure.
	(df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect,
	df_entry_block_defs_collect, df_exit_block_uses_collect): Adjust
	calls to df_uses_record and df_ref_record.
	* fwprop.c (update_df): Remove references to width/offset/mode,
	adjust call to df_ref_create.

From-SVN: r163854
parent f37b4faa
2010-09-04 Paolo Bonzini <bonzini@gnu.org>
* df.h (enum df_ref_class): Remove DF_REF_EXTRACT.
(struct df_extract_ref): Remove.
(union df_ref_d): Remove extract_ref member.
(df_ref_create): Remove last three arguments.
(DF_REF_LOC): Remove DF_REF_EXTRACT case.
* df-scan.c (df_ref_record): Remove last three arguments, do not
pass them to df_ref_create_structure.
(df_uses_record): Remove first and last three arguments. Replace
first argument with DF_REF_REGULAR, adjust calls to remove the
width, offset and mode. Always call recursively on the second
and third argument of ZERO_EXTRACT and SIGN_EXTRACT.
(df_ref_create_structure): Remove first argument.
(struct df_scan_problem_data): Remove ref_extract_pool.
(df_scan_free_internal): Do not free it.
(df_scan_alloc): Do not allocate it.
(df_ref_create): Remove last three arguments, do not pass them to
df_ref_create_structure.
(df_free_ref): Remove DF_REF_EXTRACT case.
(df_notes_rescan): Adjust call to df_uses_record.
(df_ref_equal_p, df_ref_compare, df_ref_create_structure):
Remove DF_REF_EXTRACT case.
(df_def_record_1): Do not special case class for a ZERO_EXTRACT lhs.
Adjust calls to df_ref_record, using DF_REF_REGULAR for all REG
and SUBREG definitions.
(df_get_conditional_uses): Remove references to width/offset/mode,
adjust call to df_ref_create_structure.
(df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect,
df_entry_block_defs_collect, df_exit_block_uses_collect): Adjust
calls to df_uses_record and df_ref_record.
* fwprop.c (update_df): Remove references to width/offset/mode,
adjust call to df_ref_create.
2010-09-03 Jan Hubicka <jh@suse.cz> 2010-09-03 Jan Hubicka <jh@suse.cz>
* ipa.c (build_cdtor): Take VECtor as argument; fix array walk. * ipa.c (build_cdtor): Take VECtor as argument; fix array walk.
......
...@@ -110,26 +110,22 @@ static struct df_mw_hardreg * df_null_mw_rec[1]; ...@@ -110,26 +110,22 @@ static struct df_mw_hardreg * df_null_mw_rec[1];
static void df_ref_record (enum df_ref_class, struct df_collection_rec *, static void df_ref_record (enum df_ref_class, struct df_collection_rec *,
rtx, rtx *, rtx, rtx *,
basic_block, struct df_insn_info *, basic_block, struct df_insn_info *,
enum df_ref_type, int ref_flags, enum df_ref_type, int ref_flags);
int, int, enum machine_mode);
static void df_def_record_1 (struct df_collection_rec *, rtx, static void df_def_record_1 (struct df_collection_rec *, rtx,
basic_block, struct df_insn_info *, basic_block, struct df_insn_info *,
int ref_flags); int ref_flags);
static void df_defs_record (struct df_collection_rec *, rtx, static void df_defs_record (struct df_collection_rec *, rtx,
basic_block, struct df_insn_info *, basic_block, struct df_insn_info *,
int ref_flags); int ref_flags);
static void df_uses_record (enum df_ref_class, struct df_collection_rec *, static void df_uses_record (struct df_collection_rec *,
rtx *, enum df_ref_type, rtx *, enum df_ref_type,
basic_block, struct df_insn_info *, basic_block, struct df_insn_info *,
int ref_flags, int ref_flags);
int, int, enum machine_mode);
static df_ref df_ref_create_structure (enum df_ref_class, static df_ref df_ref_create_structure (enum df_ref_class,
struct df_collection_rec *, rtx, rtx *, struct df_collection_rec *, rtx, rtx *,
basic_block, struct df_insn_info *, basic_block, struct df_insn_info *,
enum df_ref_type, int ref_flags, enum df_ref_type, int ref_flags);
int, int, enum machine_mode);
static void df_insn_refs_collect (struct df_collection_rec*, static void df_insn_refs_collect (struct df_collection_rec*,
basic_block, struct df_insn_info *); basic_block, struct df_insn_info *);
static void df_canonize_collection_rec (struct df_collection_rec *); static void df_canonize_collection_rec (struct df_collection_rec *);
...@@ -182,7 +178,6 @@ struct df_scan_problem_data ...@@ -182,7 +178,6 @@ struct df_scan_problem_data
alloc_pool ref_base_pool; alloc_pool ref_base_pool;
alloc_pool ref_artificial_pool; alloc_pool ref_artificial_pool;
alloc_pool ref_regular_pool; alloc_pool ref_regular_pool;
alloc_pool ref_extract_pool;
alloc_pool insn_pool; alloc_pool insn_pool;
alloc_pool reg_pool; alloc_pool reg_pool;
alloc_pool mw_reg_pool; alloc_pool mw_reg_pool;
...@@ -269,7 +264,6 @@ df_scan_free_internal (void) ...@@ -269,7 +264,6 @@ df_scan_free_internal (void)
free_alloc_pool (problem_data->ref_base_pool); free_alloc_pool (problem_data->ref_base_pool);
free_alloc_pool (problem_data->ref_artificial_pool); free_alloc_pool (problem_data->ref_artificial_pool);
free_alloc_pool (problem_data->ref_regular_pool); free_alloc_pool (problem_data->ref_regular_pool);
free_alloc_pool (problem_data->ref_extract_pool);
free_alloc_pool (problem_data->insn_pool); free_alloc_pool (problem_data->insn_pool);
free_alloc_pool (problem_data->reg_pool); free_alloc_pool (problem_data->reg_pool);
free_alloc_pool (problem_data->mw_reg_pool); free_alloc_pool (problem_data->mw_reg_pool);
...@@ -344,9 +338,6 @@ df_scan_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) ...@@ -344,9 +338,6 @@ df_scan_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
problem_data->ref_regular_pool problem_data->ref_regular_pool
= create_alloc_pool ("df_scan ref regular", = create_alloc_pool ("df_scan ref regular",
sizeof (struct df_regular_ref), block_size); sizeof (struct df_regular_ref), block_size);
problem_data->ref_extract_pool
= create_alloc_pool ("df_scan ref extract",
sizeof (struct df_extract_ref), block_size);
problem_data->insn_pool problem_data->insn_pool
= create_alloc_pool ("df_scan insn", = create_alloc_pool ("df_scan insn",
sizeof (struct df_insn_info), block_size); sizeof (struct df_insn_info), block_size);
...@@ -689,19 +680,13 @@ df_scan_blocks (void) ...@@ -689,19 +680,13 @@ df_scan_blocks (void)
/* Create a new ref of type DF_REF_TYPE for register REG at address /* Create a new ref of type DF_REF_TYPE for register REG at address
LOC within INSN of BB. This function is only used externally. LOC within INSN of BB. This function is only used externally. */
If the REF_FLAGS field contain DF_REF_SIGN_EXTRACT or
DF_REF_ZERO_EXTRACT. WIDTH, OFFSET and MODE are used to access the
fields if they were constants. Otherwise they should be -1 if
those flags were set. */
df_ref df_ref
df_ref_create (rtx reg, rtx *loc, rtx insn, df_ref_create (rtx reg, rtx *loc, rtx insn,
basic_block bb, basic_block bb,
enum df_ref_type ref_type, enum df_ref_type ref_type,
int ref_flags, int ref_flags)
int width, int offset, enum machine_mode mode)
{ {
df_ref ref; df_ref ref;
struct df_reg_info **reg_info; struct df_reg_info **reg_info;
...@@ -717,15 +702,12 @@ df_ref_create (rtx reg, rtx *loc, rtx insn, ...@@ -717,15 +702,12 @@ df_ref_create (rtx reg, rtx *loc, rtx insn,
/* You cannot hack artificial refs. */ /* You cannot hack artificial refs. */
gcc_assert (insn); gcc_assert (insn);
if (width != -1 || offset != -1) if (loc)
cl = DF_REF_EXTRACT;
else if (loc)
cl = DF_REF_REGULAR; cl = DF_REF_REGULAR;
else else
cl = DF_REF_BASE; cl = DF_REF_BASE;
ref = df_ref_create_structure (cl, NULL, reg, loc, bb, DF_INSN_INFO_GET (insn), ref = df_ref_create_structure (cl, NULL, reg, loc, bb, DF_INSN_INFO_GET (insn),
ref_type, ref_flags, ref_type, ref_flags);
width, offset, mode);
if (DF_REF_REG_DEF_P (ref)) if (DF_REF_REG_DEF_P (ref))
{ {
...@@ -843,10 +825,6 @@ df_free_ref (df_ref ref) ...@@ -843,10 +825,6 @@ df_free_ref (df_ref ref)
case DF_REF_REGULAR: case DF_REF_REGULAR:
pool_free (problem_data->ref_regular_pool, ref); pool_free (problem_data->ref_regular_pool, ref);
break; break;
case DF_REF_EXTRACT:
pool_free (problem_data->ref_extract_pool, ref);
break;
} }
} }
...@@ -2011,7 +1989,7 @@ df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df, ...@@ -2011,7 +1989,7 @@ df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df,
while (the_ref) while (the_ref)
{ {
if ((!DF_REF_IS_ARTIFICIAL (the_ref)) if ((!DF_REF_IS_ARTIFICIAL (the_ref))
&& (DF_REF_LOC (the_ref)) && DF_REF_LOC (the_ref)
&& (*DF_REF_LOC (the_ref) == loc)) && (*DF_REF_LOC (the_ref) == loc))
{ {
df_ref next_ref = DF_REF_NEXT_REG (the_ref); df_ref next_ref = DF_REF_NEXT_REG (the_ref);
...@@ -2214,9 +2192,9 @@ df_notes_rescan (rtx insn) ...@@ -2214,9 +2192,9 @@ df_notes_rescan (rtx insn)
{ {
case REG_EQUIV: case REG_EQUIV:
case REG_EQUAL: case REG_EQUAL:
df_uses_record (DF_REF_REGULAR, &collection_rec, df_uses_record (&collection_rec,
&XEXP (note, 0), DF_REF_REG_USE, &XEXP (note, 0), DF_REF_REG_USE,
bb, insn_info, DF_REF_IN_NOTE, -1, -1, VOIDmode); bb, insn_info, DF_REF_IN_NOTE);
default: default:
break; break;
} }
...@@ -2310,13 +2288,6 @@ df_ref_equal_p (df_ref ref1, df_ref ref2) ...@@ -2310,13 +2288,6 @@ df_ref_equal_p (df_ref ref1, df_ref ref2)
case DF_REF_BASE: case DF_REF_BASE:
return true; return true;
case DF_REF_EXTRACT:
if ((DF_REF_EXTRACT_OFFSET (ref1) != DF_REF_EXTRACT_OFFSET (ref2))
|| (DF_REF_EXTRACT_WIDTH (ref1) != DF_REF_EXTRACT_WIDTH (ref2))
|| (DF_REF_EXTRACT_MODE (ref1) != DF_REF_EXTRACT_MODE (ref2)))
return false;
/* fallthru. */
case DF_REF_REGULAR: case DF_REF_REGULAR:
return DF_REF_LOC (ref1) == DF_REF_LOC (ref2); return DF_REF_LOC (ref1) == DF_REF_LOC (ref2);
...@@ -2371,17 +2342,6 @@ df_ref_compare (const void *r1, const void *r2) ...@@ -2371,17 +2342,6 @@ df_ref_compare (const void *r1, const void *r2)
return 1; return 1;
} }
/* The classes are the same at this point so it is safe to only look
at ref1. */
if (DF_REF_CLASS (ref1) == DF_REF_EXTRACT)
{
if (DF_REF_EXTRACT_OFFSET (ref1) != DF_REF_EXTRACT_OFFSET (ref2))
return DF_REF_EXTRACT_OFFSET (ref1) - DF_REF_EXTRACT_OFFSET (ref2);
if (DF_REF_EXTRACT_WIDTH (ref1) != DF_REF_EXTRACT_WIDTH (ref2))
return DF_REF_EXTRACT_WIDTH (ref1) - DF_REF_EXTRACT_WIDTH (ref2);
if (DF_REF_EXTRACT_MODE (ref1) != DF_REF_EXTRACT_MODE (ref2))
return DF_REF_EXTRACT_MODE (ref1) - DF_REF_EXTRACT_MODE (ref2);
}
return (int)DF_REF_ORDER (ref1) - (int)DF_REF_ORDER (ref2); return (int)DF_REF_ORDER (ref1) - (int)DF_REF_ORDER (ref2);
} }
...@@ -2762,12 +2722,7 @@ df_refs_add_to_chains (struct df_collection_rec *collection_rec, ...@@ -2762,12 +2722,7 @@ df_refs_add_to_chains (struct df_collection_rec *collection_rec,
} }
/* Allocate a ref and initialize its fields. /* Allocate a ref and initialize its fields. */
If the REF_FLAGS field contain DF_REF_SIGN_EXTRACT or
DF_REF_ZERO_EXTRACT. WIDTH, OFFSET and MODE are used to access the fields
if they were constants. Otherwise they should be -1 if those flags
were set. */
static df_ref static df_ref
df_ref_create_structure (enum df_ref_class cl, df_ref_create_structure (enum df_ref_class cl,
...@@ -2775,8 +2730,7 @@ df_ref_create_structure (enum df_ref_class cl, ...@@ -2775,8 +2730,7 @@ df_ref_create_structure (enum df_ref_class cl,
rtx reg, rtx *loc, rtx reg, rtx *loc,
basic_block bb, struct df_insn_info *info, basic_block bb, struct df_insn_info *info,
enum df_ref_type ref_type, enum df_ref_type ref_type,
int ref_flags, int ref_flags)
int width, int offset, enum machine_mode mode)
{ {
df_ref this_ref = NULL; df_ref this_ref = NULL;
int regno = REGNO (GET_CODE (reg) == SUBREG ? SUBREG_REG (reg) : reg); int regno = REGNO (GET_CODE (reg) == SUBREG ? SUBREG_REG (reg) : reg);
...@@ -2801,15 +2755,6 @@ df_ref_create_structure (enum df_ref_class cl, ...@@ -2801,15 +2755,6 @@ df_ref_create_structure (enum df_ref_class cl,
this_ref->regular_ref.loc = loc; this_ref->regular_ref.loc = loc;
gcc_checking_assert (loc); gcc_checking_assert (loc);
break; break;
case DF_REF_EXTRACT:
this_ref = (df_ref) pool_alloc (problem_data->ref_extract_pool);
DF_REF_EXTRACT_WIDTH (this_ref) = width;
DF_REF_EXTRACT_OFFSET (this_ref) = offset;
DF_REF_EXTRACT_MODE (this_ref) = mode;
this_ref->regular_ref.loc = loc;
gcc_checking_assert (loc);
break;
} }
DF_REF_CLASS (this_ref) = cl; DF_REF_CLASS (this_ref) = cl;
...@@ -2859,12 +2804,7 @@ df_ref_create_structure (enum df_ref_class cl, ...@@ -2859,12 +2804,7 @@ df_ref_create_structure (enum df_ref_class cl,
/* Create new references of type DF_REF_TYPE for each part of register REG /* Create new references of type DF_REF_TYPE for each part of register REG
at address LOC within INSN of BB. at address LOC within INSN of BB. */
If the REF_FLAGS field contain DF_REF_SIGN_EXTRACT or
DF_REF_ZERO_EXTRACT. WIDTH, OFFSET and MODE are used to access the
fields if they were constants. Otherwise they should be -1 if
those flags were set. */
static void static void
...@@ -2873,8 +2813,7 @@ df_ref_record (enum df_ref_class cl, ...@@ -2873,8 +2813,7 @@ df_ref_record (enum df_ref_class cl,
rtx reg, rtx *loc, rtx reg, rtx *loc,
basic_block bb, struct df_insn_info *insn_info, basic_block bb, struct df_insn_info *insn_info,
enum df_ref_type ref_type, enum df_ref_type ref_type,
int ref_flags, int ref_flags)
int width, int offset, enum machine_mode mode)
{ {
unsigned int regno; unsigned int regno;
...@@ -2924,8 +2863,7 @@ df_ref_record (enum df_ref_class cl, ...@@ -2924,8 +2863,7 @@ df_ref_record (enum df_ref_class cl,
for (i = regno; i < endregno; i++) for (i = regno; i < endregno; i++)
{ {
ref = df_ref_create_structure (cl, collection_rec, regno_reg_rtx[i], loc, ref = df_ref_create_structure (cl, collection_rec, regno_reg_rtx[i], loc,
bb, insn_info, ref_type, ref_flags, bb, insn_info, ref_type, ref_flags);
width, offset, mode);
gcc_assert (ORIGINAL_REGNO (DF_REF_REG (ref)) == i); gcc_assert (ORIGINAL_REGNO (DF_REF_REG (ref)) == i);
} }
...@@ -2933,7 +2871,7 @@ df_ref_record (enum df_ref_class cl, ...@@ -2933,7 +2871,7 @@ df_ref_record (enum df_ref_class cl,
else else
{ {
df_ref_create_structure (cl, collection_rec, reg, loc, bb, insn_info, df_ref_create_structure (cl, collection_rec, reg, loc, bb, insn_info,
ref_type, ref_flags, width, offset, mode); ref_type, ref_flags);
} }
} }
...@@ -2967,10 +2905,6 @@ df_def_record_1 (struct df_collection_rec *collection_rec, ...@@ -2967,10 +2905,6 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
{ {
rtx *loc; rtx *loc;
rtx dst; rtx dst;
int offset = -1;
int width = -1;
enum machine_mode mode = VOIDmode;
enum df_ref_class cl = DF_REF_REGULAR;
/* We may recursively call ourselves on EXPR_LIST when dealing with PARALLEL /* We may recursively call ourselves on EXPR_LIST when dealing with PARALLEL
construct. */ construct. */
...@@ -3010,15 +2944,6 @@ df_def_record_1 (struct df_collection_rec *collection_rec, ...@@ -3010,15 +2944,6 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
{ {
flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL | DF_REF_ZERO_EXTRACT; flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL | DF_REF_ZERO_EXTRACT;
if (CONST_INT_P (XEXP (dst, 1))
&& CONST_INT_P (XEXP (dst, 2)))
{
width = INTVAL (XEXP (dst, 1));
offset = INTVAL (XEXP (dst, 2));
mode = GET_MODE (dst);
cl = DF_REF_EXTRACT;
}
loc = &XEXP (dst, 0); loc = &XEXP (dst, 0);
dst = *loc; dst = *loc;
} }
...@@ -3026,16 +2951,14 @@ df_def_record_1 (struct df_collection_rec *collection_rec, ...@@ -3026,16 +2951,14 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
/* At this point if we do not have a reg or a subreg, just return. */ /* At this point if we do not have a reg or a subreg, just return. */
if (REG_P (dst)) if (REG_P (dst))
{ {
df_ref_record (cl, collection_rec, df_ref_record (DF_REF_REGULAR, collection_rec,
dst, loc, bb, insn_info, DF_REF_REG_DEF, flags, dst, loc, bb, insn_info, DF_REF_REG_DEF, flags);
width, offset, mode);
/* We want to keep sp alive everywhere - by making all /* We want to keep sp alive everywhere - by making all
writes to sp also use of sp. */ writes to sp also use of sp. */
if (REGNO (dst) == STACK_POINTER_REGNUM) if (REGNO (dst) == STACK_POINTER_REGNUM)
df_ref_record (DF_REF_BASE, collection_rec, df_ref_record (DF_REF_BASE, collection_rec,
dst, NULL, bb, insn_info, DF_REF_REG_USE, flags, dst, NULL, bb, insn_info, DF_REF_REG_USE, flags);
width, offset, mode);
} }
else if (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst))) else if (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst)))
{ {
...@@ -3044,9 +2967,8 @@ df_def_record_1 (struct df_collection_rec *collection_rec, ...@@ -3044,9 +2967,8 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
flags |= DF_REF_SUBREG; flags |= DF_REF_SUBREG;
df_ref_record (cl, collection_rec, df_ref_record (DF_REF_REGULAR, collection_rec,
dst, loc, bb, insn_info, DF_REF_REG_DEF, flags, dst, loc, bb, insn_info, DF_REF_REG_DEF, flags);
width, offset, mode);
} }
} }
...@@ -3083,19 +3005,13 @@ df_defs_record (struct df_collection_rec *collection_rec, ...@@ -3083,19 +3005,13 @@ df_defs_record (struct df_collection_rec *collection_rec,
} }
/* Process all the registers used in the rtx at address LOC. /* Process all the registers used in the rtx at address LOC. */
If the REF_FLAGS field contain DF_REF_SIGN_EXTRACT or
DF_REF_ZERO_EXTRACT. WIDTH, OFFSET and MODE are used to access the
fields if they were constants. Otherwise they should be -1 if
those flags were set. */
static void static void
df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec, df_uses_record (struct df_collection_rec *collection_rec,
rtx *loc, enum df_ref_type ref_type, rtx *loc, enum df_ref_type ref_type,
basic_block bb, struct df_insn_info *insn_info, basic_block bb, struct df_insn_info *insn_info,
int flags, int flags)
int width, int offset, enum machine_mode mode)
{ {
RTX_CODE code; RTX_CODE code;
rtx x; rtx x;
...@@ -3124,20 +3040,19 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec, ...@@ -3124,20 +3040,19 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
/* If we are clobbering a MEM, mark any registers inside the address /* If we are clobbering a MEM, mark any registers inside the address
as being used. */ as being used. */
if (MEM_P (XEXP (x, 0))) if (MEM_P (XEXP (x, 0)))
df_uses_record (cl, collection_rec, df_uses_record (collection_rec,
&XEXP (XEXP (x, 0), 0), &XEXP (XEXP (x, 0), 0),
DF_REF_REG_MEM_STORE, DF_REF_REG_MEM_STORE,
bb, insn_info, bb, insn_info,
flags, width, offset, mode); flags);
/* If we're clobbering a REG then we have a def so ignore. */ /* If we're clobbering a REG then we have a def so ignore. */
return; return;
case MEM: case MEM:
df_uses_record (cl, collection_rec, df_uses_record (collection_rec,
&XEXP (x, 0), DF_REF_REG_MEM_LOAD, &XEXP (x, 0), DF_REF_REG_MEM_LOAD,
bb, insn_info, flags & DF_REF_IN_NOTE, bb, insn_info, flags & DF_REF_IN_NOTE);
width, offset, mode);
return; return;
case SUBREG: case SUBREG:
...@@ -3147,42 +3062,36 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec, ...@@ -3147,42 +3062,36 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
if (!REG_P (SUBREG_REG (x))) if (!REG_P (SUBREG_REG (x)))
{ {
loc = &SUBREG_REG (x); loc = &SUBREG_REG (x);
df_uses_record (cl, collection_rec, loc, ref_type, bb, insn_info, flags, df_uses_record (collection_rec, loc, ref_type, bb, insn_info, flags);
width, offset, mode);
return; return;
} }
/* ... Fall through ... */ /* ... Fall through ... */
case REG: case REG:
df_ref_record (cl, collection_rec, df_ref_record (DF_REF_REGULAR, collection_rec,
x, loc, bb, insn_info, x, loc, bb, insn_info,
ref_type, flags, ref_type, flags);
width, offset, mode);
return; return;
case SIGN_EXTRACT: case SIGN_EXTRACT:
case ZERO_EXTRACT: case ZERO_EXTRACT:
{ {
/* If the parameters to the zero or sign extract are df_uses_record (collection_rec,
constants, strip them off and recurse, otherwise there is &XEXP (x, 1), ref_type, bb, insn_info, flags);
no information that we can gain from this operation. */ df_uses_record (collection_rec,
if (CONST_INT_P (XEXP (x, 1)) &XEXP (x, 2), ref_type, bb, insn_info, flags);
&& CONST_INT_P (XEXP (x, 2)))
{ /* If the parameters to the zero or sign extract are
width = INTVAL (XEXP (x, 1)); constants, strip them off and recurse, otherwise there is
offset = INTVAL (XEXP (x, 2)); no information that we can gain from this operation. */
mode = GET_MODE (x); if (code == ZERO_EXTRACT)
flags |= DF_REF_ZERO_EXTRACT;
if (code == ZERO_EXTRACT) else
flags |= DF_REF_ZERO_EXTRACT; flags |= DF_REF_SIGN_EXTRACT;
else
flags |= DF_REF_SIGN_EXTRACT; df_uses_record (collection_rec,
&XEXP (x, 0), ref_type, bb, insn_info, flags);
df_uses_record (DF_REF_EXTRACT, collection_rec, return;
&XEXP (x, 0), ref_type, bb, insn_info, flags,
width, offset, mode);
return;
}
} }
break; break;
...@@ -3190,19 +3099,17 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec, ...@@ -3190,19 +3099,17 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
{ {
rtx dst = SET_DEST (x); rtx dst = SET_DEST (x);
gcc_assert (!(flags & DF_REF_IN_NOTE)); gcc_assert (!(flags & DF_REF_IN_NOTE));
df_uses_record (cl, collection_rec, df_uses_record (collection_rec,
&SET_SRC (x), DF_REF_REG_USE, bb, insn_info, flags, &SET_SRC (x), DF_REF_REG_USE, bb, insn_info, flags);
width, offset, mode);
switch (GET_CODE (dst)) switch (GET_CODE (dst))
{ {
case SUBREG: case SUBREG:
if (df_read_modify_subreg_p (dst)) if (df_read_modify_subreg_p (dst))
{ {
df_uses_record (cl, collection_rec, &SUBREG_REG (dst), df_uses_record (collection_rec, &SUBREG_REG (dst),
DF_REF_REG_USE, bb, insn_info, DF_REF_REG_USE, bb, insn_info,
flags | DF_REF_READ_WRITE | DF_REF_SUBREG, flags | DF_REF_READ_WRITE | DF_REF_SUBREG);
width, offset, mode);
break; break;
} }
/* Fall through. */ /* Fall through. */
...@@ -3213,9 +3120,8 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec, ...@@ -3213,9 +3120,8 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
case CC0: case CC0:
break; break;
case MEM: case MEM:
df_uses_record (cl, collection_rec, &XEXP (dst, 0), df_uses_record (collection_rec, &XEXP (dst, 0),
DF_REF_REG_MEM_STORE, bb, insn_info, flags, DF_REF_REG_MEM_STORE, bb, insn_info, flags);
width, offset, mode);
break; break;
case STRICT_LOW_PART: case STRICT_LOW_PART:
{ {
...@@ -3223,53 +3129,26 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec, ...@@ -3223,53 +3129,26 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
/* A strict_low_part uses the whole REG and not just the /* A strict_low_part uses the whole REG and not just the
SUBREG. */ SUBREG. */
dst = XEXP (dst, 0); dst = XEXP (dst, 0);
df_uses_record (cl, collection_rec, df_uses_record (collection_rec,
(GET_CODE (dst) == SUBREG) ? &SUBREG_REG (dst) : temp, (GET_CODE (dst) == SUBREG) ? &SUBREG_REG (dst) : temp,
DF_REF_REG_USE, bb, insn_info, DF_REF_REG_USE, bb, insn_info,
DF_REF_READ_WRITE | DF_REF_STRICT_LOW_PART, DF_REF_READ_WRITE | DF_REF_STRICT_LOW_PART);
width, offset, mode);
} }
break; break;
case ZERO_EXTRACT: case ZERO_EXTRACT:
{ {
if (CONST_INT_P (XEXP (dst, 1)) df_uses_record (collection_rec, &XEXP (dst, 1),
&& CONST_INT_P (XEXP (dst, 2))) DF_REF_REG_USE, bb, insn_info, flags);
{ df_uses_record (collection_rec, &XEXP (dst, 2),
width = INTVAL (XEXP (dst, 1)); DF_REF_REG_USE, bb, insn_info, flags);
offset = INTVAL (XEXP (dst, 2)); if (GET_CODE (XEXP (dst,0)) == MEM)
mode = GET_MODE (dst); df_uses_record (collection_rec, &XEXP (dst, 0),
if (GET_CODE (XEXP (dst,0)) == MEM) DF_REF_REG_USE, bb, insn_info,
{ flags);
/* Handle the case of zero_extract(mem(...)) in the set dest. else
This special case is allowed only if the mem is a single byte and df_uses_record (collection_rec, &XEXP (dst, 0),
is useful to set a bitfield in memory. */ DF_REF_REG_USE, bb, insn_info,
df_uses_record (DF_REF_EXTRACT, collection_rec, &XEXP (XEXP (dst,0), 0), DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT);
DF_REF_REG_MEM_STORE, bb, insn_info,
DF_REF_ZERO_EXTRACT,
width, offset, mode);
}
else
{
df_uses_record (DF_REF_EXTRACT, collection_rec, &XEXP (dst, 0),
DF_REF_REG_USE, bb, insn_info,
DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT,
width, offset, mode);
}
}
else
{
df_uses_record (cl, collection_rec, &XEXP (dst, 1),
DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
df_uses_record (cl, collection_rec, &XEXP (dst, 2),
DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
df_uses_record (cl, collection_rec, &XEXP (dst, 0),
DF_REF_REG_USE, bb, insn_info,
DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT,
width, offset, mode);
}
} }
break; break;
...@@ -3318,19 +3197,17 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec, ...@@ -3318,19 +3197,17 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
int j; int j;
for (j = 0; j < ASM_OPERANDS_INPUT_LENGTH (x); j++) for (j = 0; j < ASM_OPERANDS_INPUT_LENGTH (x); j++)
df_uses_record (cl, collection_rec, &ASM_OPERANDS_INPUT (x, j), df_uses_record (collection_rec, &ASM_OPERANDS_INPUT (x, j),
DF_REF_REG_USE, bb, insn_info, flags, DF_REF_REG_USE, bb, insn_info, flags);
width, offset, mode);
return; return;
} }
break; break;
} }
case VAR_LOCATION: case VAR_LOCATION:
df_uses_record (cl, collection_rec, df_uses_record (collection_rec,
&PAT_VAR_LOCATION_LOC (x), &PAT_VAR_LOCATION_LOC (x),
DF_REF_REG_USE, bb, insn_info, DF_REF_REG_USE, bb, insn_info, flags);
flags, width, offset, mode);
return; return;
case PRE_DEC: case PRE_DEC:
...@@ -3341,11 +3218,10 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec, ...@@ -3341,11 +3218,10 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
case POST_MODIFY: case POST_MODIFY:
gcc_assert (!DEBUG_INSN_P (insn_info->insn)); gcc_assert (!DEBUG_INSN_P (insn_info->insn));
/* Catch the def of the register being modified. */ /* Catch the def of the register being modified. */
df_ref_record (cl, collection_rec, XEXP (x, 0), &XEXP (x, 0), df_ref_record (DF_REF_REGULAR, collection_rec, XEXP (x, 0), &XEXP (x, 0),
bb, insn_info, bb, insn_info,
DF_REF_REG_DEF, DF_REF_REG_DEF,
flags | DF_REF_READ_WRITE | DF_REF_PRE_POST_MODIFY, flags | DF_REF_READ_WRITE | DF_REF_PRE_POST_MODIFY);
width, offset, mode);
/* ... Fall through to handle uses ... */ /* ... Fall through to handle uses ... */
...@@ -3368,18 +3244,16 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec, ...@@ -3368,18 +3244,16 @@ df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
loc = &XEXP (x, 0); loc = &XEXP (x, 0);
goto retry; goto retry;
} }
df_uses_record (cl, collection_rec, &XEXP (x, i), ref_type, df_uses_record (collection_rec, &XEXP (x, i), ref_type,
bb, insn_info, flags, bb, insn_info, flags);
width, offset, mode);
} }
else if (fmt[i] == 'E') else if (fmt[i] == 'E')
{ {
int j; int j;
for (j = 0; j < XVECLEN (x, i); j++) for (j = 0; j < XVECLEN (x, i); j++)
df_uses_record (cl, collection_rec, df_uses_record (collection_rec,
&XVECEXP (x, i, j), ref_type, &XVECEXP (x, i, j), ref_type,
bb, insn_info, flags, bb, insn_info, flags);
width, offset, mode);
} }
} }
} }
...@@ -3400,23 +3274,12 @@ df_get_conditional_uses (struct df_collection_rec *collection_rec) ...@@ -3400,23 +3274,12 @@ df_get_conditional_uses (struct df_collection_rec *collection_rec)
{ {
if (DF_REF_FLAGS_IS_SET (ref, DF_REF_CONDITIONAL)) if (DF_REF_FLAGS_IS_SET (ref, DF_REF_CONDITIONAL))
{ {
int width = -1;
int offset = -1;
enum machine_mode mode = VOIDmode;
df_ref use; df_ref use;
if (DF_REF_FLAGS_IS_SET (ref, DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT))
{
width = DF_REF_EXTRACT_WIDTH (ref);
offset = DF_REF_EXTRACT_OFFSET (ref);
mode = DF_REF_EXTRACT_MODE (ref);
}
use = df_ref_create_structure (DF_REF_CLASS (ref), collection_rec, DF_REF_REG (ref), use = df_ref_create_structure (DF_REF_CLASS (ref), collection_rec, DF_REF_REG (ref),
DF_REF_LOC (ref), DF_REF_BB (ref), DF_REF_LOC (ref), DF_REF_BB (ref),
DF_REF_INSN_INFO (ref), DF_REF_REG_USE, DF_REF_INSN_INFO (ref), DF_REF_REG_USE,
DF_REF_FLAGS (ref) & ~DF_REF_CONDITIONAL, DF_REF_FLAGS (ref) & ~DF_REF_CONDITIONAL);
width, offset, mode);
DF_REF_REGNO (use) = DF_REF_REGNO (ref); DF_REF_REGNO (use) = DF_REF_REGNO (ref);
} }
} }
...@@ -3453,9 +3316,8 @@ df_get_call_refs (struct df_collection_rec * collection_rec, ...@@ -3453,9 +3316,8 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
note = XEXP (note, 1)) note = XEXP (note, 1))
{ {
if (GET_CODE (XEXP (note, 0)) == USE) if (GET_CODE (XEXP (note, 0)) == USE)
df_uses_record (DF_REF_REGULAR, collection_rec, &XEXP (XEXP (note, 0), 0), df_uses_record (collection_rec, &XEXP (XEXP (note, 0), 0),
DF_REF_REG_USE, bb, insn_info, flags, -1, -1, DF_REF_REG_USE, bb, insn_info, flags);
VOIDmode);
else if (GET_CODE (XEXP (note, 0)) == CLOBBER) else if (GET_CODE (XEXP (note, 0)) == CLOBBER)
{ {
if (REG_P (XEXP (XEXP (note, 0), 0))) if (REG_P (XEXP (XEXP (note, 0), 0)))
...@@ -3466,17 +3328,15 @@ df_get_call_refs (struct df_collection_rec * collection_rec, ...@@ -3466,17 +3328,15 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
insn_info, flags); insn_info, flags);
} }
else else
df_uses_record (DF_REF_REGULAR, collection_rec, &XEXP (note, 0), df_uses_record (collection_rec, &XEXP (note, 0),
DF_REF_REG_USE, bb, insn_info, flags, -1, -1, DF_REF_REG_USE, bb, insn_info, flags);
VOIDmode);
} }
} }
/* The stack ptr is used (honorarily) by a CALL insn. */ /* The stack ptr is used (honorarily) by a CALL insn. */
df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[STACK_POINTER_REGNUM], df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[STACK_POINTER_REGNUM],
NULL, bb, insn_info, DF_REF_REG_USE, NULL, bb, insn_info, DF_REF_REG_USE,
DF_REF_CALL_STACK_USAGE | flags, DF_REF_CALL_STACK_USAGE | flags);
-1, -1, VOIDmode);
/* Calls may also reference any of the global registers, /* Calls may also reference any of the global registers,
so they are recorded as used. */ so they are recorded as used. */
...@@ -3484,11 +3344,9 @@ df_get_call_refs (struct df_collection_rec * collection_rec, ...@@ -3484,11 +3344,9 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
if (global_regs[i]) if (global_regs[i])
{ {
df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i], df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i],
NULL, bb, insn_info, DF_REF_REG_USE, flags, -1, -1, NULL, bb, insn_info, DF_REF_REG_USE, flags);
VOIDmode);
df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i], df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i],
NULL, bb, insn_info, DF_REF_REG_DEF, flags, -1, -1, NULL, bb, insn_info, DF_REF_REG_DEF, flags);
VOIDmode);
} }
is_sibling_call = SIBLING_CALL_P (insn_info->insn); is_sibling_call = SIBLING_CALL_P (insn_info->insn);
...@@ -3502,8 +3360,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec, ...@@ -3502,8 +3360,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
crtl->return_rtx, NULL))) crtl->return_rtx, NULL)))
df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[ui], df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[ui],
NULL, bb, insn_info, DF_REF_REG_DEF, NULL, bb, insn_info, DF_REF_REG_DEF,
DF_REF_MAY_CLOBBER | flags, DF_REF_MAY_CLOBBER | flags);
-1, -1, VOIDmode);
} }
bitmap_clear (&defs_generated); bitmap_clear (&defs_generated);
...@@ -3539,21 +3396,21 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec, ...@@ -3539,21 +3396,21 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec,
{ {
case REG_EQUIV: case REG_EQUIV:
case REG_EQUAL: case REG_EQUAL:
df_uses_record (DF_REF_REGULAR, collection_rec, df_uses_record (collection_rec,
&XEXP (note, 0), DF_REF_REG_USE, &XEXP (note, 0), DF_REF_REG_USE,
bb, insn_info, DF_REF_IN_NOTE, -1, -1, VOIDmode); bb, insn_info, DF_REF_IN_NOTE);
break; break;
case REG_NON_LOCAL_GOTO: case REG_NON_LOCAL_GOTO:
/* The frame ptr is used by a non-local goto. */ /* The frame ptr is used by a non-local goto. */
df_ref_record (DF_REF_BASE, collection_rec, df_ref_record (DF_REF_BASE, collection_rec,
regno_reg_rtx[FRAME_POINTER_REGNUM], regno_reg_rtx[FRAME_POINTER_REGNUM],
NULL, bb, insn_info, NULL, bb, insn_info,
DF_REF_REG_USE, 0, -1, -1, VOIDmode); DF_REF_REG_USE, 0);
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
df_ref_record (DF_REF_BASE, collection_rec, df_ref_record (DF_REF_BASE, collection_rec,
regno_reg_rtx[HARD_FRAME_POINTER_REGNUM], regno_reg_rtx[HARD_FRAME_POINTER_REGNUM],
NULL, bb, insn_info, NULL, bb, insn_info,
DF_REF_REG_USE, 0, -1, -1, VOIDmode); DF_REF_REG_USE, 0);
#endif #endif
break; break;
default: default:
...@@ -3566,9 +3423,8 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec, ...@@ -3566,9 +3423,8 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec,
(is_cond_exec) ? DF_REF_CONDITIONAL : 0); (is_cond_exec) ? DF_REF_CONDITIONAL : 0);
/* Record the register uses. */ /* Record the register uses. */
df_uses_record (DF_REF_REGULAR, collection_rec, df_uses_record (collection_rec,
&PATTERN (insn_info->insn), DF_REF_REG_USE, bb, insn_info, 0, &PATTERN (insn_info->insn), DF_REF_REG_USE, bb, insn_info, 0);
-1, -1, VOIDmode);
/* DF_REF_CONDITIONAL needs corresponding USES. */ /* DF_REF_CONDITIONAL needs corresponding USES. */
if (is_cond_exec) if (is_cond_exec)
...@@ -3639,8 +3495,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb) ...@@ -3639,8 +3495,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
if (regno == INVALID_REGNUM) if (regno == INVALID_REGNUM)
break; break;
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[regno], NULL, df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[regno], NULL,
bb, NULL, DF_REF_REG_DEF, DF_REF_AT_TOP, -1, -1, bb, NULL, DF_REF_REG_DEF, DF_REF_AT_TOP);
VOIDmode);
} }
} }
#endif #endif
...@@ -3649,7 +3504,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb) ...@@ -3649,7 +3504,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
non-local goto. */ non-local goto. */
if (bb->flags & BB_NON_LOCAL_GOTO_TARGET) if (bb->flags & BB_NON_LOCAL_GOTO_TARGET)
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, hard_frame_pointer_rtx, NULL, df_ref_record (DF_REF_ARTIFICIAL, collection_rec, hard_frame_pointer_rtx, NULL,
bb, NULL, DF_REF_REG_DEF, DF_REF_AT_TOP, -1, -1, VOIDmode); bb, NULL, DF_REF_REG_DEF, DF_REF_AT_TOP);
/* Add the artificial uses. */ /* Add the artificial uses. */
if (bb->index >= NUM_FIXED_BLOCKS) if (bb->index >= NUM_FIXED_BLOCKS)
...@@ -3663,7 +3518,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb) ...@@ -3663,7 +3518,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
EXECUTE_IF_SET_IN_BITMAP (au, 0, regno, bi) EXECUTE_IF_SET_IN_BITMAP (au, 0, regno, bi)
{ {
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[regno], NULL, df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[regno], NULL,
bb, NULL, DF_REF_REG_USE, 0, -1, -1, VOIDmode); bb, NULL, DF_REF_REG_USE, 0);
} }
} }
...@@ -3939,8 +3794,7 @@ df_entry_block_defs_collect (struct df_collection_rec *collection_rec, ...@@ -3939,8 +3794,7 @@ df_entry_block_defs_collect (struct df_collection_rec *collection_rec,
EXECUTE_IF_SET_IN_BITMAP (entry_block_defs, 0, i, bi) EXECUTE_IF_SET_IN_BITMAP (entry_block_defs, 0, i, bi)
{ {
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL, df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL,
ENTRY_BLOCK_PTR, NULL, DF_REF_REG_DEF, 0, -1, -1, ENTRY_BLOCK_PTR, NULL, DF_REF_REG_DEF, 0);
VOIDmode);
} }
df_canonize_collection_rec (collection_rec); df_canonize_collection_rec (collection_rec);
...@@ -4102,7 +3956,7 @@ df_exit_block_uses_collect (struct df_collection_rec *collection_rec, bitmap exi ...@@ -4102,7 +3956,7 @@ df_exit_block_uses_collect (struct df_collection_rec *collection_rec, bitmap exi
EXECUTE_IF_SET_IN_BITMAP (exit_block_uses, 0, i, bi) EXECUTE_IF_SET_IN_BITMAP (exit_block_uses, 0, i, bi)
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL, df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL,
EXIT_BLOCK_PTR, NULL, DF_REF_REG_USE, 0, -1, -1, VOIDmode); EXIT_BLOCK_PTR, NULL, DF_REF_REG_USE, 0);
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* It is deliberate that this is not put in the exit block uses but /* It is deliberate that this is not put in the exit block uses but
...@@ -4112,7 +3966,7 @@ df_exit_block_uses_collect (struct df_collection_rec *collection_rec, bitmap exi ...@@ -4112,7 +3966,7 @@ df_exit_block_uses_collect (struct df_collection_rec *collection_rec, bitmap exi
&& bb_has_eh_pred (EXIT_BLOCK_PTR) && bb_has_eh_pred (EXIT_BLOCK_PTR)
&& fixed_regs[ARG_POINTER_REGNUM]) && fixed_regs[ARG_POINTER_REGNUM])
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[ARG_POINTER_REGNUM], NULL, df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[ARG_POINTER_REGNUM], NULL,
EXIT_BLOCK_PTR, NULL, DF_REF_REG_USE, 0, -1, -1, VOIDmode); EXIT_BLOCK_PTR, NULL, DF_REF_REG_USE, 0);
#endif #endif
df_canonize_collection_rec (collection_rec); df_canonize_collection_rec (collection_rec);
......
...@@ -67,7 +67,7 @@ enum df_flow_dir ...@@ -67,7 +67,7 @@ enum df_flow_dir
}; };
/* Descriminator for the various df_ref types. */ /* Descriminator for the various df_ref types. */
enum df_ref_class {DF_REF_BASE, DF_REF_ARTIFICIAL, DF_REF_REGULAR, DF_REF_EXTRACT}; enum df_ref_class {DF_REF_BASE, DF_REF_ARTIFICIAL, DF_REF_REGULAR};
/* The first of these us a set of a registers. The remaining three /* The first of these us a set of a registers. The remaining three
are all uses of a register (the mem_load and mem_store relate to are all uses of a register (the mem_load and mem_store relate to
...@@ -402,26 +402,12 @@ struct df_regular_ref ...@@ -402,26 +402,12 @@ struct df_regular_ref
rtx *loc; rtx *loc;
}; };
/* A df_ref_extract is just a df_ref with a width and offset field at
the end of it. It is used to hold this information if the ref was
wrapped by a SIGN_EXTRACT or a ZERO_EXTRACT and to pass this info
to passes that wish to process partial regs precisely. */
struct df_extract_ref
{
struct df_regular_ref base;
int width;
int offset;
enum machine_mode mode;
};
/* Union of the different kinds of defs/uses placeholders. */ /* Union of the different kinds of defs/uses placeholders. */
union df_ref_d union df_ref_d
{ {
struct df_base_ref base; struct df_base_ref base;
struct df_regular_ref regular_ref; struct df_regular_ref regular_ref;
struct df_artificial_ref artificial_ref; struct df_artificial_ref artificial_ref;
struct df_extract_ref extract_ref;
}; };
typedef union df_ref_d *df_ref; typedef union df_ref_d *df_ref;
...@@ -645,7 +631,7 @@ struct df_d ...@@ -645,7 +631,7 @@ struct df_d
#define DF_REF_REAL_LOC(REF) (GET_CODE (*((REF)->regular_ref.loc)) == SUBREG \ #define DF_REF_REAL_LOC(REF) (GET_CODE (*((REF)->regular_ref.loc)) == SUBREG \
? &SUBREG_REG (*((REF)->regular_ref.loc)) : ((REF)->regular_ref.loc)) ? &SUBREG_REG (*((REF)->regular_ref.loc)) : ((REF)->regular_ref.loc))
#define DF_REF_REG(REF) ((REF)->base.reg) #define DF_REF_REG(REF) ((REF)->base.reg)
#define DF_REF_LOC(REF) ((DF_REF_CLASS(REF) == DF_REF_REGULAR || DF_REF_CLASS(REF) == DF_REF_EXTRACT) ? \ #define DF_REF_LOC(REF) (DF_REF_CLASS(REF) == DF_REF_REGULAR ? \
(REF)->regular_ref.loc : NULL) (REF)->regular_ref.loc : NULL)
#define DF_REF_BB(REF) (DF_REF_IS_ARTIFICIAL(REF) ? \ #define DF_REF_BB(REF) (DF_REF_IS_ARTIFICIAL(REF) ? \
(REF)->artificial_ref.bb : BLOCK_FOR_INSN (DF_REF_INSN(REF))) (REF)->artificial_ref.bb : BLOCK_FOR_INSN (DF_REF_INSN(REF)))
...@@ -994,8 +980,7 @@ extern void df_grow_reg_info (void); ...@@ -994,8 +980,7 @@ extern void df_grow_reg_info (void);
extern void df_grow_insn_info (void); extern void df_grow_insn_info (void);
extern void df_scan_blocks (void); extern void df_scan_blocks (void);
extern df_ref df_ref_create (rtx, rtx *, rtx,basic_block, extern df_ref df_ref_create (rtx, rtx *, rtx,basic_block,
enum df_ref_type, int ref_flags, enum df_ref_type, int ref_flags);
int, int, enum machine_mode);
extern void df_ref_remove (df_ref); extern void df_ref_remove (df_ref);
extern struct df_insn_info * df_insn_create_insn_record (rtx); extern struct df_insn_info * df_insn_create_insn_record (rtx);
extern void df_insn_delete (basic_block, unsigned int); extern void df_insn_delete (basic_block, unsigned int);
......
...@@ -908,28 +908,17 @@ update_df (rtx insn, rtx *loc, df_ref *use_rec, enum df_ref_type type, ...@@ -908,28 +908,17 @@ update_df (rtx insn, rtx *loc, df_ref *use_rec, enum df_ref_type type,
{ {
df_ref use = *use_rec; df_ref use = *use_rec;
df_ref orig_use = use, new_use; df_ref orig_use = use, new_use;
int width = -1;
int offset = -1;
enum machine_mode mode = VOIDmode;
rtx *new_loc = find_occurrence (loc, DF_REF_REG (orig_use)); rtx *new_loc = find_occurrence (loc, DF_REF_REG (orig_use));
use_rec++; use_rec++;
if (!new_loc) if (!new_loc)
continue; continue;
if (DF_REF_FLAGS_IS_SET (orig_use, DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT))
{
width = DF_REF_EXTRACT_WIDTH (orig_use);
offset = DF_REF_EXTRACT_OFFSET (orig_use);
mode = DF_REF_EXTRACT_MODE (orig_use);
}
/* Add a new insn use. Use the original type, because it says if the /* Add a new insn use. Use the original type, because it says if the
use was within a MEM. */ use was within a MEM. */
new_use = df_ref_create (DF_REF_REG (orig_use), new_loc, new_use = df_ref_create (DF_REF_REG (orig_use), new_loc,
insn, BLOCK_FOR_INSN (insn), insn, BLOCK_FOR_INSN (insn),
type, DF_REF_FLAGS (orig_use) | new_flags, type, DF_REF_FLAGS (orig_use) | new_flags);
width, offset, mode);
/* Set up the use-def chain. */ /* Set up the use-def chain. */
gcc_assert (DF_REF_ID (new_use) == (int) VEC_length (df_ref, use_def_ref)); gcc_assert (DF_REF_ID (new_use) == (int) VEC_length (df_ref, use_def_ref));
......
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