Commit 0875baa0 by Richard Henderson Committed by Richard Henderson

flow.c (struct propagate_block_info): Add mem_set_list_len.

        * flow.c (struct propagate_block_info): Add mem_set_list_len.
        (MAX_MEM_SET_LIST_LEN): New.
        (propagate_one_insn): Update mem_set_list_len.
        (invalidate_mems_from_autoinc): Likewise.
        (invalidate_mems_from_set): Likewise.
        (mark_used_regs): Likewise.
        (init_propagate_block_info): Likewise.  Stop collecting memories
        when we reach MAX_MEM_SET_LIST_LEN.
        (mark_set_1): Likewise.

From-SVN: r39065
parent c55fa4d6
2001-01-16 Richard Henderson <rth@redhat.com> 2001-01-16 Richard Henderson <rth@redhat.com>
* flow.c (struct propagate_block_info): Add mem_set_list_len.
(MAX_MEM_SET_LIST_LEN): New.
(propagate_one_insn): Update mem_set_list_len.
(invalidate_mems_from_autoinc): Likewise.
(invalidate_mems_from_set): Likewise.
(mark_used_regs): Likewise.
(init_propagate_block_info): Likewise. Stop collecting memories
when we reach MAX_MEM_SET_LIST_LEN.
(mark_set_1): Likewise.
2001-01-16 Richard Henderson <rth@redhat.com>
* unroll.c (precondition_loop_p): Fail if no iteration * unroll.c (precondition_loop_p): Fail if no iteration
variable found. variable found.
......
...@@ -316,6 +316,9 @@ struct propagate_block_info ...@@ -316,6 +316,9 @@ struct propagate_block_info
regset reg_cond_reg; regset reg_cond_reg;
#endif #endif
/* The length of mem_set_list. */
int mem_set_list_len;
/* Non-zero if the value of CC0 is live. */ /* Non-zero if the value of CC0 is live. */
int cc0_live; int cc0_live;
...@@ -323,6 +326,10 @@ struct propagate_block_info ...@@ -323,6 +326,10 @@ struct propagate_block_info
int flags; int flags;
}; };
/* Maximum length of pbi->mem_set_list before we start dropping
new elements on the floor. */
#define MAX_MEM_SET_LIST_LEN 100
/* Store the data structures necessary for depth-first search. */ /* Store the data structures necessary for depth-first search. */
struct depth_first_search_dsS { struct depth_first_search_dsS {
/* stack for backtracking during the algorithm */ /* stack for backtracking during the algorithm */
...@@ -3877,7 +3884,10 @@ propagate_one_insn (pbi, insn) ...@@ -3877,7 +3884,10 @@ propagate_one_insn (pbi, insn)
/* Non-constant calls clobber memory. */ /* Non-constant calls clobber memory. */
if (! CONST_CALL_P (insn)) if (! CONST_CALL_P (insn))
free_EXPR_LIST_list (&pbi->mem_set_list); {
free_EXPR_LIST_list (&pbi->mem_set_list);
pbi->mem_set_list_len = 0;
}
/* There may be extra registers to be clobbered. */ /* There may be extra registers to be clobbered. */
for (note = CALL_INSN_FUNCTION_USAGE (insn); for (note = CALL_INSN_FUNCTION_USAGE (insn);
...@@ -3967,6 +3977,7 @@ init_propagate_block_info (bb, live, local_set, cond_local_set, flags) ...@@ -3967,6 +3977,7 @@ init_propagate_block_info (bb, live, local_set, cond_local_set, flags)
pbi->bb = bb; pbi->bb = bb;
pbi->reg_live = live; pbi->reg_live = live;
pbi->mem_set_list = NULL_RTX; pbi->mem_set_list = NULL_RTX;
pbi->mem_set_list_len = 0;
pbi->local_set = local_set; pbi->local_set = local_set;
pbi->cond_local_set = cond_local_set; pbi->cond_local_set = cond_local_set;
pbi->cc0_live = 0; pbi->cc0_live = 0;
...@@ -4111,6 +4122,8 @@ init_propagate_block_info (bb, live, local_set, cond_local_set, flags) ...@@ -4111,6 +4122,8 @@ init_propagate_block_info (bb, live, local_set, cond_local_set, flags)
mem = shallow_copy_rtx (mem); mem = shallow_copy_rtx (mem);
#endif #endif
pbi->mem_set_list = alloc_EXPR_LIST (0, mem, pbi->mem_set_list); pbi->mem_set_list = alloc_EXPR_LIST (0, mem, pbi->mem_set_list);
if (++pbi->mem_set_list_len >= MAX_MEM_SET_LIST_LEN)
break;
} }
} }
} }
...@@ -4512,6 +4525,7 @@ invalidate_mems_from_autoinc (pbi, insn) ...@@ -4512,6 +4525,7 @@ invalidate_mems_from_autoinc (pbi, insn)
else else
pbi->mem_set_list = next; pbi->mem_set_list = next;
free_EXPR_LIST_node (temp); free_EXPR_LIST_node (temp);
pbi->mem_set_list_len--;
} }
else else
prev = temp; prev = temp;
...@@ -4547,6 +4561,7 @@ invalidate_mems_from_set (pbi, exp) ...@@ -4547,6 +4561,7 @@ invalidate_mems_from_set (pbi, exp)
else else
pbi->mem_set_list = next; pbi->mem_set_list = next;
free_EXPR_LIST_node (temp); free_EXPR_LIST_node (temp);
pbi->mem_set_list_len--;
} }
else else
prev = temp; prev = temp;
...@@ -4743,7 +4758,8 @@ mark_set_1 (pbi, code, reg, cond, insn, flags) ...@@ -4743,7 +4758,8 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
if (insn && GET_CODE (reg) == MEM) if (insn && GET_CODE (reg) == MEM)
invalidate_mems_from_autoinc (pbi, insn); invalidate_mems_from_autoinc (pbi, insn);
if (GET_CODE (reg) == MEM && ! side_effects_p (reg) if (pbi->mem_set_list_len < MAX_MEM_SET_LIST_LEN
&& GET_CODE (reg) == MEM && ! side_effects_p (reg)
/* ??? With more effort we could track conditional memory life. */ /* ??? With more effort we could track conditional memory life. */
&& ! cond && ! cond
/* We do not know the size of a BLKmode store, so we do not track /* We do not know the size of a BLKmode store, so we do not track
...@@ -4761,6 +4777,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags) ...@@ -4761,6 +4777,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
reg = shallow_copy_rtx (reg); reg = shallow_copy_rtx (reg);
#endif #endif
pbi->mem_set_list = alloc_EXPR_LIST (0, reg, pbi->mem_set_list); pbi->mem_set_list = alloc_EXPR_LIST (0, reg, pbi->mem_set_list);
pbi->mem_set_list_len++;
} }
} }
...@@ -5859,6 +5876,7 @@ mark_used_regs (pbi, x, cond, insn) ...@@ -5859,6 +5876,7 @@ mark_used_regs (pbi, x, cond, insn)
else else
pbi->mem_set_list = next; pbi->mem_set_list = next;
free_EXPR_LIST_node (temp); free_EXPR_LIST_node (temp);
pbi->mem_set_list_len--;
} }
else else
prev = temp; prev = temp;
...@@ -5996,7 +6014,10 @@ mark_used_regs (pbi, x, cond, insn) ...@@ -5996,7 +6014,10 @@ mark_used_regs (pbi, x, cond, insn)
So for now, just clear the memory set list and mark any regs So for now, just clear the memory set list and mark any regs
we can find in ASM_OPERANDS as used. */ we can find in ASM_OPERANDS as used. */
if (code != ASM_OPERANDS || MEM_VOLATILE_P (x)) if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
free_EXPR_LIST_list (&pbi->mem_set_list); {
free_EXPR_LIST_list (&pbi->mem_set_list);
pbi->mem_set_list_len = 0;
}
/* For all ASM_OPERANDS, we must traverse the vector of input operands. /* For all ASM_OPERANDS, we must traverse the vector of input operands.
We can not just fall through here since then we would be confused We can not just fall through here since then we would be confused
......
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