use range based for loops to iterate over vec<>
This changes users of FOR_EACH_VEC_ELT to use range based for loops, where the index variables are otherwise unused. As such the index variables are all deleted, producing shorter and simpler code. Signed-off-by: Trevor Saunders <tbsaunde@tbsaunde.org> gcc/analyzer/ChangeLog: * call-string.cc (call_string::call_string): Use range based for to iterate over vec<>. (call_string::to_json): Likewise. (call_string::hash): Likewise. (call_string::calc_recursion_depth): Likewise. * checker-path.cc (checker_path::fixup_locations): Likewise. * constraint-manager.cc (equiv_class::equiv_class): Likewise. (equiv_class::to_json): Likewise. (equiv_class::hash): Likewise. (constraint_manager::to_json): Likewise. * engine.cc (impl_region_model_context::on_svalue_leak): Likewise. (on_liveness_change): Likewise. (impl_region_model_context::on_unknown_change): Likewise. * program-state.cc (sm_state_map::set_state): Likewise. * region-model.cc (test_canonicalization_4): Likewise. gcc/ChangeLog: * attribs.c (find_attribute_namespace): Iterate over vec<> with range based for. * auto-profile.c (afdo_find_equiv_class): Likewise. * gcc.c (do_specs_vec): Likewise. (do_spec_1): Likewise. (driver::set_up_specs): Likewise. * gimple-loop-jam.c (any_access_function_variant_p): Likewise. * gimple-ssa-store-merging.c (compatible_load_p): Likewise. (imm_store_chain_info::try_coalesce_bswap): Likewise. (imm_store_chain_info::coalesce_immediate_stores): Likewise. (get_location_for_stmts): Likewise. * graphite-poly.c (print_iteration_domains): Likewise. (free_poly_bb): Likewise. (remove_gbbs_in_scop): Likewise. (free_scop): Likewise. (dump_gbb_cases): Likewise. (dump_gbb_conditions): Likewise. (print_pdrs): Likewise. (print_scop): Likewise. * ifcvt.c (cond_move_process_if_block): Likewise. * lower-subreg.c (decompose_multiword_subregs): Likewise. * regcprop.c (pass_cprop_hardreg::execute): Likewise. * sanopt.c (sanitize_rewrite_addressable_params): Likewise. * sel-sched-dump.c (dump_insn_vector): Likewise. * store-motion.c (store_ops_ok): Likewise. (store_killed_in_insn): Likewise. * timevar.c (timer::named_items::print): Likewise. * tree-cfgcleanup.c (cleanup_control_flow_pre): Likewise. (cleanup_tree_cfg_noloop): Likewise. * tree-data-ref.c (dump_data_references): Likewise. (print_dir_vectors): Likewise. (print_dist_vectors): Likewise. (dump_data_dependence_relations): Likewise. (dump_dist_dir_vectors): Likewise. (dump_ddrs): Likewise. (create_runtime_alias_checks): Likewise. (free_subscripts): Likewise. (save_dist_v): Likewise. (save_dir_v): Likewise. (invariant_access_functions): Likewise. (same_access_functions): Likewise. (access_functions_are_affine_or_constant_p): Likewise. (find_data_references_in_stmt): Likewise. (graphite_find_data_references_in_stmt): Likewise. (free_dependence_relations): Likewise. (free_data_refs): Likewise. * tree-inline.c (copy_debug_stmts): Likewise. * tree-into-ssa.c (dump_currdefs): Likewise. (rewrite_update_phi_arguments): Likewise. * tree-ssa-propagate.c (clean_up_loop_closed_phi): Likewise. * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr): Likewise. (vect_slp_analyze_node_dependences): Likewise. (vect_slp_analyze_instance_dependence): Likewise. (vect_record_base_alignments): Likewise. (vect_get_peeling_costs_all_drs): Likewise. (vect_peeling_supportable): Likewise. * tree-vectorizer.c (vec_info::~vec_info): Likewise. (vec_info::free_stmt_vec_infos): Likewise. gcc/cp/ChangeLog: * constexpr.c (cxx_eval_call_expression): Iterate over vec<> with range based for. (cxx_eval_store_expression): Likewise. (cxx_eval_loop_expr): Likewise. * decl.c (wrapup_namespace_globals): Likewise. (cp_finish_decl): Likewise. (cxx_simulate_enum_decl): Likewise. * parser.c (cp_parser_postfix_expression): Likewise.
This commit is contained in:
parent
8a7d54b1e1
commit
3f207ab314
29 changed files with 108 additions and 300 deletions
|
@ -50,9 +50,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
call_string::call_string (const call_string &other)
|
||||
: m_return_edges (other.m_return_edges.length ())
|
||||
{
|
||||
const return_superedge *e;
|
||||
int i;
|
||||
FOR_EACH_VEC_ELT (other.m_return_edges, i, e)
|
||||
for (const return_superedge *e : other.m_return_edges)
|
||||
m_return_edges.quick_push (e);
|
||||
}
|
||||
|
||||
|
@ -118,9 +116,7 @@ call_string::to_json () const
|
|||
{
|
||||
json::array *arr = new json::array ();
|
||||
|
||||
const return_superedge *e;
|
||||
int i;
|
||||
FOR_EACH_VEC_ELT (m_return_edges, i, e)
|
||||
for (const return_superedge *e : m_return_edges)
|
||||
{
|
||||
json::object *e_obj = new json::object ();
|
||||
e_obj->set ("src_snode_idx",
|
||||
|
@ -141,9 +137,7 @@ hashval_t
|
|||
call_string::hash () const
|
||||
{
|
||||
inchash::hash hstate;
|
||||
int i;
|
||||
const return_superedge *e;
|
||||
FOR_EACH_VEC_ELT (m_return_edges, i, e)
|
||||
for (const return_superedge *e : m_return_edges)
|
||||
hstate.add_ptr (e);
|
||||
return hstate.end ();
|
||||
}
|
||||
|
@ -173,9 +167,7 @@ call_string::calc_recursion_depth () const
|
|||
= m_return_edges[m_return_edges.length () - 1];
|
||||
|
||||
int result = 0;
|
||||
const return_superedge *e;
|
||||
int i;
|
||||
FOR_EACH_VEC_ELT (m_return_edges, i, e)
|
||||
for (const return_superedge *e : m_return_edges)
|
||||
if (e == top_return_sedge)
|
||||
++result;
|
||||
return result;
|
||||
|
|
|
@ -1001,9 +1001,7 @@ checker_path::add_final_event (const state_machine *sm,
|
|||
void
|
||||
checker_path::fixup_locations (pending_diagnostic *pd)
|
||||
{
|
||||
checker_event *e;
|
||||
int i;
|
||||
FOR_EACH_VEC_ELT (m_events, i, e)
|
||||
for (checker_event *e : m_events)
|
||||
e->set_location (pd->fixup_location (e->get_location ()));
|
||||
}
|
||||
|
||||
|
|
|
@ -270,9 +270,7 @@ equiv_class::equiv_class (const equiv_class &other)
|
|||
: m_constant (other.m_constant), m_cst_sval (other.m_cst_sval),
|
||||
m_vars (other.m_vars.length ())
|
||||
{
|
||||
int i;
|
||||
const svalue *sval;
|
||||
FOR_EACH_VEC_ELT (other.m_vars, i, sval)
|
||||
for (const svalue *sval : other.m_vars)
|
||||
m_vars.quick_push (sval);
|
||||
}
|
||||
|
||||
|
@ -310,9 +308,7 @@ equiv_class::to_json () const
|
|||
json::object *ec_obj = new json::object ();
|
||||
|
||||
json::array *sval_arr = new json::array ();
|
||||
int i;
|
||||
const svalue *sval;
|
||||
FOR_EACH_VEC_ELT (m_vars, i, sval)
|
||||
for (const svalue *sval : m_vars)
|
||||
sval_arr->append (sval->to_json ());
|
||||
ec_obj->set ("svals", sval_arr);
|
||||
|
||||
|
@ -337,9 +333,7 @@ equiv_class::hash () const
|
|||
inchash::hash hstate;
|
||||
|
||||
inchash::add_expr (m_constant, hstate);
|
||||
int i;
|
||||
const svalue *sval;
|
||||
FOR_EACH_VEC_ELT (m_vars, i, sval)
|
||||
for (const svalue * sval : m_vars)
|
||||
hstate.add_ptr (sval);
|
||||
return hstate.end ();
|
||||
}
|
||||
|
@ -811,9 +805,7 @@ constraint_manager::to_json () const
|
|||
/* Equivalence classes. */
|
||||
{
|
||||
json::array *ec_arr = new json::array ();
|
||||
int i;
|
||||
equiv_class *ec;
|
||||
FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
|
||||
for (const equiv_class *ec : m_equiv_classes)
|
||||
ec_arr->append (ec->to_json ());
|
||||
cm_obj->set ("ecs", ec_arr);
|
||||
}
|
||||
|
@ -821,10 +813,8 @@ constraint_manager::to_json () const
|
|||
/* Constraints. */
|
||||
{
|
||||
json::array *con_arr = new json::array ();
|
||||
int i;
|
||||
constraint *c;
|
||||
FOR_EACH_VEC_ELT (m_constraints, i, c)
|
||||
con_arr->append (c->to_json ());
|
||||
for (const constraint &c : m_constraints)
|
||||
con_arr->append (c.to_json ());
|
||||
cm_obj->set ("constraints", con_arr);
|
||||
}
|
||||
|
||||
|
|
|
@ -121,9 +121,7 @@ void
|
|||
impl_region_model_context::on_svalue_leak (const svalue *sval)
|
||||
|
||||
{
|
||||
int sm_idx;
|
||||
sm_state_map *smap;
|
||||
FOR_EACH_VEC_ELT (m_new_state->m_checker_states, sm_idx, smap)
|
||||
for (sm_state_map *smap : m_new_state->m_checker_states)
|
||||
smap->on_svalue_leak (sval, this);
|
||||
}
|
||||
|
||||
|
@ -132,9 +130,7 @@ impl_region_model_context::
|
|||
on_liveness_change (const svalue_set &live_svalues,
|
||||
const region_model *model)
|
||||
{
|
||||
int sm_idx;
|
||||
sm_state_map *smap;
|
||||
FOR_EACH_VEC_ELT (m_new_state->m_checker_states, sm_idx, smap)
|
||||
for (sm_state_map *smap : m_new_state->m_checker_states)
|
||||
smap->on_liveness_change (live_svalues, model, this);
|
||||
}
|
||||
|
||||
|
@ -142,9 +138,7 @@ void
|
|||
impl_region_model_context::on_unknown_change (const svalue *sval,
|
||||
bool is_mutable)
|
||||
{
|
||||
int sm_idx;
|
||||
sm_state_map *smap;
|
||||
FOR_EACH_VEC_ELT (m_new_state->m_checker_states, sm_idx, smap)
|
||||
for (sm_state_map *smap : m_new_state->m_checker_states)
|
||||
smap->on_unknown_change (sval, is_mutable, m_ext_state);
|
||||
}
|
||||
|
||||
|
|
|
@ -441,10 +441,8 @@ sm_state_map::set_state (const equiv_class &ec,
|
|||
const svalue *origin,
|
||||
const extrinsic_state &ext_state)
|
||||
{
|
||||
int i;
|
||||
const svalue *sval;
|
||||
bool any_changed = false;
|
||||
FOR_EACH_VEC_ELT (ec.m_vars, i, sval)
|
||||
for (const svalue *sval : ec.m_vars)
|
||||
any_changed |= impl_set_state (sval, state, origin, ext_state);
|
||||
return any_changed;
|
||||
}
|
||||
|
|
|
@ -4294,9 +4294,7 @@ test_canonicalization_4 ()
|
|||
region_model_manager mgr;
|
||||
region_model model (&mgr);
|
||||
|
||||
unsigned i;
|
||||
tree cst;
|
||||
FOR_EACH_VEC_ELT (csts, i, cst)
|
||||
for (tree cst : csts)
|
||||
model.get_rvalue (cst, NULL);
|
||||
|
||||
model.canonicalize ();
|
||||
|
|
|
@ -165,15 +165,12 @@ register_scoped_attributes (const struct attribute_spec *attributes,
|
|||
static scoped_attributes*
|
||||
find_attribute_namespace (const char* ns)
|
||||
{
|
||||
unsigned ix;
|
||||
scoped_attributes *iter;
|
||||
|
||||
FOR_EACH_VEC_ELT (attributes_table, ix, iter)
|
||||
if (ns == iter->ns
|
||||
|| (iter->ns != NULL
|
||||
for (scoped_attributes &iter : attributes_table)
|
||||
if (ns == iter.ns
|
||||
|| (iter.ns != NULL
|
||||
&& ns != NULL
|
||||
&& !strcmp (iter->ns, ns)))
|
||||
return iter;
|
||||
&& !strcmp (iter.ns, ns)))
|
||||
return &iter;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1156,14 +1156,12 @@ afdo_find_equiv_class (bb_set *annotated_bb)
|
|||
FOR_ALL_BB_FN (bb, cfun)
|
||||
{
|
||||
vec<basic_block> dom_bbs;
|
||||
basic_block bb1;
|
||||
int i;
|
||||
|
||||
if (bb->aux != NULL)
|
||||
continue;
|
||||
bb->aux = bb;
|
||||
dom_bbs = get_dominated_by (CDI_DOMINATORS, bb);
|
||||
FOR_EACH_VEC_ELT (dom_bbs, i, bb1)
|
||||
for (basic_block bb1 : dom_bbs)
|
||||
if (bb1->aux == NULL && dominated_by_p (CDI_POST_DOMINATORS, bb, bb1)
|
||||
&& bb1->loop_father == bb->loop_father)
|
||||
{
|
||||
|
@ -1175,7 +1173,7 @@ afdo_find_equiv_class (bb_set *annotated_bb)
|
|||
}
|
||||
}
|
||||
dom_bbs = get_dominated_by (CDI_POST_DOMINATORS, bb);
|
||||
FOR_EACH_VEC_ELT (dom_bbs, i, bb1)
|
||||
for (basic_block bb1 : dom_bbs)
|
||||
if (bb1->aux == NULL && dominated_by_p (CDI_DOMINATORS, bb, bb1)
|
||||
&& bb1->loop_father == bb->loop_father)
|
||||
{
|
||||
|
|
|
@ -2793,9 +2793,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
|
|||
|
||||
/* Forget the saved values of the callee's SAVE_EXPRs and
|
||||
TARGET_EXPRs. */
|
||||
unsigned int i;
|
||||
tree save_expr;
|
||||
FOR_EACH_VEC_ELT (save_exprs, i, save_expr)
|
||||
for (tree save_expr : save_exprs)
|
||||
ctx->global->values.remove (save_expr);
|
||||
|
||||
/* Remove the parms/result from the values map. Is it worth
|
||||
|
@ -5495,9 +5493,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
|
|||
semantics are not applied on an object under construction.
|
||||
They come into effect when the constructor for the most
|
||||
derived object ends." */
|
||||
tree elt;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_ELT (*ctors, i, elt)
|
||||
for (tree elt : *ctors)
|
||||
if (same_type_ignoring_top_level_qualifiers_p
|
||||
(TREE_TYPE (const_object_being_modified), TREE_TYPE (elt)))
|
||||
{
|
||||
|
@ -5605,12 +5601,10 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
|
|||
|
||||
/* Update TREE_CONSTANT and TREE_SIDE_EFFECTS on enclosing
|
||||
CONSTRUCTORs, if any. */
|
||||
tree elt;
|
||||
unsigned i;
|
||||
bool c = TREE_CONSTANT (init);
|
||||
bool s = TREE_SIDE_EFFECTS (init);
|
||||
if (!c || s || activated_union_member_p)
|
||||
FOR_EACH_VEC_ELT (*ctors, i, elt)
|
||||
for (tree elt : *ctors)
|
||||
{
|
||||
if (!c)
|
||||
TREE_CONSTANT (elt) = false;
|
||||
|
@ -5928,9 +5922,7 @@ cxx_eval_loop_expr (const constexpr_ctx *ctx, tree t,
|
|||
}
|
||||
|
||||
/* Forget saved values of SAVE_EXPRs and TARGET_EXPRs. */
|
||||
unsigned int i;
|
||||
tree save_expr;
|
||||
FOR_EACH_VEC_ELT (save_exprs, i, save_expr)
|
||||
for (tree save_expr : save_exprs)
|
||||
ctx->global->values.remove (save_expr);
|
||||
save_exprs.truncate (0);
|
||||
|
||||
|
@ -5952,9 +5944,7 @@ cxx_eval_loop_expr (const constexpr_ctx *ctx, tree t,
|
|||
&& !*non_constant_p);
|
||||
|
||||
/* Forget saved values of SAVE_EXPRs and TARGET_EXPRs. */
|
||||
unsigned int i;
|
||||
tree save_expr;
|
||||
FOR_EACH_VEC_ELT (save_exprs, i, save_expr)
|
||||
for (tree save_expr : save_exprs)
|
||||
ctx->global->values.remove (save_expr);
|
||||
|
||||
return NULL_TREE;
|
||||
|
|
|
@ -841,9 +841,7 @@ wrapup_namespace_globals ()
|
|||
{
|
||||
if (vec<tree, va_gc> *statics = static_decls)
|
||||
{
|
||||
tree decl;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_ELT (*statics, i, decl)
|
||||
for (tree decl : *statics)
|
||||
{
|
||||
if (warn_unused_function
|
||||
&& TREE_CODE (decl) == FUNCTION_DECL
|
||||
|
@ -8260,8 +8258,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
|
|||
reference, insert it in the statement-tree now. */
|
||||
if (cleanups)
|
||||
{
|
||||
unsigned i; tree t;
|
||||
FOR_EACH_VEC_ELT (*cleanups, i, t)
|
||||
for (tree t : *cleanups)
|
||||
push_cleanup (decl, t, false);
|
||||
release_tree_vector (cleanups);
|
||||
}
|
||||
|
@ -16415,11 +16412,9 @@ cxx_simulate_enum_decl (location_t loc, const char *name,
|
|||
SET_OPAQUE_ENUM_P (enumtype, false);
|
||||
DECL_SOURCE_LOCATION (TYPE_NAME (enumtype)) = loc;
|
||||
|
||||
string_int_pair *value;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_ELT (values, i, value)
|
||||
build_enumerator (get_identifier (value->first),
|
||||
build_int_cst (integer_type_node, value->second),
|
||||
for (const string_int_pair &value : values)
|
||||
build_enumerator (get_identifier (value.first),
|
||||
build_int_cst (integer_type_node, value.second),
|
||||
enumtype, NULL_TREE, loc);
|
||||
|
||||
finish_enum_value_list (enumtype);
|
||||
|
|
|
@ -7299,8 +7299,6 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|
|||
case RID_BUILTIN_LAUNDER:
|
||||
{
|
||||
vec<tree, va_gc> *vec;
|
||||
unsigned int i;
|
||||
tree p;
|
||||
|
||||
cp_lexer_consume_token (parser->lexer);
|
||||
vec = cp_parser_parenthesized_expression_list (parser, non_attr,
|
||||
|
@ -7312,7 +7310,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|
|||
break;
|
||||
}
|
||||
|
||||
FOR_EACH_VEC_ELT (*vec, i, p)
|
||||
for (tree p : *vec)
|
||||
mark_exp_read (p);
|
||||
|
||||
switch (keyword)
|
||||
|
|
13
gcc/gcc.c
13
gcc/gcc.c
|
@ -5838,10 +5838,7 @@ compile_input_file_p (struct infile *infile)
|
|||
static void
|
||||
do_specs_vec (vec<char_p> vec)
|
||||
{
|
||||
unsigned ix;
|
||||
char *opt;
|
||||
|
||||
FOR_EACH_VEC_ELT (vec, ix, opt)
|
||||
for (char *opt : vec)
|
||||
{
|
||||
do_spec_1 (opt, 1, NULL);
|
||||
/* Make each accumulated option a separate argument. */
|
||||
|
@ -6436,8 +6433,6 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
|
|||
{
|
||||
const char *p1 = p;
|
||||
char *string;
|
||||
char *opt;
|
||||
unsigned ix;
|
||||
|
||||
/* Skip past the option value and make a copy. */
|
||||
if (*p != '{')
|
||||
|
@ -6448,7 +6443,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
|
|||
string = save_string (p1 + 1, p - p1 - 2);
|
||||
|
||||
/* See if we already recorded this option. */
|
||||
FOR_EACH_VEC_ELT (linker_options, ix, opt)
|
||||
for (const char *opt : linker_options)
|
||||
if (! strcmp (string, opt))
|
||||
{
|
||||
free (string);
|
||||
|
@ -8316,9 +8311,7 @@ driver::set_up_specs () const
|
|||
&& do_spec_2 (startfile_prefix_spec, NULL) == 0
|
||||
&& do_spec_1 (" ", 0, NULL) == 0)
|
||||
{
|
||||
const char *arg;
|
||||
int ndx;
|
||||
FOR_EACH_VEC_ELT (argbuf, ndx, arg)
|
||||
for (const char *arg : argbuf)
|
||||
add_sysrooted_prefix (&startfile_prefixes, arg, "BINUTILS",
|
||||
PREFIX_PRIORITY_LAST, 0, 1);
|
||||
}
|
||||
|
|
|
@ -365,11 +365,9 @@ static bool
|
|||
any_access_function_variant_p (const struct data_reference *a,
|
||||
const class loop *loop_nest)
|
||||
{
|
||||
unsigned int i;
|
||||
vec<tree> fns = DR_ACCESS_FNS (a);
|
||||
tree t;
|
||||
|
||||
FOR_EACH_VEC_ELT (fns, i, t)
|
||||
for (tree t : fns)
|
||||
if (!evolution_function_is_invariant_p (t, loop_nest->num))
|
||||
return true;
|
||||
|
||||
|
|
|
@ -2541,8 +2541,6 @@ compatible_load_p (merged_store_group *merged_store,
|
|||
clobbers those loads. */
|
||||
gimple *first = merged_store->first_stmt;
|
||||
gimple *last = merged_store->last_stmt;
|
||||
unsigned int i;
|
||||
store_immediate_info *infoc;
|
||||
/* The stores are sorted by increasing store bitpos, so if info->stmt store
|
||||
comes before the so far first load, we'll be changing
|
||||
merged_store->first_stmt. In that case we need to give up if
|
||||
|
@ -2550,7 +2548,7 @@ compatible_load_p (merged_store_group *merged_store,
|
|||
range. */
|
||||
if (info->order < merged_store->first_order)
|
||||
{
|
||||
FOR_EACH_VEC_ELT (merged_store->stores, i, infoc)
|
||||
for (store_immediate_info *infoc : merged_store->stores)
|
||||
if (stmts_may_clobber_ref_p (info->stmt, first, infoc->ops[idx].val))
|
||||
return false;
|
||||
first = info->stmt;
|
||||
|
@ -2560,7 +2558,7 @@ compatible_load_p (merged_store_group *merged_store,
|
|||
processed loads. */
|
||||
else if (info->order > merged_store->last_order)
|
||||
{
|
||||
FOR_EACH_VEC_ELT (merged_store->stores, i, infoc)
|
||||
for (store_immediate_info *infoc : merged_store->stores)
|
||||
if (stmts_may_clobber_ref_p (last, info->stmt, infoc->ops[idx].val))
|
||||
return false;
|
||||
last = info->stmt;
|
||||
|
@ -2884,9 +2882,7 @@ imm_store_chain_info::try_coalesce_bswap (merged_store_group *merged_store,
|
|||
gather_bswap_load_refs (&refs,
|
||||
gimple_assign_rhs1 (m_store_info[i]->stmt));
|
||||
|
||||
unsigned int i;
|
||||
tree ref;
|
||||
FOR_EACH_VEC_ELT (refs, i, ref)
|
||||
for (tree ref : refs)
|
||||
if (stmts_may_clobber_ref_p (first_stmt, last_stmt, ref))
|
||||
return false;
|
||||
n.vuse = NULL_TREE;
|
||||
|
@ -3199,9 +3195,7 @@ imm_store_chain_info::coalesce_immediate_stores ()
|
|||
}
|
||||
else if (infof->rhs_code == MEM_REF && info->rhs_code != MEM_REF)
|
||||
{
|
||||
store_immediate_info *infoj;
|
||||
unsigned int j;
|
||||
FOR_EACH_VEC_ELT (merged_store->stores, j, infoj)
|
||||
for (store_immediate_info *infoj : merged_store->stores)
|
||||
{
|
||||
infoj->rhs_code = BIT_INSERT_EXPR;
|
||||
infoj->ops[0].val = gimple_assign_rhs1 (infoj->stmt);
|
||||
|
@ -3323,10 +3317,7 @@ get_alias_type_for_stmts (vec<gimple *> &stmts, bool is_load,
|
|||
static location_t
|
||||
get_location_for_stmts (vec<gimple *> &stmts)
|
||||
{
|
||||
gimple *stmt;
|
||||
unsigned int i;
|
||||
|
||||
FOR_EACH_VEC_ELT (stmts, i, stmt)
|
||||
for (gimple *stmt : stmts)
|
||||
if (gimple_has_location (stmt))
|
||||
return gimple_location (stmt);
|
||||
|
||||
|
|
|
@ -63,10 +63,7 @@ print_iteration_domain (FILE *file, poly_bb_p pbb)
|
|||
void
|
||||
print_iteration_domains (FILE *file, scop_p scop)
|
||||
{
|
||||
int i;
|
||||
poly_bb_p pbb;
|
||||
|
||||
FOR_EACH_VEC_ELT (scop->pbbs, i, pbb)
|
||||
for (poly_bb_p pbb : scop->pbbs)
|
||||
print_iteration_domain (file, pbb);
|
||||
}
|
||||
|
||||
|
@ -150,16 +147,13 @@ new_poly_bb (scop_p scop, gimple_poly_bb_p black_box)
|
|||
static void
|
||||
free_poly_bb (poly_bb_p pbb)
|
||||
{
|
||||
int i;
|
||||
poly_dr_p pdr;
|
||||
|
||||
isl_set_free (pbb->domain);
|
||||
pbb->domain = NULL;
|
||||
isl_set_free (pbb->iterators);
|
||||
pbb->iterators = NULL;
|
||||
|
||||
if (PBB_DRS (pbb).exists ())
|
||||
FOR_EACH_VEC_ELT (PBB_DRS (pbb), i, pdr)
|
||||
for (poly_dr_p pdr : PBB_DRS (pbb))
|
||||
free_poly_dr (pdr);
|
||||
|
||||
PBB_DRS (pbb).release ();
|
||||
|
@ -243,10 +237,7 @@ free_gimple_poly_bb (gimple_poly_bb_p gbb)
|
|||
static void
|
||||
remove_gbbs_in_scop (scop_p scop)
|
||||
{
|
||||
int i;
|
||||
poly_bb_p pbb;
|
||||
|
||||
FOR_EACH_VEC_ELT (scop->pbbs, i, pbb)
|
||||
for (poly_bb_p pbb : scop->pbbs)
|
||||
free_gimple_poly_bb (PBB_BLACK_BOX (pbb));
|
||||
}
|
||||
|
||||
|
@ -273,13 +264,10 @@ new_scop (edge entry, edge exit)
|
|||
void
|
||||
free_scop (scop_p scop)
|
||||
{
|
||||
int i;
|
||||
poly_bb_p pbb;
|
||||
|
||||
remove_gbbs_in_scop (scop);
|
||||
free_sese_info (scop->scop_info);
|
||||
|
||||
FOR_EACH_VEC_ELT (scop->pbbs, i, pbb)
|
||||
for (poly_bb_p pbb : scop->pbbs)
|
||||
free_poly_bb (pbb);
|
||||
|
||||
scop->pbbs.release ();
|
||||
|
@ -309,8 +297,6 @@ print_pbb_domain (FILE *file, poly_bb_p pbb)
|
|||
static void
|
||||
dump_gbb_cases (FILE *file, gimple_poly_bb_p gbb)
|
||||
{
|
||||
int i;
|
||||
gimple *stmt;
|
||||
vec<gimple *> cases;
|
||||
|
||||
if (!gbb)
|
||||
|
@ -322,7 +308,7 @@ dump_gbb_cases (FILE *file, gimple_poly_bb_p gbb)
|
|||
|
||||
fprintf (file, "cases bb_%d (\n", GBB_BB (gbb)->index);
|
||||
|
||||
FOR_EACH_VEC_ELT (cases, i, stmt)
|
||||
for (gimple *stmt : cases)
|
||||
print_gimple_stmt (file, stmt, 0);
|
||||
|
||||
fprintf (file, ")\n");
|
||||
|
@ -333,8 +319,6 @@ dump_gbb_cases (FILE *file, gimple_poly_bb_p gbb)
|
|||
static void
|
||||
dump_gbb_conditions (FILE *file, gimple_poly_bb_p gbb)
|
||||
{
|
||||
int i;
|
||||
gimple *stmt;
|
||||
vec<gimple *> conditions;
|
||||
|
||||
if (!gbb)
|
||||
|
@ -346,7 +330,7 @@ dump_gbb_conditions (FILE *file, gimple_poly_bb_p gbb)
|
|||
|
||||
fprintf (file, "conditions bb_%d (\n", GBB_BB (gbb)->index);
|
||||
|
||||
FOR_EACH_VEC_ELT (conditions, i, stmt)
|
||||
for (gimple *stmt : conditions)
|
||||
print_gimple_stmt (file, stmt, 0);
|
||||
|
||||
fprintf (file, ")\n");
|
||||
|
@ -357,8 +341,6 @@ dump_gbb_conditions (FILE *file, gimple_poly_bb_p gbb)
|
|||
void
|
||||
print_pdrs (FILE *file, poly_bb_p pbb)
|
||||
{
|
||||
int i;
|
||||
poly_dr_p pdr;
|
||||
int nb_reads = 0;
|
||||
int nb_writes = 0;
|
||||
|
||||
|
@ -367,7 +349,7 @@ print_pdrs (FILE *file, poly_bb_p pbb)
|
|||
|
||||
fprintf (file, "Data references (\n");
|
||||
|
||||
FOR_EACH_VEC_ELT (PBB_DRS (pbb), i, pdr)
|
||||
for (poly_dr_p pdr : PBB_DRS (pbb))
|
||||
if (PDR_TYPE (pdr) == PDR_READ)
|
||||
nb_reads++;
|
||||
else
|
||||
|
@ -375,13 +357,13 @@ print_pdrs (FILE *file, poly_bb_p pbb)
|
|||
|
||||
fprintf (file, "Read data references (\n");
|
||||
|
||||
FOR_EACH_VEC_ELT (PBB_DRS (pbb), i, pdr)
|
||||
for (poly_dr_p pdr : PBB_DRS (pbb))
|
||||
if (PDR_TYPE (pdr) == PDR_READ)
|
||||
print_pdr (file, pdr);
|
||||
|
||||
fprintf (file, ")\n");
|
||||
fprintf (file, "Write data references (\n");
|
||||
FOR_EACH_VEC_ELT (PBB_DRS (pbb), i, pdr)
|
||||
for (poly_dr_p pdr : PBB_DRS (pbb))
|
||||
if (PDR_TYPE (pdr) != PDR_READ)
|
||||
print_pdr (file, pdr);
|
||||
fprintf (file, ")\n");
|
||||
|
@ -459,9 +441,6 @@ print_scop_context (FILE *file, scop_p scop)
|
|||
void
|
||||
print_scop (FILE *file, scop_p scop)
|
||||
{
|
||||
int i;
|
||||
poly_bb_p pbb;
|
||||
|
||||
fprintf (file, "SCoP (\n");
|
||||
print_scop_context (file, scop);
|
||||
print_scop_params (file, scop);
|
||||
|
@ -469,7 +448,7 @@ print_scop (FILE *file, scop_p scop)
|
|||
fprintf (file, "Number of statements: ");
|
||||
fprintf (file, "%d\n", scop->pbbs.length ());
|
||||
|
||||
FOR_EACH_VEC_ELT (scop->pbbs, i, pbb)
|
||||
for (poly_bb_p pbb : scop->pbbs)
|
||||
print_pbb (file, pbb);
|
||||
|
||||
fprintf (file, ")\n");
|
||||
|
|
|
@ -3889,11 +3889,9 @@ cond_move_process_if_block (struct noce_if_info *if_info)
|
|||
rtx_insn *jump = if_info->jump;
|
||||
rtx cond = if_info->cond;
|
||||
rtx_insn *seq, *loc_insn;
|
||||
rtx reg;
|
||||
int c;
|
||||
vec<rtx> then_regs = vNULL;
|
||||
vec<rtx> else_regs = vNULL;
|
||||
unsigned int i;
|
||||
int success_p = FALSE;
|
||||
int limit = param_max_rtl_if_conversion_insns;
|
||||
|
||||
|
@ -3915,7 +3913,7 @@ cond_move_process_if_block (struct noce_if_info *if_info)
|
|||
source register does not change after the assignment. Also count
|
||||
the number of registers set in only one of the blocks. */
|
||||
c = 0;
|
||||
FOR_EACH_VEC_ELT (then_regs, i, reg)
|
||||
for (rtx reg : then_regs)
|
||||
{
|
||||
rtx *then_slot = then_vals.get (reg);
|
||||
rtx *else_slot = else_vals.get (reg);
|
||||
|
@ -3934,7 +3932,7 @@ cond_move_process_if_block (struct noce_if_info *if_info)
|
|||
}
|
||||
|
||||
/* Finish off c for MAX_CONDITIONAL_EXECUTE. */
|
||||
FOR_EACH_VEC_ELT (else_regs, i, reg)
|
||||
for (rtx reg : else_regs)
|
||||
{
|
||||
gcc_checking_assert (else_vals.get (reg));
|
||||
if (!then_vals.get (reg))
|
||||
|
|
|
@ -1731,14 +1731,9 @@ decompose_multiword_subregs (bool decompose_copies)
|
|||
}
|
||||
}
|
||||
|
||||
{
|
||||
unsigned int i;
|
||||
bitmap b;
|
||||
|
||||
FOR_EACH_VEC_ELT (reg_copy_graph, i, b)
|
||||
if (b)
|
||||
BITMAP_FREE (b);
|
||||
}
|
||||
for (bitmap b : reg_copy_graph)
|
||||
if (b)
|
||||
BITMAP_FREE (b);
|
||||
|
||||
reg_copy_graph.release ();
|
||||
|
||||
|
|
|
@ -1404,12 +1404,9 @@ pass_cprop_hardreg::execute (function *fun)
|
|||
changed anything though. */
|
||||
if (!worklist.is_empty ())
|
||||
{
|
||||
unsigned int i;
|
||||
int index;
|
||||
|
||||
any_debug_changes = false;
|
||||
bitmap_clear (visited);
|
||||
FOR_EACH_VEC_ELT (worklist, i, index)
|
||||
for (int index : worklist)
|
||||
{
|
||||
bb = BASIC_BLOCK_FOR_FN (fun, index);
|
||||
cprop_hardreg_bb (bb, all_vd, visited);
|
||||
|
|
|
@ -1246,9 +1246,7 @@ sanitize_rewrite_addressable_params (function *fun)
|
|||
|
||||
/* Unset value expr for parameters for which we created debug bind
|
||||
expressions. */
|
||||
unsigned i;
|
||||
tree arg;
|
||||
FOR_EACH_VEC_ELT (clear_value_expr_list, i, arg)
|
||||
for (tree arg : clear_value_expr_list)
|
||||
{
|
||||
DECL_HAS_VALUE_EXPR_P (arg) = 0;
|
||||
SET_DECL_VALUE_EXPR (arg, NULL_TREE);
|
||||
|
|
|
@ -528,10 +528,7 @@ dump_flist (flist_t l)
|
|||
void
|
||||
dump_insn_vector (rtx_vec_t succs)
|
||||
{
|
||||
int i;
|
||||
rtx_insn *succ;
|
||||
|
||||
FOR_EACH_VEC_ELT (succs, i, succ)
|
||||
for (rtx_insn *succ : succs)
|
||||
if (succ)
|
||||
dump_insn (succ);
|
||||
else
|
||||
|
|
|
@ -251,9 +251,7 @@ print_store_motion_mems (FILE * file)
|
|||
static bool
|
||||
store_ops_ok (const vec<rtx> &x, int *regs_set)
|
||||
{
|
||||
unsigned int i;
|
||||
rtx temp;
|
||||
FOR_EACH_VEC_ELT (x, i, temp)
|
||||
for (rtx temp : x)
|
||||
if (regs_set[REGNO (temp)])
|
||||
return false;
|
||||
|
||||
|
@ -386,9 +384,7 @@ store_killed_in_insn (const_rtx x, const vec<rtx> &x_regs,
|
|||
|
||||
/* But even a const call reads its parameters. Check whether the
|
||||
base of some of registers used in mem is stack pointer. */
|
||||
rtx temp;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_ELT (x_regs, i, temp)
|
||||
for (rtx temp : x_regs)
|
||||
if (may_be_sp_based_p (temp))
|
||||
return true;
|
||||
|
||||
|
|
|
@ -198,10 +198,8 @@ timer::named_items::pop ()
|
|||
void
|
||||
timer::named_items::print (FILE *fp, const timevar_time_def *total)
|
||||
{
|
||||
unsigned int i;
|
||||
const char *item_name;
|
||||
fprintf (fp, "Client items:\n");
|
||||
FOR_EACH_VEC_ELT (m_names, i, item_name)
|
||||
for (const char *item_name : m_names)
|
||||
{
|
||||
timer::timevar_def *def = m_hash_map.get (item_name);
|
||||
gcc_assert (def);
|
||||
|
|
|
@ -950,9 +950,7 @@ cleanup_control_flow_pre ()
|
|||
/* If we've marked .ABNORMAL_DISPATCHER basic block(s) as visited
|
||||
above, but haven't marked any of their successors as visited,
|
||||
unmark them now, so that they can be removed as useless. */
|
||||
basic_block dispatcher_bb;
|
||||
unsigned int k;
|
||||
FOR_EACH_VEC_ELT (abnormal_dispatchers, k, dispatcher_bb)
|
||||
for (basic_block dispatcher_bb : abnormal_dispatchers)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
@ -1015,9 +1013,7 @@ cleanup_tree_cfg_noloop (unsigned ssa_update_flags)
|
|||
if (!dom_info_available_p (CDI_DOMINATORS))
|
||||
mark_dfs_back_edges ();
|
||||
|
||||
loop_p loop;
|
||||
unsigned i;
|
||||
FOR_EACH_VEC_ELT (*get_loops (cfun), i, loop)
|
||||
for (loop_p loop : *get_loops (cfun))
|
||||
if (loop && loop->header)
|
||||
{
|
||||
basic_block bb = loop->header;
|
||||
|
|
|
@ -170,10 +170,7 @@ ref_contains_union_access_p (tree ref)
|
|||
static void
|
||||
dump_data_references (FILE *file, vec<data_reference_p> datarefs)
|
||||
{
|
||||
unsigned int i;
|
||||
struct data_reference *dr;
|
||||
|
||||
FOR_EACH_VEC_ELT (datarefs, i, dr)
|
||||
for (data_reference *dr : datarefs)
|
||||
dump_data_reference (file, dr);
|
||||
}
|
||||
|
||||
|
@ -378,10 +375,7 @@ DEBUG_FUNCTION void
|
|||
print_dir_vectors (FILE *outf, vec<lambda_vector> dir_vects,
|
||||
int length)
|
||||
{
|
||||
unsigned j;
|
||||
lambda_vector v;
|
||||
|
||||
FOR_EACH_VEC_ELT (dir_vects, j, v)
|
||||
for (lambda_vector v : dir_vects)
|
||||
print_direction_vector (outf, v, length);
|
||||
}
|
||||
|
||||
|
@ -403,10 +397,7 @@ DEBUG_FUNCTION void
|
|||
print_dist_vectors (FILE *outf, vec<lambda_vector> dist_vects,
|
||||
int length)
|
||||
{
|
||||
unsigned j;
|
||||
lambda_vector v;
|
||||
|
||||
FOR_EACH_VEC_ELT (dist_vects, j, v)
|
||||
for (lambda_vector v : dist_vects)
|
||||
print_lambda_vector (outf, v, length);
|
||||
}
|
||||
|
||||
|
@ -499,10 +490,7 @@ DEBUG_FUNCTION void
|
|||
dump_data_dependence_relations (FILE *file,
|
||||
vec<ddr_p> ddrs)
|
||||
{
|
||||
unsigned int i;
|
||||
struct data_dependence_relation *ddr;
|
||||
|
||||
FOR_EACH_VEC_ELT (ddrs, i, ddr)
|
||||
for (data_dependence_relation *ddr : ddrs)
|
||||
dump_data_dependence_relation (file, ddr);
|
||||
}
|
||||
|
||||
|
@ -538,21 +526,17 @@ debug_data_dependence_relations (vec<ddr_p> ddrs)
|
|||
DEBUG_FUNCTION void
|
||||
dump_dist_dir_vectors (FILE *file, vec<ddr_p> ddrs)
|
||||
{
|
||||
unsigned int i, j;
|
||||
struct data_dependence_relation *ddr;
|
||||
lambda_vector v;
|
||||
|
||||
FOR_EACH_VEC_ELT (ddrs, i, ddr)
|
||||
for (data_dependence_relation *ddr : ddrs)
|
||||
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE && DDR_AFFINE_P (ddr))
|
||||
{
|
||||
FOR_EACH_VEC_ELT (DDR_DIST_VECTS (ddr), j, v)
|
||||
for (lambda_vector v : DDR_DIST_VECTS (ddr))
|
||||
{
|
||||
fprintf (file, "DISTANCE_V (");
|
||||
print_lambda_vector (file, v, DDR_NB_LOOPS (ddr));
|
||||
fprintf (file, ")\n");
|
||||
}
|
||||
|
||||
FOR_EACH_VEC_ELT (DDR_DIR_VECTS (ddr), j, v)
|
||||
for (lambda_vector v : DDR_DIR_VECTS (ddr))
|
||||
{
|
||||
fprintf (file, "DIRECTION_V (");
|
||||
print_direction_vector (file, v, DDR_NB_LOOPS (ddr));
|
||||
|
@ -568,10 +552,7 @@ dump_dist_dir_vectors (FILE *file, vec<ddr_p> ddrs)
|
|||
DEBUG_FUNCTION void
|
||||
dump_ddrs (FILE *file, vec<ddr_p> ddrs)
|
||||
{
|
||||
unsigned int i;
|
||||
struct data_dependence_relation *ddr;
|
||||
|
||||
FOR_EACH_VEC_ELT (ddrs, i, ddr)
|
||||
for (data_dependence_relation *ddr : ddrs)
|
||||
dump_data_dependence_relation (file, ddr);
|
||||
|
||||
fprintf (file, "\n\n");
|
||||
|
@ -2668,19 +2649,17 @@ create_runtime_alias_checks (class loop *loop,
|
|||
tree part_cond_expr;
|
||||
|
||||
fold_defer_overflow_warnings ();
|
||||
dr_with_seg_len_pair_t *alias_pair;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_ELT (*alias_pairs, i, alias_pair)
|
||||
for (const dr_with_seg_len_pair_t &alias_pair : alias_pairs)
|
||||
{
|
||||
gcc_assert (alias_pair->flags);
|
||||
gcc_assert (alias_pair.flags);
|
||||
if (dump_enabled_p ())
|
||||
dump_printf (MSG_NOTE,
|
||||
"create runtime check for data references %T and %T\n",
|
||||
DR_REF (alias_pair->first.dr),
|
||||
DR_REF (alias_pair->second.dr));
|
||||
DR_REF (alias_pair.first.dr),
|
||||
DR_REF (alias_pair.second.dr));
|
||||
|
||||
/* Create condition expression for each pair data references. */
|
||||
create_intersect_range_checks (loop, &part_cond_expr, *alias_pair);
|
||||
create_intersect_range_checks (loop, &part_cond_expr, alias_pair);
|
||||
if (*cond_expr)
|
||||
*cond_expr = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
|
||||
*cond_expr, part_cond_expr);
|
||||
|
@ -3436,10 +3415,7 @@ free_conflict_function (conflict_function *f)
|
|||
static void
|
||||
free_subscripts (vec<subscript_p> subscripts)
|
||||
{
|
||||
unsigned i;
|
||||
subscript_p s;
|
||||
|
||||
FOR_EACH_VEC_ELT (subscripts, i, s)
|
||||
for (subscript_p s : subscripts)
|
||||
{
|
||||
free_conflict_function (s->conflicting_iterations_in_a);
|
||||
free_conflict_function (s->conflicting_iterations_in_b);
|
||||
|
@ -4980,10 +4956,7 @@ analyze_overlapping_iterations (tree chrec_a,
|
|||
static void
|
||||
save_dist_v (struct data_dependence_relation *ddr, lambda_vector dist_v)
|
||||
{
|
||||
unsigned i;
|
||||
lambda_vector v;
|
||||
|
||||
FOR_EACH_VEC_ELT (DDR_DIST_VECTS (ddr), i, v)
|
||||
for (lambda_vector v : DDR_DIST_VECTS (ddr))
|
||||
if (lambda_vector_equal (v, dist_v, DDR_NB_LOOPS (ddr)))
|
||||
return;
|
||||
|
||||
|
@ -4995,10 +4968,7 @@ save_dist_v (struct data_dependence_relation *ddr, lambda_vector dist_v)
|
|||
static void
|
||||
save_dir_v (struct data_dependence_relation *ddr, lambda_vector dir_v)
|
||||
{
|
||||
unsigned i;
|
||||
lambda_vector v;
|
||||
|
||||
FOR_EACH_VEC_ELT (DDR_DIR_VECTS (ddr), i, v)
|
||||
for (lambda_vector v : DDR_DIR_VECTS (ddr))
|
||||
if (lambda_vector_equal (v, dir_v, DDR_NB_LOOPS (ddr)))
|
||||
return;
|
||||
|
||||
|
@ -5135,10 +5105,7 @@ static bool
|
|||
invariant_access_functions (const struct data_dependence_relation *ddr,
|
||||
int lnum)
|
||||
{
|
||||
unsigned i;
|
||||
subscript *sub;
|
||||
|
||||
FOR_EACH_VEC_ELT (DDR_SUBSCRIPTS (ddr), i, sub)
|
||||
for (subscript *sub : DDR_SUBSCRIPTS (ddr))
|
||||
if (!evolution_function_is_invariant_p (SUB_ACCESS_FN (sub, 0), lnum)
|
||||
|| !evolution_function_is_invariant_p (SUB_ACCESS_FN (sub, 1), lnum))
|
||||
return false;
|
||||
|
@ -5307,10 +5274,7 @@ add_distance_for_zero_overlaps (struct data_dependence_relation *ddr)
|
|||
static inline bool
|
||||
same_access_functions (const struct data_dependence_relation *ddr)
|
||||
{
|
||||
unsigned i;
|
||||
subscript *sub;
|
||||
|
||||
FOR_EACH_VEC_ELT (DDR_SUBSCRIPTS (ddr), i, sub)
|
||||
for (subscript *sub : DDR_SUBSCRIPTS (ddr))
|
||||
if (!eq_evolutions_p (SUB_ACCESS_FN (sub, 0),
|
||||
SUB_ACCESS_FN (sub, 1)))
|
||||
return false;
|
||||
|
@ -5587,11 +5551,8 @@ static bool
|
|||
access_functions_are_affine_or_constant_p (const struct data_reference *a,
|
||||
const class loop *loop_nest)
|
||||
{
|
||||
unsigned int i;
|
||||
vec<tree> fns = DR_ACCESS_FNS (a);
|
||||
tree t;
|
||||
|
||||
FOR_EACH_VEC_ELT (fns, i, t)
|
||||
for (tree t : fns)
|
||||
if (!evolution_function_is_invariant_p (t, loop_nest->num)
|
||||
&& !evolution_function_is_affine_multivariate_p (t, loop_nest->num))
|
||||
return false;
|
||||
|
@ -5902,20 +5863,18 @@ opt_result
|
|||
find_data_references_in_stmt (class loop *nest, gimple *stmt,
|
||||
vec<data_reference_p> *datarefs)
|
||||
{
|
||||
unsigned i;
|
||||
auto_vec<data_ref_loc, 2> references;
|
||||
data_ref_loc *ref;
|
||||
data_reference_p dr;
|
||||
|
||||
if (get_references_in_stmt (stmt, &references))
|
||||
return opt_result::failure_at (stmt, "statement clobbers memory: %G",
|
||||
stmt);
|
||||
|
||||
FOR_EACH_VEC_ELT (references, i, ref)
|
||||
for (const data_ref_loc &ref : references)
|
||||
{
|
||||
dr = create_data_ref (nest ? loop_preheader_edge (nest) : NULL,
|
||||
loop_containing_stmt (stmt), ref->ref,
|
||||
stmt, ref->is_read, ref->is_conditional_in_stmt);
|
||||
loop_containing_stmt (stmt), ref.ref,
|
||||
stmt, ref.is_read, ref.is_conditional_in_stmt);
|
||||
gcc_assert (dr != NULL);
|
||||
datarefs->safe_push (dr);
|
||||
}
|
||||
|
@ -5933,19 +5892,17 @@ bool
|
|||
graphite_find_data_references_in_stmt (edge nest, loop_p loop, gimple *stmt,
|
||||
vec<data_reference_p> *datarefs)
|
||||
{
|
||||
unsigned i;
|
||||
auto_vec<data_ref_loc, 2> references;
|
||||
data_ref_loc *ref;
|
||||
bool ret = true;
|
||||
data_reference_p dr;
|
||||
|
||||
if (get_references_in_stmt (stmt, &references))
|
||||
return false;
|
||||
|
||||
FOR_EACH_VEC_ELT (references, i, ref)
|
||||
for (const data_ref_loc &ref : references)
|
||||
{
|
||||
dr = create_data_ref (nest, loop, ref->ref, stmt, ref->is_read,
|
||||
ref->is_conditional_in_stmt);
|
||||
dr = create_data_ref (nest, loop, ref.ref, stmt, ref.is_read,
|
||||
ref.is_conditional_in_stmt);
|
||||
gcc_assert (dr != NULL);
|
||||
datarefs->safe_push (dr);
|
||||
}
|
||||
|
@ -6253,10 +6210,7 @@ free_dependence_relation (struct data_dependence_relation *ddr)
|
|||
void
|
||||
free_dependence_relations (vec<ddr_p> dependence_relations)
|
||||
{
|
||||
unsigned int i;
|
||||
struct data_dependence_relation *ddr;
|
||||
|
||||
FOR_EACH_VEC_ELT (dependence_relations, i, ddr)
|
||||
for (data_dependence_relation *ddr : dependence_relations)
|
||||
if (ddr)
|
||||
free_dependence_relation (ddr);
|
||||
|
||||
|
@ -6268,10 +6222,7 @@ free_dependence_relations (vec<ddr_p> dependence_relations)
|
|||
void
|
||||
free_data_refs (vec<data_reference_p> datarefs)
|
||||
{
|
||||
unsigned int i;
|
||||
struct data_reference *dr;
|
||||
|
||||
FOR_EACH_VEC_ELT (datarefs, i, dr)
|
||||
for (data_reference *dr : datarefs)
|
||||
free_data_ref (dr);
|
||||
datarefs.release ();
|
||||
}
|
||||
|
|
|
@ -3260,13 +3260,10 @@ copy_debug_stmt (gdebug *stmt, copy_body_data *id)
|
|||
static void
|
||||
copy_debug_stmts (copy_body_data *id)
|
||||
{
|
||||
size_t i;
|
||||
gdebug *stmt;
|
||||
|
||||
if (!id->debug_stmts.exists ())
|
||||
return;
|
||||
|
||||
FOR_EACH_VEC_ELT (id->debug_stmts, i, stmt)
|
||||
for (gdebug *stmt : id->debug_stmts)
|
||||
copy_debug_stmt (stmt, id);
|
||||
|
||||
id->debug_stmts.release ();
|
||||
|
|
|
@ -1638,14 +1638,11 @@ debug_defs_stack (int n)
|
|||
void
|
||||
dump_currdefs (FILE *file)
|
||||
{
|
||||
unsigned i;
|
||||
tree var;
|
||||
|
||||
if (symbols_to_rename.is_empty ())
|
||||
return;
|
||||
|
||||
fprintf (file, "\n\nCurrent reaching definitions\n\n");
|
||||
FOR_EACH_VEC_ELT (symbols_to_rename, i, var)
|
||||
for (tree var : symbols_to_rename)
|
||||
{
|
||||
common_info *info = get_common_info (var);
|
||||
fprintf (file, "CURRDEF (");
|
||||
|
@ -2069,18 +2066,16 @@ rewrite_update_phi_arguments (basic_block bb)
|
|||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
unsigned i;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
{
|
||||
gphi *phi;
|
||||
vec<gphi *> phis;
|
||||
|
||||
if (!bitmap_bit_p (blocks_with_phis_to_rewrite, e->dest->index))
|
||||
continue;
|
||||
|
||||
phis = phis_to_rewrite[e->dest->index];
|
||||
FOR_EACH_VEC_ELT (phis, i, phi)
|
||||
for (gphi *phi : phis)
|
||||
{
|
||||
tree arg, lhs_sym, reaching_def = NULL;
|
||||
use_operand_p arg_p;
|
||||
|
|
|
@ -1258,8 +1258,6 @@ propagate_tree_value_into_stmt (gimple_stmt_iterator *gsi, tree val)
|
|||
unsigned
|
||||
clean_up_loop_closed_phi (function *fun)
|
||||
{
|
||||
unsigned i;
|
||||
edge e;
|
||||
gphi *phi;
|
||||
tree rhs;
|
||||
tree lhs;
|
||||
|
@ -1280,7 +1278,7 @@ clean_up_loop_closed_phi (function *fun)
|
|||
{
|
||||
/* Check each exit edege of loop. */
|
||||
auto_vec<edge> exits = get_loop_exit_edges (loop);
|
||||
FOR_EACH_VEC_ELT (exits, i, e)
|
||||
for (edge e : exits)
|
||||
if (single_pred_p (e->dest))
|
||||
/* Walk over loop-closed PHIs. */
|
||||
for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi);)
|
||||
|
|
|
@ -290,9 +290,7 @@ vect_analyze_possibly_independent_ddr (data_dependence_relation *ddr,
|
|||
int loop_depth, unsigned int *max_vf)
|
||||
{
|
||||
class loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
|
||||
lambda_vector dist_v;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_ELT (DDR_DIST_VECTS (ddr), i, dist_v)
|
||||
for (lambda_vector &dist_v : DDR_DIST_VECTS (ddr))
|
||||
{
|
||||
int dist = dist_v[loop_depth];
|
||||
if (dist != 0 && !(dist > 0 && DDR_REVERSED_P (ddr)))
|
||||
|
@ -729,9 +727,8 @@ vect_slp_analyze_node_dependences (vec_info *vinfo, slp_tree node,
|
|||
{
|
||||
if (stmt_info != last_store_info)
|
||||
continue;
|
||||
unsigned i;
|
||||
stmt_vec_info store_info;
|
||||
FOR_EACH_VEC_ELT (stores, i, store_info)
|
||||
|
||||
for (stmt_vec_info &store_info : stores)
|
||||
{
|
||||
data_reference *store_dr
|
||||
= STMT_VINFO_DATA_REF (store_info);
|
||||
|
@ -804,9 +801,8 @@ vect_slp_analyze_node_dependences (vec_info *vinfo, slp_tree node,
|
|||
{
|
||||
if (stmt_info != last_store_info)
|
||||
continue;
|
||||
unsigned i;
|
||||
stmt_vec_info store_info;
|
||||
FOR_EACH_VEC_ELT (stores, i, store_info)
|
||||
|
||||
for (stmt_vec_info &store_info : stores)
|
||||
{
|
||||
data_reference *store_dr
|
||||
= STMT_VINFO_DATA_REF (store_info);
|
||||
|
@ -868,9 +864,7 @@ vect_slp_analyze_instance_dependence (vec_info *vinfo, slp_instance instance)
|
|||
|
||||
/* Verify we can sink loads to the vectorized stmt insert location,
|
||||
special-casing stores of this instance. */
|
||||
slp_tree load;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (instance), i, load)
|
||||
for (slp_tree &load : SLP_INSTANCE_LOADS (instance))
|
||||
if (! vect_slp_analyze_node_dependences (vinfo, load,
|
||||
store
|
||||
? SLP_TREE_SCALAR_STMTS (store)
|
||||
|
@ -927,9 +921,7 @@ vect_record_base_alignments (vec_info *vinfo)
|
|||
{
|
||||
loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo);
|
||||
class loop *loop = loop_vinfo ? LOOP_VINFO_LOOP (loop_vinfo) : NULL;
|
||||
data_reference *dr;
|
||||
unsigned int i;
|
||||
FOR_EACH_VEC_ELT (vinfo->shared->datarefs, i, dr)
|
||||
for (data_reference *dr : vinfo->shared->datarefs)
|
||||
{
|
||||
dr_vec_info *dr_info = vinfo->lookup_dr (dr);
|
||||
stmt_vec_info stmt_info = dr_info->stmt;
|
||||
|
@ -1463,10 +1455,8 @@ vect_get_peeling_costs_all_drs (loop_vec_info loop_vinfo,
|
|||
bool unknown_misalignment)
|
||||
{
|
||||
vec<data_reference_p> datarefs = LOOP_VINFO_DATAREFS (loop_vinfo);
|
||||
unsigned i;
|
||||
data_reference *dr;
|
||||
|
||||
FOR_EACH_VEC_ELT (datarefs, i, dr)
|
||||
for (data_reference *dr : datarefs)
|
||||
{
|
||||
dr_vec_info *dr_info = loop_vinfo->lookup_dr (dr);
|
||||
if (!vect_relevant_for_alignment_p (dr_info))
|
||||
|
@ -1575,13 +1565,11 @@ static bool
|
|||
vect_peeling_supportable (loop_vec_info loop_vinfo, dr_vec_info *dr0_info,
|
||||
unsigned npeel)
|
||||
{
|
||||
unsigned i;
|
||||
struct data_reference *dr = NULL;
|
||||
vec<data_reference_p> datarefs = LOOP_VINFO_DATAREFS (loop_vinfo);
|
||||
enum dr_alignment_support supportable_dr_alignment;
|
||||
|
||||
/* Ensure that all data refs can be vectorized after the peel. */
|
||||
FOR_EACH_VEC_ELT (datarefs, i, dr)
|
||||
for (data_reference *dr : datarefs)
|
||||
{
|
||||
int save_misalignment;
|
||||
|
||||
|
|
|
@ -469,10 +469,7 @@ vec_info::vec_info (vec_info::vec_kind kind_in, void *target_cost_data_in,
|
|||
|
||||
vec_info::~vec_info ()
|
||||
{
|
||||
slp_instance instance;
|
||||
unsigned int i;
|
||||
|
||||
FOR_EACH_VEC_ELT (slp_instances, i, instance)
|
||||
for (slp_instance &instance : slp_instances)
|
||||
vect_free_slp_instance (instance);
|
||||
|
||||
destroy_cost_data (target_cost_data);
|
||||
|
@ -739,9 +736,7 @@ vec_info::set_vinfo_for_stmt (gimple *stmt, stmt_vec_info info, bool check_ro)
|
|||
void
|
||||
vec_info::free_stmt_vec_infos (void)
|
||||
{
|
||||
unsigned int i;
|
||||
stmt_vec_info info;
|
||||
FOR_EACH_VEC_ELT (stmt_vec_infos, i, info)
|
||||
for (stmt_vec_info &info : stmt_vec_infos)
|
||||
if (info != NULL)
|
||||
free_stmt_vec_info (info);
|
||||
stmt_vec_infos.release ();
|
||||
|
|
Loading…
Add table
Reference in a new issue