diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-06 23:53:20 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-06 23:53:20 +0000 |
commit | 892d872feabe8867fd3cb96c5e9b05edbf3f967a (patch) | |
tree | e68d2fa0cd8ac40da523a632e2b824de5517cea4 | |
parent | d30c5be2834a7070b5a0ce8ea098fd28143895f0 (diff) | |
download | gcc-892d872feabe8867fd3cb96c5e9b05edbf3f967a.tar.gz |
make side_effects a vec<rtx>
gcc/ChangeLog:
2016-07-06 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* var-tracking.c (struct adjust_mem_data): Make side_effects a vector.
(adjust_mems): Adjust.
(adjust_insn): Likewise.
(prepare_call_arguments): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238066 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/var-tracking.c | 33 |
2 files changed, 21 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a35420b85c..48edbc59810 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2016-07-06 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> + * var-tracking.c (struct adjust_mem_data): Make side_effects a vector. + (adjust_mems): Adjust. + (adjust_insn): Likewise. + (prepare_call_arguments): Likewise. + +2016-07-06 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> + * gcse.c (struct ls_expr): Make stores field a vector. (ldst_entry): Adjust. (free_ldst_entry): Likewise. diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 9f09d30b1f9..5d09879bccd 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -926,7 +926,7 @@ struct adjust_mem_data bool store; machine_mode mem_mode; HOST_WIDE_INT stack_adjust; - rtx_expr_list *side_effects; + auto_vec<rtx> side_effects; }; /* Helper for adjust_mems. Return true if X is suitable for @@ -1072,9 +1072,7 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data) amd->store = false; tem = simplify_replace_fn_rtx (tem, old_rtx, adjust_mems, data); amd->store = store_save; - amd->side_effects = alloc_EXPR_LIST (0, - gen_rtx_SET (XEXP (loc, 0), tem), - amd->side_effects); + amd->side_effects.safe_push (gen_rtx_SET (XEXP (loc, 0), tem)); return addr; case PRE_MODIFY: addr = XEXP (loc, 1); @@ -1088,9 +1086,7 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data) tem = simplify_replace_fn_rtx (XEXP (loc, 1), old_rtx, adjust_mems, data); amd->store = store_save; - amd->side_effects = alloc_EXPR_LIST (0, - gen_rtx_SET (XEXP (loc, 0), tem), - amd->side_effects); + amd->side_effects.safe_push (gen_rtx_SET (XEXP (loc, 0), tem)); return addr; case SUBREG: /* First try without delegitimization of whole MEMs and @@ -1184,7 +1180,6 @@ adjust_mem_stores (rtx loc, const_rtx expr, void *data) static void adjust_insn (basic_block bb, rtx_insn *insn) { - struct adjust_mem_data amd; rtx set; #ifdef HAVE_window_save @@ -1213,9 +1208,9 @@ adjust_insn (basic_block bb, rtx_insn *insn) } #endif + adjust_mem_data amd; amd.mem_mode = VOIDmode; amd.stack_adjust = -VTI (bb)->out.stack_adjust; - amd.side_effects = NULL; amd.store = true; note_stores (PATTERN (insn), adjust_mem_stores, &amd); @@ -1281,10 +1276,10 @@ adjust_insn (basic_block bb, rtx_insn *insn) validate_change (NULL_RTX, &SET_SRC (set), XEXP (note, 0), true); } - if (amd.side_effects) + if (!amd.side_effects.is_empty ()) { - rtx *pat, new_pat, s; - int i, oldn, newn; + rtx *pat, new_pat; + int i, oldn; pat = &PATTERN (insn); if (GET_CODE (*pat) == COND_EXEC) @@ -1293,17 +1288,18 @@ adjust_insn (basic_block bb, rtx_insn *insn) oldn = XVECLEN (*pat, 0); else oldn = 1; - for (s = amd.side_effects, newn = 0; s; newn++) - s = XEXP (s, 1); + unsigned int newn = amd.side_effects.length (); new_pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (oldn + newn)); if (GET_CODE (*pat) == PARALLEL) for (i = 0; i < oldn; i++) XVECEXP (new_pat, 0, i) = XVECEXP (*pat, 0, i); else XVECEXP (new_pat, 0, 0) = *pat; - for (s = amd.side_effects, i = oldn; i < oldn + newn; i++, s = XEXP (s, 1)) - XVECEXP (new_pat, 0, i) = XEXP (s, 0); - free_EXPR_LIST_list (&amd.side_effects); + + rtx effect; + unsigned int j; + FOR_EACH_VEC_ELT_REVERSE (amd.side_effects, j, effect) + XVECEXP (new_pat, 0, j + oldn) = effect; validate_change (NULL_RTX, pat, new_pat, true); } } @@ -6335,11 +6331,10 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn) struct adjust_mem_data amd; amd.mem_mode = VOIDmode; amd.stack_adjust = -VTI (bb)->out.stack_adjust; - amd.side_effects = NULL; amd.store = true; mem = simplify_replace_fn_rtx (mem, NULL_RTX, adjust_mems, &amd); - gcc_assert (amd.side_effects == NULL_RTX); + gcc_assert (amd.side_effects.is_empty ()); } val = cselib_lookup (mem, GET_MODE (mem), 0, VOIDmode); if (val && cselib_preserved_value_p (val)) |