make forced labels a vec
gcc/ChangeLog: 2016-08-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * cfgbuild.c (make_edges): Adjust. * cfgrtl.c (can_delete_label_p): Likewise. * dwarf2cfi.c (create_trace_edges): Likewise. * except.c (sjlj_emit_dispatch_table): Likewise. * function.h (struct expr_status): make x_forced_labels a vector. * jump.c (rebuild_jump_labels_1): Adjust. * reload1.c (set_initial_label_offsets): Likewise. * stmt.c (force_label_rtx): Likewise. (expand_label): Likewise. From-SVN: r239800
This commit is contained in:
parent
9cad8a673f
commit
6f7eba349b
@ -1,3 +1,15 @@
|
||||
2016-08-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
|
||||
|
||||
* cfgbuild.c (make_edges): Adjust.
|
||||
* cfgrtl.c (can_delete_label_p): Likewise.
|
||||
* dwarf2cfi.c (create_trace_edges): Likewise.
|
||||
* except.c (sjlj_emit_dispatch_table): Likewise.
|
||||
* function.h (struct expr_status): make x_forced_labels a vector.
|
||||
* jump.c (rebuild_jump_labels_1): Adjust.
|
||||
* reload1.c (set_initial_label_offsets): Likewise.
|
||||
* stmt.c (force_label_rtx): Likewise.
|
||||
(expand_label): Likewise.
|
||||
|
||||
2016-08-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
|
||||
|
||||
* haifa-sched.c (fix_recovery_deps): Make ready_list a vector.
|
||||
|
@ -204,7 +204,8 @@ make_edges (basic_block min, basic_block max, int update_p)
|
||||
/* Heavy use of computed goto in machine-generated code can lead to
|
||||
nearly fully-connected CFGs. In that case we spend a significant
|
||||
amount of time searching the edge lists for duplicates. */
|
||||
if (forced_labels || cfun->cfg->max_jumptable_ents > 100)
|
||||
if (!vec_safe_is_empty (forced_labels)
|
||||
|| cfun->cfg->max_jumptable_ents > 100)
|
||||
edge_cache = sbitmap_alloc (last_basic_block_for_fn (cfun));
|
||||
|
||||
/* By nature of the way these get numbered, ENTRY_BLOCK_PTR->next_bb block
|
||||
@ -280,8 +281,10 @@ make_edges (basic_block min, basic_block max, int update_p)
|
||||
everything on the forced_labels list. */
|
||||
else if (computed_jump_p (insn))
|
||||
{
|
||||
for (rtx_insn_list *x = forced_labels; x; x = x->next ())
|
||||
make_label_edge (edge_cache, bb, x->insn (), EDGE_ABNORMAL);
|
||||
rtx_insn *insn;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_SAFE_ELT (forced_labels, i, insn)
|
||||
make_label_edge (edge_cache, bb, insn, EDGE_ABNORMAL);
|
||||
}
|
||||
|
||||
/* Returns create an exit out. */
|
||||
|
@ -115,7 +115,8 @@ can_delete_label_p (const rtx_code_label *label)
|
||||
return (!LABEL_PRESERVE_P (label)
|
||||
/* User declared labels must be preserved. */
|
||||
&& LABEL_NAME (label) == 0
|
||||
&& !in_insn_list_p (forced_labels, label));
|
||||
&& !vec_safe_contains<rtx_insn *> (forced_labels,
|
||||
const_cast<rtx_code_label *> (label)));
|
||||
}
|
||||
|
||||
/* Delete INSN by patching it out. */
|
||||
|
@ -2354,8 +2354,10 @@ create_trace_edges (rtx_insn *insn)
|
||||
}
|
||||
else if (computed_jump_p (insn))
|
||||
{
|
||||
for (rtx_insn_list *lab = forced_labels; lab; lab = lab->next ())
|
||||
maybe_record_trace_start (lab->insn (), insn);
|
||||
rtx_insn *temp;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_SAFE_ELT (forced_labels, i, temp)
|
||||
maybe_record_trace_start (temp, insn);
|
||||
}
|
||||
else if (returnjump_p (insn))
|
||||
;
|
||||
|
@ -1278,8 +1278,7 @@ sjlj_emit_dispatch_table (rtx_code_label *dispatch_label, int num_dispatch)
|
||||
label on the nonlocal_goto_label list. Since we're modeling these
|
||||
CFG edges more exactly, we can use the forced_labels list instead. */
|
||||
LABEL_PRESERVE_P (dispatch_label) = 1;
|
||||
forced_labels
|
||||
= gen_rtx_INSN_LIST (VOIDmode, dispatch_label, forced_labels);
|
||||
vec_safe_push<rtx_insn *> (forced_labels, dispatch_label);
|
||||
#endif
|
||||
|
||||
/* Load up exc_ptr and filter values from the function context. */
|
||||
|
@ -126,7 +126,7 @@ struct GTY(()) expr_status {
|
||||
rtx x_apply_args_value;
|
||||
|
||||
/* List of labels that must never be deleted. */
|
||||
rtx_insn_list *x_forced_labels;
|
||||
vec<rtx_insn *, va_gc> *x_forced_labels;
|
||||
};
|
||||
|
||||
typedef struct call_site_record_d *call_site_record;
|
||||
|
12
gcc/jump.c
12
gcc/jump.c
@ -68,8 +68,6 @@ static int invert_exp_1 (rtx, rtx);
|
||||
static void
|
||||
rebuild_jump_labels_1 (rtx_insn *f, bool count_forced)
|
||||
{
|
||||
rtx_insn_list *insn;
|
||||
|
||||
timevar_push (TV_REBUILD_JUMP);
|
||||
init_label_info (f);
|
||||
mark_all_labels (f);
|
||||
@ -79,9 +77,13 @@ rebuild_jump_labels_1 (rtx_insn *f, bool count_forced)
|
||||
count doesn't drop to zero. */
|
||||
|
||||
if (count_forced)
|
||||
for (insn = forced_labels; insn; insn = insn->next ())
|
||||
if (LABEL_P (insn->insn ()))
|
||||
LABEL_NUSES (insn->insn ())++;
|
||||
{
|
||||
rtx_insn *insn;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_SAFE_ELT (forced_labels, i, insn)
|
||||
if (LABEL_P (insn))
|
||||
LABEL_NUSES (insn)++;
|
||||
}
|
||||
timevar_pop (TV_REBUILD_JUMP);
|
||||
}
|
||||
|
||||
|
@ -3888,9 +3888,10 @@ set_initial_label_offsets (void)
|
||||
{
|
||||
memset (offsets_known_at, 0, num_labels);
|
||||
|
||||
for (rtx_insn_list *x = forced_labels; x; x = x->next ())
|
||||
if (x->insn ())
|
||||
set_label_offsets (x->insn (), NULL, 1);
|
||||
unsigned int i;
|
||||
rtx_insn *insn;
|
||||
FOR_EACH_VEC_SAFE_ELT (forced_labels, i, insn)
|
||||
set_label_offsets (insn, NULL, 1);
|
||||
|
||||
for (rtx_insn_list *x = nonlocal_goto_handler_labels; x; x = x->next ())
|
||||
if (x->insn ())
|
||||
|
@ -136,7 +136,7 @@ force_label_rtx (tree label)
|
||||
|
||||
gcc_assert (function);
|
||||
|
||||
forced_labels = gen_rtx_INSN_LIST (VOIDmode, ref, forced_labels);
|
||||
vec_safe_push (forced_labels, ref);
|
||||
return ref;
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ expand_label (tree label)
|
||||
}
|
||||
|
||||
if (FORCED_LABEL (label))
|
||||
forced_labels = gen_rtx_INSN_LIST (VOIDmode, label_r, forced_labels);
|
||||
vec_safe_push<rtx_insn *> (forced_labels, label_r);
|
||||
|
||||
if (DECL_NONLOCAL (label) || FORCED_LABEL (label))
|
||||
maybe_set_first_label_num (label_r);
|
||||
|
Loading…
Reference in New Issue
Block a user