Commit 155c9907 by Jakub Jelinek Committed by Jakub Jelinek

ipa-cp.c (class ipcp_bits_lattice): Formatting fixes.

	* ipa-cp.c (class ipcp_bits_lattice): Formatting fixes.
	(print_ipcp_constant_value): Likewise.
	(ipcp_cloning_candidate_p): Likewise.
	(ipcp_bits_lattice::get_value_and_mask): Likewise.
	(ipcp_bits_lattice::meet_with_1): Likewise.
	(ipcp_bits_lattice::meet_with): Likewise.
	(initialize_node_lattices): Likewise.
	(ipcp_lattice::add_value): Likewise.
	(propagate_vals_accross_pass_through): Renamed to ...
	(propagate_vals_across_pass_through): ... this function.
	(propagate_vals_accross_ancestor): Renamed to ...
	(propagate_vals_across_ancestor): ... this.
	(propagate_scalar_accross_jump_function): Renamed to ...
	(propagate_scalar_across_jump_function): ... this.
	Adjust calls to above functions.
	(propagate_context_accross_jump_function): Renamed to ...
	(propagate_context_across_jump_function): ... this.
	(propagate_bits_accross_jump_function): Renamed to ...
	(propagate_bits_accross_jump_function): ... this.  Formatting fixes.
	(propagate_vr_accross_jump_function): Renamed to ...
	(propagate_vr_across_jump_function): ... this.
	(merge_agg_lats_step): Formatting fixes.
	(propagate_constants_accross_call): Renamed to ...
	(propagate_constants_across_call): ... this.  Adjust calls to above
	functions.
	(ipa_get_indirect_edge_target_1): Formatting fixes.
	(gather_context_independent_values): Likewise.
	(estimate_local_effects): Likewise.
	(add_all_node_vals_to_toposort): Likewise.
	(propagate_constants_topo): Adjust calls to above functions.
	(get_replacement_map): Formatting fixes.
	(dump_profile_updates): Likewise.
	(update_profiling_info): Likewise.
	(update_specialized_profile): Likewise.
	(create_specialized_node): Likewise.
	(find_more_contexts_for_caller_subset): Likewise.
	(decide_whether_version_node): Likewise.
	(identify_dead_nodes): Likewise.
	(ipcp_decision_stage): Likewise.
	(ipcp_store_bits_results): Likewise.
	(ipcp_store_vr_results): Likewise.
	(ipcp_driver): Likewise.

From-SVN: r243725
parent ce7888da
2016-12-15 Jakub Jelinek <jakub@redhat.com>
* ipa-cp.c (class ipcp_bits_lattice): Formatting fixes.
(print_ipcp_constant_value): Likewise.
(ipcp_cloning_candidate_p): Likewise.
(ipcp_bits_lattice::get_value_and_mask): Likewise.
(ipcp_bits_lattice::meet_with_1): Likewise.
(ipcp_bits_lattice::meet_with): Likewise.
(initialize_node_lattices): Likewise.
(ipcp_lattice::add_value): Likewise.
(propagate_vals_accross_pass_through): Renamed to ...
(propagate_vals_across_pass_through): ... this function.
(propagate_vals_accross_ancestor): Renamed to ...
(propagate_vals_across_ancestor): ... this.
(propagate_scalar_accross_jump_function): Renamed to ...
(propagate_scalar_across_jump_function): ... this.
Adjust calls to above functions.
(propagate_context_accross_jump_function): Renamed to ...
(propagate_context_across_jump_function): ... this.
(propagate_bits_accross_jump_function): Renamed to ...
(propagate_bits_accross_jump_function): ... this. Formatting fixes.
(propagate_vr_accross_jump_function): Renamed to ...
(propagate_vr_across_jump_function): ... this.
(merge_agg_lats_step): Formatting fixes.
(propagate_constants_accross_call): Renamed to ...
(propagate_constants_across_call): ... this. Adjust calls to above
functions.
(ipa_get_indirect_edge_target_1): Formatting fixes.
(gather_context_independent_values): Likewise.
(estimate_local_effects): Likewise.
(add_all_node_vals_to_toposort): Likewise.
(propagate_constants_topo): Adjust calls to above functions.
(get_replacement_map): Formatting fixes.
(dump_profile_updates): Likewise.
(update_profiling_info): Likewise.
(update_specialized_profile): Likewise.
(create_specialized_node): Likewise.
(find_more_contexts_for_caller_subset): Likewise.
(decide_whether_version_node): Likewise.
(identify_dead_nodes): Likewise.
(ipcp_decision_stage): Likewise.
(ipcp_store_bits_results): Likewise.
(ipcp_store_vr_results): Likewise.
(ipcp_driver): Likewise.
2016-12-15 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/78680
......@@ -1165,7 +1165,7 @@ initialize_node_lattices (struct cgraph_node *node)
disable = true;
}
for (i = 0; i < ipa_get_param_count (info) ; i++)
for (i = 0; i < ipa_get_param_count (info); i++)
{
struct ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
plats->m_value_range.init ();
......@@ -1173,7 +1173,7 @@ initialize_node_lattices (struct cgraph_node *node)
if (disable || variable)
{
for (i = 0; i < ipa_get_param_count (info) ; i++)
for (i = 0; i < ipa_get_param_count (info); i++)
{
struct ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
if (disable)
......@@ -1509,7 +1509,7 @@ ipcp_lattice<valtype>::add_value (valtype newval, cgraph_edge *cs,
if (ipa_edge_within_scc (cs))
{
ipcp_value_source<valtype> *s;
for (s = val->sources; s ; s = s->next)
for (s = val->sources; s; s = s->next)
if (s->cs == cs)
break;
if (s)
......@@ -1551,11 +1551,9 @@ ipcp_lattice<valtype>::add_value (valtype newval, cgraph_edge *cs,
is the index of the source parameter. */
static bool
propagate_vals_accross_pass_through (cgraph_edge *cs,
ipa_jump_func *jfunc,
propagate_vals_across_pass_through (cgraph_edge *cs, ipa_jump_func *jfunc,
ipcp_lattice<tree> *src_lat,
ipcp_lattice<tree> *dest_lat,
int src_idx)
ipcp_lattice<tree> *dest_lat, int src_idx)
{
ipcp_value<tree> *src_val;
bool ret = false;
......@@ -1585,11 +1583,10 @@ propagate_vals_accross_pass_through (cgraph_edge *cs,
is the index of the source parameter. */
static bool
propagate_vals_accross_ancestor (struct cgraph_edge *cs,
propagate_vals_across_ancestor (struct cgraph_edge *cs,
struct ipa_jump_func *jfunc,
ipcp_lattice<tree> *src_lat,
ipcp_lattice<tree> *dest_lat,
int src_idx)
ipcp_lattice<tree> *dest_lat, int src_idx)
{
ipcp_value<tree> *src_val;
bool ret = false;
......@@ -1614,7 +1611,7 @@ propagate_vals_accross_ancestor (struct cgraph_edge *cs,
edge CS and put the values into DEST_LAT. */
static bool
propagate_scalar_accross_jump_function (struct cgraph_edge *cs,
propagate_scalar_across_jump_function (struct cgraph_edge *cs,
struct ipa_jump_func *jfunc,
ipcp_lattice<tree> *dest_lat)
{
......@@ -1650,10 +1647,10 @@ propagate_scalar_accross_jump_function (struct cgraph_edge *cs,
return dest_lat->set_contains_variable ();
if (jfunc->type == IPA_JF_PASS_THROUGH)
ret = propagate_vals_accross_pass_through (cs, jfunc, src_lat,
ret = propagate_vals_across_pass_through (cs, jfunc, src_lat,
dest_lat, src_idx);
else
ret = propagate_vals_accross_ancestor (cs, jfunc, src_lat, dest_lat,
ret = propagate_vals_across_ancestor (cs, jfunc, src_lat, dest_lat,
src_idx);
if (src_lat->contains_variable)
......@@ -1671,7 +1668,7 @@ propagate_scalar_accross_jump_function (struct cgraph_edge *cs,
edge CS and describes argument IDX and put the values into DEST_LAT. */
static bool
propagate_context_accross_jump_function (cgraph_edge *cs,
propagate_context_across_jump_function (cgraph_edge *cs,
ipa_jump_func *jfunc, int idx,
ipcp_lattice<ipa_polymorphic_call_context> *dest_lat)
{
......@@ -1758,7 +1755,8 @@ propagate_context_accross_jump_function (cgraph_edge *cs,
edge cs and update dest_lattice accordingly. */
bool
propagate_bits_accross_jump_function (cgraph_edge *cs, int idx, ipa_jump_func *jfunc,
propagate_bits_across_jump_function (cgraph_edge *cs, int idx,
ipa_jump_func *jfunc,
ipcp_bits_lattice *dest_lattice)
{
if (dest_lattice->bottom_p ())
......@@ -1844,8 +1842,7 @@ propagate_bits_accross_jump_function (cgraph_edge *cs, int idx, ipa_jump_func *j
accordingly. */
static bool
propagate_vr_accross_jump_function (cgraph_edge *cs,
ipa_jump_func *jfunc,
propagate_vr_across_jump_function (cgraph_edge *cs, ipa_jump_func *jfunc,
struct ipcp_param_lattices *dest_plats,
tree param_type)
{
......@@ -2090,7 +2087,7 @@ agg_pass_through_permissible_p (struct ipcp_param_lattices *src_plats,
edge CS and put the values into DEST_LAT. */
static bool
propagate_aggs_accross_jump_function (struct cgraph_edge *cs,
propagate_aggs_across_jump_function (struct cgraph_edge *cs,
struct ipa_jump_func *jfunc,
struct ipcp_param_lattices *dest_plats)
{
......@@ -2192,7 +2189,7 @@ call_passes_through_thunk_p (cgraph_edge *cs)
caller. */
static bool
propagate_constants_accross_call (struct cgraph_edge *cs)
propagate_constants_across_call (struct cgraph_edge *cs)
{
struct ipa_node_params *callee_info;
enum availability availability;
......@@ -2254,18 +2251,18 @@ propagate_constants_accross_call (struct cgraph_edge *cs)
ret |= set_all_contains_variable (dest_plats);
else
{
ret |= propagate_scalar_accross_jump_function (cs, jump_func,
ret |= propagate_scalar_across_jump_function (cs, jump_func,
&dest_plats->itself);
ret |= propagate_context_accross_jump_function (cs, jump_func, i,
ret |= propagate_context_across_jump_function (cs, jump_func, i,
&dest_plats->ctxlat);
ret |= propagate_bits_accross_jump_function (cs, i, jump_func,
ret
|= propagate_bits_across_jump_function (cs, i, jump_func,
&dest_plats->bits_lattice);
ret |= propagate_aggs_accross_jump_function (cs, jump_func,
ret |= propagate_aggs_across_jump_function (cs, jump_func,
dest_plats);
if (opt_for_fn (callee->decl, flag_ipa_vrp))
ret |= propagate_vr_accross_jump_function (cs,
jump_func, dest_plats,
param_type);
ret |= propagate_vr_across_jump_function (cs, jump_func,
dest_plats, param_type);
else
ret |= dest_plats->m_value_range.set_to_bottom ();
}
......@@ -2341,8 +2338,8 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
else
t = known_csts[param_index];
if (t &&
TREE_CODE (t) == ADDR_EXPR
if (t
&& TREE_CODE (t) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL)
return TREE_OPERAND (t, 0);
else
......@@ -2381,8 +2378,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
struct ipa_agg_jump_function *agg;
agg = known_aggs[param_index];
t = ipa_find_agg_cst_for_param (agg, known_csts[param_index],
ie->indirect_info->offset,
true);
ie->indirect_info->offset, true);
}
/* If we found the virtual table pointer, lookup the target. */
......@@ -2702,7 +2698,7 @@ gather_context_independent_values (struct ipa_node_params *info,
if (removable_params_cost)
*removable_params_cost = 0;
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
{
struct ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
ipcp_lattice<tree> *lat = &plats->itself;
......@@ -2888,7 +2884,7 @@ estimate_local_effects (struct cgraph_node *node)
}
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
{
struct ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
ipcp_lattice<tree> *lat = &plats->itself;
......@@ -2957,7 +2953,7 @@ estimate_local_effects (struct cgraph_node *node)
known_contexts[i] = ipa_polymorphic_call_context ();
}
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
{
struct ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
struct ipa_agg_jump_function *ajf;
......@@ -3006,7 +3002,7 @@ estimate_local_effects (struct cgraph_node *node)
}
}
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
vec_free (known_aggs[i].items);
known_csts.release ();
......@@ -3079,7 +3075,7 @@ add_all_node_vals_to_toposort (cgraph_node *node, ipa_topo_info *topo)
struct ipa_node_params *info = IPA_NODE_REF (node);
int i, count = ipa_get_param_count (info);
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
{
struct ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
ipcp_lattice<tree> *lat = &plats->itself;
......@@ -3141,7 +3137,7 @@ propagate_constants_topo (struct ipa_topo_info *topo)
if (ipa_edge_within_scc (cs))
{
IPA_NODE_REF (v)->node_within_scc = true;
if (propagate_constants_accross_call (cs))
if (propagate_constants_across_call (cs))
push_node_to_stack (topo, cs->callee->function_symbol ());
}
v = pop_node_from_stack (topo);
......@@ -3159,7 +3155,7 @@ propagate_constants_topo (struct ipa_topo_info *topo)
add_all_node_vals_to_toposort (v, topo);
for (cs = v->callees; cs; cs = cs->next_callee)
if (!ipa_edge_within_scc (cs))
propagate_constants_accross_call (cs);
propagate_constants_across_call (cs);
}
cycle_nodes.release ();
}
......@@ -3613,14 +3609,14 @@ dump_profile_updates (struct cgraph_node *orig_node,
fprintf (dump_file, " setting count of the specialized node to "
HOST_WIDE_INT_PRINT_DEC "\n", (HOST_WIDE_INT) new_node->count);
for (cs = new_node->callees; cs ; cs = cs->next_callee)
for (cs = new_node->callees; cs; cs = cs->next_callee)
fprintf (dump_file, " edge to %s has count "
HOST_WIDE_INT_PRINT_DEC "\n",
cs->callee->name (), (HOST_WIDE_INT) cs->count);
fprintf (dump_file, " setting count of the original node to "
HOST_WIDE_INT_PRINT_DEC "\n", (HOST_WIDE_INT) orig_node->count);
for (cs = orig_node->callees; cs ; cs = cs->next_callee)
for (cs = orig_node->callees; cs; cs = cs->next_callee)
fprintf (dump_file, " edge to %s is left with "
HOST_WIDE_INT_PRINT_DEC "\n",
cs->callee->name (), (HOST_WIDE_INT) cs->count);
......@@ -3671,7 +3667,7 @@ update_profiling_info (struct cgraph_node *orig_node,
remainder = orig_node_count - new_sum;
orig_node->count = remainder;
for (cs = new_node->callees; cs ; cs = cs->next_callee)
for (cs = new_node->callees; cs; cs = cs->next_callee)
if (cs->frequency)
cs->count = apply_probability (cs->count,
GCOV_COMPUTE_SCALE (new_sum,
......@@ -3679,7 +3675,7 @@ update_profiling_info (struct cgraph_node *orig_node,
else
cs->count = 0;
for (cs = orig_node->callees; cs ; cs = cs->next_callee)
for (cs = orig_node->callees; cs; cs = cs->next_callee)
cs->count = apply_probability (cs->count,
GCOV_COMPUTE_SCALE (remainder,
orig_node_count));
......@@ -3712,7 +3708,7 @@ update_specialized_profile (struct cgraph_node *new_node,
new_node->count += redirected_sum;
orig_node->count -= redirected_sum;
for (cs = new_node->callees; cs ; cs = cs->next_callee)
for (cs = new_node->callees; cs; cs = cs->next_callee)
if (cs->frequency)
cs->count += apply_probability (cs->count,
GCOV_COMPUTE_SCALE (redirected_sum,
......@@ -3720,7 +3716,7 @@ update_specialized_profile (struct cgraph_node *new_node,
else
cs->count = 0;
for (cs = orig_node->callees; cs ; cs = cs->next_callee)
for (cs = orig_node->callees; cs; cs = cs->next_callee)
{
gcov_type dec = apply_probability (cs->count,
GCOV_COMPUTE_SCALE (redirected_sum,
......@@ -3773,7 +3769,7 @@ create_specialized_node (struct cgraph_node *node,
fprintf (dump_file, " cannot change function signature\n");
}
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
{
tree t = known_csts[i];
if (t)
......@@ -3799,7 +3795,7 @@ create_specialized_node (struct cgraph_node *node,
new_node->name (), new_node->order);
if (known_contexts.exists ())
{
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
if (!known_contexts[i].useless_p ())
{
fprintf (dump_file, " known ctx %i is ", i);
......@@ -3833,7 +3829,7 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node,
struct ipa_node_params *info = IPA_NODE_REF (node);
int i, count = ipa_get_param_count (info);
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
{
struct cgraph_edge *cs;
tree newval = NULL_TREE;
......@@ -3901,7 +3897,7 @@ find_more_contexts_for_caller_subset (cgraph_node *node,
ipa_node_params *info = IPA_NODE_REF (node);
int i, count = ipa_get_param_count (info);
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
{
cgraph_edge *cs;
......@@ -4235,7 +4231,7 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node,
count = c;
}
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
{
struct cgraph_edge *cs;
vec<ipa_agg_jf_item> inter = vNULL;
......@@ -4646,7 +4642,7 @@ decide_whether_version_node (struct cgraph_node *node)
info->do_clone_for_all_contexts ? &known_aggs
: NULL, NULL);
for (i = 0; i < count ;i++)
for (i = 0; i < count;i++)
{
struct ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
ipcp_lattice<tree> *lat = &plats->itself;
......@@ -4711,7 +4707,7 @@ decide_whether_version_node (struct cgraph_node *node)
info = IPA_NODE_REF (node);
info->do_clone_for_all_contexts = false;
IPA_NODE_REF (clone)->is_all_contexts_clone = true;
for (i = 0; i < count ; i++)
for (i = 0; i < count; i++)
vec_free (known_aggs[i].items);
known_aggs.release ();
ret = true;
......@@ -4777,19 +4773,19 @@ static void
identify_dead_nodes (struct cgraph_node *node)
{
struct cgraph_node *v;
for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (v->local.local
&& !v->call_for_symbol_thunks_and_aliases
(has_undead_caller_from_outside_scc_p, NULL, true))
IPA_NODE_REF (v)->node_dead = 1;
for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (!IPA_NODE_REF (v)->node_dead)
spread_undeadness (v);
if (dump_file && (dump_flags & TDF_DETAILS))
{
for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (IPA_NODE_REF (v)->node_dead)
fprintf (dump_file, " Marking node as dead: %s/%i.\n",
v->name (), v->order);
......@@ -4816,7 +4812,7 @@ ipcp_decision_stage (struct ipa_topo_info *topo)
{
struct cgraph_node *v;
iterate = false;
for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (v->has_gimple_body_p ()
&& ipcp_versionable_function_p (v))
iterate |= decide_whether_version_node (v);
......@@ -4930,7 +4926,7 @@ ipcp_store_vr_results (void)
info = IPA_NODE_REF (info->ipcp_orig_node);
unsigned count = ipa_get_param_count (info);
for (unsigned i = 0; i < count ; i++)
for (unsigned i = 0; i < count; i++)
{
ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
if (!plats->m_value_range.bottom_p ()
......@@ -4947,7 +4943,7 @@ ipcp_store_vr_results (void)
ipcp_transformation_summary *ts = ipcp_get_transformation_summary (node);
vec_safe_reserve_exact (ts->m_vr, count);
for (unsigned i = 0; i < count ; i++)
for (unsigned i = 0; i < count; i++)
{
ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
ipa_vr vr;
......@@ -4983,10 +4979,10 @@ ipcp_driver (void)
ipa_check_create_node_params ();
ipa_check_create_edge_args ();
grow_edge_clone_vectors ();
edge_duplication_hook_holder =
symtab->add_edge_duplication_hook (&ipcp_edge_duplication_hook, NULL);
edge_removal_hook_holder =
symtab->add_edge_removal_hook (&ipcp_edge_removal_hook, NULL);
edge_duplication_hook_holder
= symtab->add_edge_duplication_hook (&ipcp_edge_duplication_hook, NULL);
edge_removal_hook_holder
= symtab->add_edge_removal_hook (&ipcp_edge_removal_hook, NULL);
if (dump_file)
{
......
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