Commit 6dbe4c9e by Trevor Saunders Committed by Trevor Saunders

make antic_stores a vec<rtx_insn *>

gcc/ChangeLog:

2016-07-06  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* store-motion.c (struct st_expr): Make antic_stores a vector.
	(st_expr_entry): Adjust.
	(free_st_expr_entry): Likewise.
	(print_store_motion_mems): Likewise.
	(find_moveable_store): Likewise.
	(compute_store_table): Likewise.
	(remove_reachable_equiv_notes): Likewise.
	(replace_store_insn): Likewise.
	(build_store_vectors): Likewise.

From-SVN: r238063
parent 52e86221
2016-07-06 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* store-motion.c (struct st_expr): Make antic_stores a vector.
(st_expr_entry): Adjust.
(free_st_expr_entry): Likewise.
(print_store_motion_mems): Likewise.
(find_moveable_store): Likewise.
(compute_store_table): Likewise.
(remove_reachable_equiv_notes): Likewise.
(replace_store_insn): Likewise.
(build_store_vectors): Likewise.
2016-07-06 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2016-07-06 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/driver-arm.c (arm_cpu_table): Add entries for cortex-a32, * config/arm/driver-arm.c (arm_cpu_table): Add entries for cortex-a32,
......
...@@ -46,7 +46,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -46,7 +46,6 @@ along with GCC; see the file COPYING3. If not see
a compile time hog that needs a rewrite (maybe cache st_exprs to a compile time hog that needs a rewrite (maybe cache st_exprs to
invalidate REG_EQUAL/REG_EQUIV notes for?). invalidate REG_EQUAL/REG_EQUIV notes for?).
- pattern_regs in st_expr should be a regset (on its own obstack). - pattern_regs in st_expr should be a regset (on its own obstack).
- antic_stores and avail_stores should be VECs instead of lists.
- store_motion_mems should be a vec instead of a list. - store_motion_mems should be a vec instead of a list.
- there should be an alloc pool for struct st_expr objects. - there should be an alloc pool for struct st_expr objects.
- investigate whether it is helpful to make the address of an st_expr - investigate whether it is helpful to make the address of an st_expr
...@@ -66,7 +65,7 @@ struct st_expr ...@@ -66,7 +65,7 @@ struct st_expr
/* List of registers mentioned by the mem. */ /* List of registers mentioned by the mem. */
rtx pattern_regs; rtx pattern_regs;
/* INSN list of stores that are locally anticipatable. */ /* INSN list of stores that are locally anticipatable. */
rtx_insn_list *antic_stores; vec<rtx_insn *> antic_stores;
/* INSN list of stores that are locally available. */ /* INSN list of stores that are locally available. */
vec<rtx_insn *> avail_stores; vec<rtx_insn *> avail_stores;
/* Next in the list. */ /* Next in the list. */
...@@ -148,7 +147,7 @@ st_expr_entry (rtx x) ...@@ -148,7 +147,7 @@ st_expr_entry (rtx x)
ptr->next = store_motion_mems; ptr->next = store_motion_mems;
ptr->pattern = x; ptr->pattern = x;
ptr->pattern_regs = NULL_RTX; ptr->pattern_regs = NULL_RTX;
ptr->antic_stores = NULL; ptr->antic_stores.create (0);
ptr->avail_stores.create (0); ptr->avail_stores.create (0);
ptr->reaching_reg = NULL_RTX; ptr->reaching_reg = NULL_RTX;
ptr->index = 0; ptr->index = 0;
...@@ -164,8 +163,8 @@ st_expr_entry (rtx x) ...@@ -164,8 +163,8 @@ st_expr_entry (rtx x)
static void static void
free_st_expr_entry (struct st_expr * ptr) free_st_expr_entry (struct st_expr * ptr)
{ {
free_INSN_LIST_list (& ptr->antic_stores); ptr->antic_stores.release ();
ptr->avail_stores.release (); ptr->avail_stores.release ();
free (ptr); free (ptr);
} }
...@@ -233,11 +232,7 @@ print_store_motion_mems (FILE * file) ...@@ -233,11 +232,7 @@ print_store_motion_mems (FILE * file)
print_rtl (file, ptr->pattern); print_rtl (file, ptr->pattern);
fprintf (file, "\n ANTIC stores : "); fprintf (file, "\n ANTIC stores : ");
print_rtx_insn_vec (file, ptr->antic_stores);
if (ptr->antic_stores)
print_rtl (file, ptr->antic_stores);
else
fprintf (file, "(nil)");
fprintf (file, "\n AVAIL stores : "); fprintf (file, "\n AVAIL stores : ");
...@@ -566,11 +561,11 @@ find_moveable_store (rtx_insn *insn, int *regs_set_before, int *regs_set_after) ...@@ -566,11 +561,11 @@ find_moveable_store (rtx_insn *insn, int *regs_set_before, int *regs_set_after)
/* Do not check for anticipatability if we either found one anticipatable /* Do not check for anticipatability if we either found one anticipatable
store already, or tested for one and found out that it was killed. */ store already, or tested for one and found out that it was killed. */
check_anticipatable = 0; check_anticipatable = 0;
if (!ptr->antic_stores) if (ptr->antic_stores.is_empty ())
check_anticipatable = 1; check_anticipatable = 1;
else else
{ {
rtx_insn *tmp = ptr->antic_stores->insn (); rtx_insn *tmp = ptr->antic_stores.last ();
if (tmp != NULL_RTX if (tmp != NULL_RTX
&& BLOCK_FOR_INSN (tmp) != bb) && BLOCK_FOR_INSN (tmp) != bb)
check_anticipatable = 1; check_anticipatable = 1;
...@@ -582,7 +577,7 @@ find_moveable_store (rtx_insn *insn, int *regs_set_before, int *regs_set_after) ...@@ -582,7 +577,7 @@ find_moveable_store (rtx_insn *insn, int *regs_set_before, int *regs_set_after)
tmp = NULL; tmp = NULL;
else else
tmp = insn; tmp = insn;
ptr->antic_stores = alloc_INSN_LIST (tmp, ptr->antic_stores); ptr->antic_stores.safe_push (tmp);
} }
/* It is not necessary to check whether store is available if we did /* It is not necessary to check whether store is available if we did
...@@ -683,9 +678,9 @@ compute_store_table (void) ...@@ -683,9 +678,9 @@ compute_store_table (void)
for (ptr = first_st_expr (); ptr != NULL; ptr = next_st_expr (ptr)) for (ptr = first_st_expr (); ptr != NULL; ptr = next_st_expr (ptr))
{ {
LAST_AVAIL_CHECK_FAILURE (ptr) = NULL_RTX; LAST_AVAIL_CHECK_FAILURE (ptr) = NULL_RTX;
if (ptr->antic_stores if (!ptr->antic_stores.is_empty ()
&& (tmp = ptr->antic_stores->insn ()) == NULL_RTX) && (tmp = ptr->antic_stores.last ()) == NULL)
ptr->antic_stores = ptr->antic_stores->next (); ptr->antic_stores.pop ();
} }
} }
...@@ -831,7 +826,7 @@ remove_reachable_equiv_notes (basic_block bb, struct st_expr *smexpr) ...@@ -831,7 +826,7 @@ remove_reachable_equiv_notes (basic_block bb, struct st_expr *smexpr)
int sp; int sp;
edge act; edge act;
sbitmap visited = sbitmap_alloc (last_basic_block_for_fn (cfun)); sbitmap visited = sbitmap_alloc (last_basic_block_for_fn (cfun));
rtx last, note; rtx note;
rtx_insn *insn; rtx_insn *insn;
rtx mem = smexpr->pattern; rtx mem = smexpr->pattern;
...@@ -866,13 +861,13 @@ remove_reachable_equiv_notes (basic_block bb, struct st_expr *smexpr) ...@@ -866,13 +861,13 @@ remove_reachable_equiv_notes (basic_block bb, struct st_expr *smexpr)
} }
bitmap_set_bit (visited, bb->index); bitmap_set_bit (visited, bb->index);
rtx_insn *last;
if (bitmap_bit_p (st_antloc[bb->index], smexpr->index)) if (bitmap_bit_p (st_antloc[bb->index], smexpr->index))
{ {
for (last = smexpr->antic_stores; unsigned int i;
BLOCK_FOR_INSN (XEXP (last, 0)) != bb; FOR_EACH_VEC_ELT_REVERSE (smexpr->antic_stores, i, last)
last = XEXP (last, 1)) if (BLOCK_FOR_INSN (last) == bb)
continue; break;
last = XEXP (last, 0);
} }
else else
last = NEXT_INSN (BB_END (bb)); last = NEXT_INSN (BB_END (bb));
...@@ -911,15 +906,17 @@ replace_store_insn (rtx reg, rtx_insn *del, basic_block bb, ...@@ -911,15 +906,17 @@ replace_store_insn (rtx reg, rtx_insn *del, basic_block bb,
struct st_expr *smexpr) struct st_expr *smexpr)
{ {
rtx_insn *insn; rtx_insn *insn;
rtx mem, note, set, ptr; rtx mem, note, set;
mem = smexpr->pattern; mem = smexpr->pattern;
insn = gen_move_insn (reg, SET_SRC (single_set (del))); insn = gen_move_insn (reg, SET_SRC (single_set (del)));
for (ptr = smexpr->antic_stores; ptr; ptr = XEXP (ptr, 1)) unsigned int i;
if (XEXP (ptr, 0) == del) rtx_insn *temp;
FOR_EACH_VEC_ELT_REVERSE (smexpr->antic_stores, i, temp)
if (temp == del)
{ {
XEXP (ptr, 0) = insn; smexpr->antic_stores[i] = insn;
break; break;
} }
...@@ -1001,7 +998,6 @@ build_store_vectors (void) ...@@ -1001,7 +998,6 @@ build_store_vectors (void)
basic_block bb; basic_block bb;
int *regs_set_in_block; int *regs_set_in_block;
rtx_insn *insn; rtx_insn *insn;
rtx_insn_list *st;
struct st_expr * ptr; struct st_expr * ptr;
unsigned int max_gcse_regno = max_reg_num (); unsigned int max_gcse_regno = max_reg_num ();
...@@ -1038,9 +1034,9 @@ build_store_vectors (void) ...@@ -1038,9 +1034,9 @@ build_store_vectors (void)
bitmap_set_bit (st_avloc[bb->index], ptr->index); bitmap_set_bit (st_avloc[bb->index], ptr->index);
} }
for (st = ptr->antic_stores; st != NULL; st = st->next ()) unsigned int i;
FOR_EACH_VEC_ELT_REVERSE (ptr->antic_stores, i, insn)
{ {
insn = st->insn ();
bb = BLOCK_FOR_INSN (insn); bb = BLOCK_FOR_INSN (insn);
bitmap_set_bit (st_antloc[bb->index], ptr->index); bitmap_set_bit (st_antloc[bb->index], ptr->index);
} }
......
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