flow.c (invalidate_mems_from_autoinc): Rewrite to use for_each_rtx.

* flow.c (invalidate_mems_from_autoinc): Rewrite to use for_each_rtx.
        Update prototype and callers.
        (propagate_one_insn): Stack pointer adjustments kill MEMs on
        the mem_set_list which reference the stack pointer, as do
        calls to constant functions as they may clobber outgoing
        argument space.

From-SVN: r53442
This commit is contained in:
Jeff Law 2002-05-13 22:15:57 -06:00 committed by Jeff Law
parent c297b7649c
commit fe4b3c7996
2 changed files with 33 additions and 20 deletions

View File

@ -23,6 +23,13 @@
2002-05-13 Jeffrey A Law (law@redhat.com)
* flow.c (invalidate_mems_from_autoinc): Rewrite to use for_each_rtx.
Update prototype and callers.
(propagate_one_insn): Stack pointer adjustments kill MEMs on
the mem_set_list which reference the stack pointer, as do
calls to constant functions as they may clobber outgoing
argument space.
* i386.c (ia32_multipass_dfa_lookahead): Prototype.
* i386.c (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Define.

View File

@ -338,8 +338,7 @@ void dump_flow_info PARAMS ((FILE *));
void debug_flow_info PARAMS ((void));
static void add_to_mem_set_list PARAMS ((struct propagate_block_info *,
rtx));
static void invalidate_mems_from_autoinc PARAMS ((struct propagate_block_info *,
rtx));
static int invalidate_mems_from_autoinc PARAMS ((rtx *, void *));
static void invalidate_mems_from_set PARAMS ((struct propagate_block_info *,
rtx));
static void clear_log_links PARAMS ((sbitmap));
@ -1715,8 +1714,9 @@ propagate_one_insn (pbi, insn)
/* We have an insn to pop a constant amount off the stack.
(Such insns use PLUS regardless of the direction of the stack,
and any insn to adjust the stack by a constant is always a pop.)
These insns, if not dead stores, have no effect on life. */
;
These insns, if not dead stores, have no effect on life, though
they do have an effect on the memory stores we are tracking. */
invalidate_mems_from_set (pbi, stack_pointer_rtx);
else
{
rtx note;
@ -1741,12 +1741,16 @@ propagate_one_insn (pbi, insn)
if (GET_CODE (PATTERN (insn)) == COND_EXEC)
cond = COND_EXEC_TEST (PATTERN (insn));
/* Non-constant calls clobber memory. */
/* Non-constant calls clobber memory, constant calls do not
clobber memory, though they may clobber outgoing arguments
on the stack. */
if (! CONST_OR_PURE_CALL_P (insn))
{
free_EXPR_LIST_list (&pbi->mem_set_list);
pbi->mem_set_list_len = 0;
}
else
invalidate_mems_from_set (pbi, stack_pointer_rtx);
/* There may be extra registers to be clobbered. */
for (note = CALL_INSN_FUNCTION_USAGE (insn);
@ -2415,15 +2419,21 @@ add_to_mem_set_list (pbi, mem)
Find any entries on the mem_set_list that need to be invalidated due
to an address change. */
static void
invalidate_mems_from_autoinc (pbi, insn)
struct propagate_block_info *pbi;
rtx insn;
static int
invalidate_mems_from_autoinc (px, data)
rtx *px;
void *data;
{
rtx note = REG_NOTES (insn);
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
if (REG_NOTE_KIND (note) == REG_INC)
invalidate_mems_from_set (pbi, XEXP (note, 0));
rtx x = *px;
struct propagate_block_info *pbi = data;
if (GET_RTX_CLASS (GET_CODE (x)) == 'a')
{
invalidate_mems_from_set (pbi, XEXP (x, 0));
return -1;
}
return 0;
}
/* EXP is a REG. Remove any dependent entries from pbi->mem_set_list. */
@ -2645,15 +2655,11 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
address modes. Then we may need to kill some entries on the
memory set list. */
if (insn && GET_CODE (reg) == MEM)
invalidate_mems_from_autoinc (pbi, insn);
for_each_rtx (&PATTERN (insn), invalidate_mems_from_autoinc, pbi);
if (GET_CODE (reg) == MEM && ! side_effects_p (reg)
/* ??? With more effort we could track conditional memory life. */
&& ! cond
/* There are no REG_INC notes for SP, so we can't assume we'll see
everything that invalidates it. To be safe, don't eliminate any
stores though SP; none of them should be redundant anyway. */
&& ! reg_mentioned_p (stack_pointer_rtx, reg))
&& ! cond)
add_to_mem_set_list (pbi, canon_rtx (reg));
}
@ -3780,7 +3786,7 @@ mark_used_regs (pbi, x, cond, insn)
address modes. Then we may need to kill some entries on the
memory set list. */
if (insn)
invalidate_mems_from_autoinc (pbi, insn);
for_each_rtx (&PATTERN (insn), invalidate_mems_from_autoinc, pbi);
}
#ifdef AUTO_INC_DEC