Commit 8c266ffa by Steven Bosscher

df-problems.c (df_kill_notes): Split up in two functions.

	* df-problems.c (df_kill_notes): Split up in two functions.
	(df_remove_dead_and_unused_notes): New function, first half of
	df_kill notes to remove all REG_DEAD and REG_UNUSED notes.
	(df_remove_dead_eq_notes): New function, second half of df_kill_notes
	to remove REG_EQUAL and REG_EQUIV notes referring to dead registers.
	(df_note_bb_compute): Call df_remove_dead_and_unused_notes instead
	of df_kill_notes.  Call df_remove_dead_eq_notes after processing insn.

	* web.c (web): Re-add DF_RD_PRUNE_DEAD_DEFS;

From-SVN: r192526
parent d564b816
2012-10-16 Steven Bosscher <steven@gcc.gnu.org>
* df-problems.c (df_kill_notes): Split up in two functions.
(df_remove_dead_and_unused_notes): New function, first half of
df_kill notes to remove all REG_DEAD and REG_UNUSED notes.
(df_remove_dead_eq_notes): New function, second half of df_kill_notes
to remove REG_EQUAL and REG_EQUIV notes referring to dead registers.
(df_note_bb_compute): Call df_remove_dead_and_unused_notes instead
of df_kill_notes. Call df_remove_dead_eq_notes after processing insn.
* web.c (web): Re-add DF_RD_PRUNE_DEAD_DEFS;
2012-10-16 Ian Lance Taylor <iant@google.com> 2012-10-16 Ian Lance Taylor <iant@google.com>
* doc/extend.texi (Return Address): Change * doc/extend.texi (Return Address): Change
...@@ -2822,13 +2822,10 @@ df_ignore_stack_reg (int regno ATTRIBUTE_UNUSED) ...@@ -2822,13 +2822,10 @@ df_ignore_stack_reg (int regno ATTRIBUTE_UNUSED)
#endif #endif
/* Remove all of the REG_DEAD or REG_UNUSED notes from INSN and add /* Remove all of the REG_DEAD or REG_UNUSED notes from INSN. */
them to OLD_DEAD_NOTES and OLD_UNUSED_NOTES. Remove also
REG_EQUAL/REG_EQUIV notes referring to dead pseudos using LIVE
as the bitmap of currently live registers. */
static void static void
df_kill_notes (rtx insn, bitmap live) df_remove_dead_and_unused_notes (rtx insn)
{ {
rtx *pprev = &REG_NOTES (insn); rtx *pprev = &REG_NOTES (insn);
rtx link = *pprev; rtx link = *pprev;
...@@ -2873,6 +2870,27 @@ df_kill_notes (rtx insn, bitmap live) ...@@ -2873,6 +2870,27 @@ df_kill_notes (rtx insn, bitmap live)
} }
break; break;
default:
pprev = &XEXP (link, 1);
link = *pprev;
break;
}
}
}
/* Remove REG_EQUAL/REG_EQUIV notes referring to dead pseudos using LIVE
as the bitmap of currently live registers. */
static void
df_remove_dead_eq_notes (rtx insn, bitmap live)
{
rtx *pprev = &REG_NOTES (insn);
rtx link = *pprev;
while (link)
{
switch (REG_NOTE_KIND (link))
{
case REG_EQUAL: case REG_EQUAL:
case REG_EQUIV: case REG_EQUIV:
{ {
...@@ -2913,6 +2931,7 @@ df_kill_notes (rtx insn, bitmap live) ...@@ -2913,6 +2931,7 @@ df_kill_notes (rtx insn, bitmap live)
} }
break; break;
} }
default: default:
pprev = &XEXP (link, 1); pprev = &XEXP (link, 1);
link = *pprev; link = *pprev;
...@@ -2921,7 +2940,6 @@ df_kill_notes (rtx insn, bitmap live) ...@@ -2921,7 +2940,6 @@ df_kill_notes (rtx insn, bitmap live)
} }
} }
/* Set a NOTE_TYPE note for REG in INSN. */ /* Set a NOTE_TYPE note for REG in INSN. */
static inline void static inline void
...@@ -3195,7 +3213,7 @@ df_note_bb_compute (unsigned int bb_index, ...@@ -3195,7 +3213,7 @@ df_note_bb_compute (unsigned int bb_index,
debug_insn = DEBUG_INSN_P (insn); debug_insn = DEBUG_INSN_P (insn);
bitmap_clear (do_not_gen); bitmap_clear (do_not_gen);
df_kill_notes (insn, live); df_remove_dead_and_unused_notes (insn);
/* Process the defs. */ /* Process the defs. */
if (CALL_P (insn)) if (CALL_P (insn))
...@@ -3336,6 +3354,8 @@ df_note_bb_compute (unsigned int bb_index, ...@@ -3336,6 +3354,8 @@ df_note_bb_compute (unsigned int bb_index,
} }
} }
df_remove_dead_eq_notes (insn, live);
if (debug_insn == -1) if (debug_insn == -1)
{ {
/* ??? We could probably do better here, replacing dead /* ??? We could probably do better here, replacing dead
......
...@@ -336,8 +336,7 @@ web_main (void) ...@@ -336,8 +336,7 @@ web_main (void)
rtx insn; rtx insn;
df_set_flags (DF_NO_HARD_REGS + DF_EQ_NOTES); df_set_flags (DF_NO_HARD_REGS + DF_EQ_NOTES);
/* We can not RD_PRUNE_DEAD_DEFS, because we care about REG_EQUAL df_set_flags (DF_RD_PRUNE_DEAD_DEFS);
notes. */
df_chain_add_problem (DF_UD_CHAIN); df_chain_add_problem (DF_UD_CHAIN);
df_analyze (); df_analyze ();
df_set_flags (DF_DEFER_INSN_RESCAN); df_set_flags (DF_DEFER_INSN_RESCAN);
......
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