Commit 5a133afd by Jan Hubicka Committed by Jan Hubicka

df.c (df_ref_create, [...]): Kill BB argument.

	* df.c (df_ref_create, df_ref_record_1, df_ref_record): Kill BB argument.
	* df.h (struct ref): Kill B.
	(DF_REF_BB, DF_REF_BBNO): Use BLOCK_FOR_INSN.

	* basic-block.h (PROP_EQUAL_NOTES): New flag.
	* flow.c (propagate_one_insn): Use it.
	(mark_used_regs): Handle NIL.

From-SVN: r49220
parent 3d8dd3c0
Fri Jan 25 20:43:56 CET 2002 Jan Hubicka <jh@suse.cz>
* df.c (df_ref_create, df_ref_record_1, df_ref_record): Kill BB argument.
* df.h (struct ref): Kill B.
(DF_REF_BB, DF_REF_BBNO): Use BLOCK_FOR_INSN.
* basic-block.h (PROP_EQUAL_NOTES): New flag.
* flow.c (propagate_one_insn): Use it.
(mark_used_regs): Handle NIL.
2001-01-25 Geoffrey Keating <geoffk@redhat.com> 2001-01-25 Geoffrey Keating <geoffk@redhat.com>
* config/stormy16/stormy16.md (tablejump_pcrel): Use a MEM * config/stormy16/stormy16.md (tablejump_pcrel): Use a MEM
......
...@@ -560,6 +560,7 @@ enum update_life_extent ...@@ -560,6 +560,7 @@ enum update_life_extent
#define PROP_ALLOW_CFG_CHANGES 32 /* Allow the CFG to be changed #define PROP_ALLOW_CFG_CHANGES 32 /* Allow the CFG to be changed
by dead code removal. */ by dead code removal. */
#define PROP_AUTOINC 64 /* Create autoinc mem references. */ #define PROP_AUTOINC 64 /* Create autoinc mem references. */
#define PROP_EQUAL_NOTES 128 /* Take into account REG_EQUAL notes. */
#define PROP_FINAL 127 /* All of the above. */ #define PROP_FINAL 127 /* All of the above. */
#define CLEANUP_EXPENSIVE 1 /* Do relativly expensive optimizations #define CLEANUP_EXPENSIVE 1 /* Do relativly expensive optimizations
......
...@@ -226,13 +226,13 @@ static void df_refs_unlink PARAMS ((struct df *, bitmap)); ...@@ -226,13 +226,13 @@ static void df_refs_unlink PARAMS ((struct df *, bitmap));
#endif #endif
static struct ref *df_ref_create PARAMS((struct df *, static struct ref *df_ref_create PARAMS((struct df *,
rtx, rtx *, basic_block, rtx, rtx, rtx *, rtx,
enum df_ref_type, enum df_ref_flags)); enum df_ref_type, enum df_ref_flags));
static void df_ref_record_1 PARAMS((struct df *, rtx, rtx *, static void df_ref_record_1 PARAMS((struct df *, rtx, rtx *,
basic_block, rtx, enum df_ref_type, rtx, enum df_ref_type,
enum df_ref_flags)); enum df_ref_flags));
static void df_ref_record PARAMS((struct df *, rtx, rtx *, static void df_ref_record PARAMS((struct df *, rtx, rtx *,
basic_block bb, rtx, enum df_ref_type, rtx, enum df_ref_type,
enum df_ref_flags)); enum df_ref_flags));
static void df_def_record_1 PARAMS((struct df *, rtx, basic_block, rtx)); static void df_def_record_1 PARAMS((struct df *, rtx, basic_block, rtx));
static void df_defs_record PARAMS((struct df *, rtx, basic_block, rtx)); static void df_defs_record PARAMS((struct df *, rtx, basic_block, rtx));
...@@ -794,11 +794,10 @@ df_use_unlink (df, use) ...@@ -794,11 +794,10 @@ df_use_unlink (df, use)
/* 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. */ LOC within INSN of BB. */
static struct ref * static struct ref *
df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags) df_ref_create (df, reg, loc, insn, ref_type, ref_flags)
struct df *df; struct df *df;
rtx reg; rtx reg;
rtx *loc; rtx *loc;
basic_block bb;
rtx insn; rtx insn;
enum df_ref_type ref_type; enum df_ref_type ref_type;
enum df_ref_flags ref_flags; enum df_ref_flags ref_flags;
...@@ -810,7 +809,6 @@ df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags) ...@@ -810,7 +809,6 @@ df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags)
sizeof (*this_ref)); sizeof (*this_ref));
DF_REF_REG (this_ref) = reg; DF_REF_REG (this_ref) = reg;
DF_REF_LOC (this_ref) = loc; DF_REF_LOC (this_ref) = loc;
DF_REF_BB (this_ref) = bb;
DF_REF_INSN (this_ref) = insn; DF_REF_INSN (this_ref) = insn;
DF_REF_CHAIN (this_ref) = 0; DF_REF_CHAIN (this_ref) = 0;
DF_REF_TYPE (this_ref) = ref_type; DF_REF_TYPE (this_ref) = ref_type;
...@@ -848,27 +846,25 @@ df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags) ...@@ -848,27 +846,25 @@ df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags)
/* Create a new reference of type DF_REF_TYPE for a single register REG, /* Create a new reference of type DF_REF_TYPE for a single register REG,
used inside the LOC rtx of INSN. */ used inside the LOC rtx of INSN. */
static void static void
df_ref_record_1 (df, reg, loc, bb, insn, ref_type, ref_flags) df_ref_record_1 (df, reg, loc, insn, ref_type, ref_flags)
struct df *df; struct df *df;
rtx reg; rtx reg;
rtx *loc; rtx *loc;
basic_block bb;
rtx insn; rtx insn;
enum df_ref_type ref_type; enum df_ref_type ref_type;
enum df_ref_flags ref_flags; enum df_ref_flags ref_flags;
{ {
df_ref_create (df, reg, loc, bb, insn, ref_type, ref_flags); df_ref_create (df, reg, loc, insn, ref_type, ref_flags);
} }
/* 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. */
static void static void
df_ref_record (df, reg, loc, bb, insn, ref_type, ref_flags) df_ref_record (df, reg, loc, insn, ref_type, ref_flags)
struct df *df; struct df *df;
rtx reg; rtx reg;
rtx *loc; rtx *loc;
basic_block bb;
rtx insn; rtx insn;
enum df_ref_type ref_type; enum df_ref_type ref_type;
enum df_ref_flags ref_flags; enum df_ref_flags ref_flags;
...@@ -910,11 +906,11 @@ df_ref_record (df, reg, loc, bb, insn, ref_type, ref_flags) ...@@ -910,11 +906,11 @@ df_ref_record (df, reg, loc, bb, insn, ref_type, ref_flags)
for (i = regno; i < endregno; i++) for (i = regno; i < endregno; i++)
df_ref_record_1 (df, gen_rtx_REG (reg_raw_mode[i], i), df_ref_record_1 (df, gen_rtx_REG (reg_raw_mode[i], i),
loc, bb, insn, ref_type, ref_flags); loc, insn, ref_type, ref_flags);
} }
else else
{ {
df_ref_record_1 (df, reg, loc, bb, insn, ref_type, ref_flags); df_ref_record_1 (df, reg, loc, insn, ref_type, ref_flags);
} }
} }
...@@ -978,7 +974,7 @@ df_def_record_1 (df, x, bb, insn) ...@@ -978,7 +974,7 @@ df_def_record_1 (df, x, bb, insn)
if (GET_CODE (dst) == REG if (GET_CODE (dst) == REG
|| (GET_CODE (dst) == SUBREG && GET_CODE (SUBREG_REG (dst)) == REG)) || (GET_CODE (dst) == SUBREG && GET_CODE (SUBREG_REG (dst)) == REG))
df_ref_record (df, dst, loc, bb, insn, DF_REF_REG_DEF, flags); df_ref_record (df, dst, loc, insn, DF_REF_REG_DEF, flags);
} }
...@@ -1070,7 +1066,7 @@ df_uses_record (df, loc, ref_type, bb, insn, flags) ...@@ -1070,7 +1066,7 @@ df_uses_record (df, loc, ref_type, bb, insn, flags)
case REG: case REG:
/* See a register (or subreg) other than being set. */ /* See a register (or subreg) other than being set. */
df_ref_record (df, x, loc, bb, insn, ref_type, flags); df_ref_record (df, x, loc, insn, ref_type, flags);
return; return;
case SET: case SET:
...@@ -1161,7 +1157,7 @@ df_uses_record (df, loc, ref_type, bb, insn, flags) ...@@ -1161,7 +1157,7 @@ df_uses_record (df, loc, ref_type, bb, insn, flags)
case PRE_MODIFY: case PRE_MODIFY:
case POST_MODIFY: case POST_MODIFY:
/* Catch the def of the register being modified. */ /* Catch the def of the register being modified. */
df_ref_record (df, XEXP (x, 0), &XEXP (x, 0), bb, insn, DF_REF_REG_DEF, DF_REF_READ_WRITE); df_ref_record (df, XEXP (x, 0), &XEXP (x, 0), insn, DF_REF_REG_DEF, DF_REF_READ_WRITE);
/* ... Fall through to handle uses ... */ /* ... Fall through to handle uses ... */
......
...@@ -57,7 +57,6 @@ enum df_ref_flags ...@@ -57,7 +57,6 @@ enum df_ref_flags
struct ref struct ref
{ {
rtx reg; /* The register referenced. */ rtx reg; /* The register referenced. */
basic_block bb; /* BB containing ref. */
rtx insn; /* Insn containing ref. */ rtx insn; /* Insn containing ref. */
rtx *loc; /* Loc is the location of the reg. */ rtx *loc; /* Loc is the location of the reg. */
struct df_link *chain; /* Head of def-use or use-def chain. */ struct df_link *chain; /* Head of def-use or use-def chain. */
...@@ -175,8 +174,8 @@ struct df_map ...@@ -175,8 +174,8 @@ struct df_map
#define DF_REF_REG(REF) ((REF)->reg) #define DF_REF_REG(REF) ((REF)->reg)
#define DF_REF_LOC(REF) ((REF)->loc) #define DF_REF_LOC(REF) ((REF)->loc)
#endif #endif
#define DF_REF_BB(REF) ((REF)->bb) #define DF_REF_BB(REF) (BLOCK_FOR_INSN ((REF)->insn))
#define DF_REF_BBNO(REF) ((REF)->bb->index) #define DF_REF_BBNO(REF) (BLOCK_FOR_INSN ((REF)->insn)->index)
#define DF_REF_INSN(REF) ((REF)->insn) #define DF_REF_INSN(REF) ((REF)->insn)
#define DF_REF_INSN_UID(REF) (INSN_UID ((REF)->insn)) #define DF_REF_INSN_UID(REF) (INSN_UID ((REF)->insn))
#define DF_REF_TYPE(REF) ((REF)->type) #define DF_REF_TYPE(REF) ((REF)->type)
......
...@@ -1633,6 +1633,7 @@ propagate_one_insn (pbi, insn) ...@@ -1633,6 +1633,7 @@ propagate_one_insn (pbi, insn)
; ;
else else
{ {
rtx note;
/* Any regs live at the time of a call instruction must not go /* Any regs live at the time of a call instruction must not go
in a register clobbered by calls. Find all regs now live and in a register clobbered by calls. Find all regs now live and
record this for them. */ record this for them. */
...@@ -1688,6 +1689,10 @@ propagate_one_insn (pbi, insn) ...@@ -1688,6 +1689,10 @@ propagate_one_insn (pbi, insn)
/* Record uses. */ /* Record uses. */
if (! insn_is_dead) if (! insn_is_dead)
mark_used_regs (pbi, PATTERN (insn), NULL_RTX, insn); mark_used_regs (pbi, PATTERN (insn), NULL_RTX, insn);
if ((flags & PROP_EQUAL_NOTES)
&& ((note = find_reg_note (insn, REG_EQUAL, NULL_RTX))
|| (note = find_reg_note (insn, REG_EQUIV, NULL_RTX))))
mark_used_regs (pbi, XEXP (note, 0), NULL_RTX, insn);
/* Sometimes we may have inserted something before INSN (such as a move) /* Sometimes we may have inserted something before INSN (such as a move)
when we make an auto-inc. So ensure we will scan those insns. */ when we make an auto-inc. So ensure we will scan those insns. */
...@@ -3616,6 +3621,8 @@ mark_used_regs (pbi, x, cond, insn) ...@@ -3616,6 +3621,8 @@ mark_used_regs (pbi, x, cond, insn)
int flags = pbi->flags; int flags = pbi->flags;
retry: retry:
if (!x)
return;
code = GET_CODE (x); code = GET_CODE (x);
switch (code) switch (code)
{ {
......
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