aboutsummaryrefslogtreecommitdiff
path: root/gcc/store-motion.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2014-08-27 19:53:39 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2014-08-27 19:53:39 +0000
commit3dc99c19a5203597ca0bf8f39aea7028f17e80ba (patch)
tree6b70cdb662152458e90a78b8cb9af235f424d8a0 /gcc/store-motion.c
parenta756c6be3193ea9483aaa35b1be4e95ccc79af83 (diff)
downloadgcc-3dc99c19a5203597ca0bf8f39aea7028f17e80ba.zip
gcc-3dc99c19a5203597ca0bf8f39aea7028f17e80ba.tar.gz
gcc-3dc99c19a5203597ca0bf8f39aea7028f17e80ba.tar.bz2
Use rtx_insn_list in various places
gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
Diffstat (limited to 'gcc/store-motion.c')
-rw-r--r--gcc/store-motion.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index 8d6f5f4..fdbc6b3 100644
--- a/gcc/store-motion.c
+++ b/gcc/store-motion.c
@@ -72,9 +72,9 @@ struct st_expr
/* List of registers mentioned by the mem. */
rtx pattern_regs;
/* INSN list of stores that are locally anticipatable. */
- rtx antic_stores;
+ rtx_insn_list *antic_stores;
/* INSN list of stores that are locally available. */
- rtx avail_stores;
+ rtx_insn_list *avail_stores;
/* Next in the list. */
struct st_expr * next;
/* Store ID in the dataflow bitmaps. */
@@ -156,8 +156,8 @@ st_expr_entry (rtx x)
ptr->next = store_motion_mems;
ptr->pattern = x;
ptr->pattern_regs = NULL_RTX;
- ptr->antic_stores = NULL_RTX;
- ptr->avail_stores = NULL_RTX;
+ ptr->antic_stores = NULL;
+ ptr->avail_stores = NULL;
ptr->reaching_reg = NULL_RTX;
ptr->index = 0;
ptr->hash_index = hash;
@@ -540,7 +540,7 @@ static void
find_moveable_store (rtx_insn *insn, int *regs_set_before, int *regs_set_after)
{
struct st_expr * ptr;
- rtx dest, set, tmp;
+ rtx dest, set;
int check_anticipatable, check_available;
basic_block bb = BLOCK_FOR_INSN (insn);
@@ -587,15 +587,16 @@ find_moveable_store (rtx_insn *insn, int *regs_set_before, int *regs_set_after)
check_anticipatable = 1;
else
{
- tmp = XEXP (ptr->antic_stores, 0);
+ rtx_insn *tmp = ptr->antic_stores->insn ();
if (tmp != NULL_RTX
&& BLOCK_FOR_INSN (tmp) != bb)
check_anticipatable = 1;
}
if (check_anticipatable)
{
+ rtx_insn *tmp;
if (store_killed_before (dest, ptr->pattern_regs, insn, bb, regs_set_before))
- tmp = NULL_RTX;
+ tmp = NULL;
else
tmp = insn;
ptr->antic_stores = alloc_INSN_LIST (tmp, ptr->antic_stores);
@@ -609,7 +610,7 @@ find_moveable_store (rtx_insn *insn, int *regs_set_before, int *regs_set_after)
check_available = 1;
else
{
- tmp = XEXP (ptr->avail_stores, 0);
+ rtx_insn *tmp = ptr->avail_stores->insn ();
if (BLOCK_FOR_INSN (tmp) != bb)
check_available = 1;
}
@@ -619,6 +620,7 @@ find_moveable_store (rtx_insn *insn, int *regs_set_before, int *regs_set_after)
failed last time. */
if (LAST_AVAIL_CHECK_FAILURE (ptr))
{
+ rtx_insn *tmp;
for (tmp = BB_END (bb);
tmp != insn && tmp != LAST_AVAIL_CHECK_FAILURE (ptr);
tmp = PREV_INSN (tmp))
@@ -646,7 +648,7 @@ compute_store_table (void)
unsigned regno;
#endif
rtx_insn *insn;
- rtx tmp;
+ rtx_insn *tmp;
df_ref def;
int *last_set_in, *already_set;
struct st_expr * ptr, **prev_next_ptr_ptr;
@@ -701,8 +703,8 @@ compute_store_table (void)
{
LAST_AVAIL_CHECK_FAILURE (ptr) = NULL_RTX;
if (ptr->antic_stores
- && (tmp = XEXP (ptr->antic_stores, 0)) == NULL_RTX)
- ptr->antic_stores = XEXP (ptr->antic_stores, 1);
+ && (tmp = ptr->antic_stores->insn ()) == NULL_RTX)
+ ptr->antic_stores = ptr->antic_stores->next ();
}
}