+2019-10-27 Jan Hubicka <hubicka@ucw.cz>
+
+ * ipa-cp.c (propagate_constants_across_call): If args are not available
+ just drop everything to varying.
+ (find_aggregate_values_for_callers_subset): Watch for missing
+ edge summary.
+ (find_more_scalar_values_for_callers_subs): Likewise.
+ * ipa-prop.c (ipa_compute_jump_functions_for_edge,
+ update_jump_functions_after_inlining, propagate_controlled_uses):
+ Watch for missing summaries.
+ (ipa_propagate_indirect_call_infos): Remove summary after propagation
+ is finished.
+ (ipa_write_node_info): Watch for missing summaries.
+ (ipa_read_edge_info): Create new ref.
+ (ipa_edge_args_sum_t): Add remove.
+ (IPA_EDGE_REF_GET_CREATE): New macro.
+ * ipa-fnsummary.c (evaluate_properties_for_edge): Watch for missing
+ edge summary.
+ (remap_edge_change_prob): Likewise.
+
2019-10-27 Jan Hubicka <hubicka@ucw.cz>
* ipa-inline-transform.c (inline_call): update function summaries
callee_info = IPA_NODE_REF (callee);
args = IPA_EDGE_REF (cs);
- args_count = ipa_get_cs_argument_count (args);
parms_count = ipa_get_param_count (callee_info);
if (parms_count == 0)
return false;
+ if (!args)
+ {
+ for (i = 0; i < parms_count; i++)
+ ret |= set_all_contains_variable (ipa_get_parm_lattices (callee_info,
+ i));
+ return ret;
+ }
+ args_count = ipa_get_cs_argument_count (args);
/* If this call goes through a thunk we must not propagate to the first (0th)
parameter. However, we might need to uncover a thunk from below a series
if (IPA_NODE_REF (cs->caller)->node_dead)
continue;
- if (i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
+ if (!IPA_EDGE_REF (cs)
+ || i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
|| (i == 0
&& call_passes_through_thunk_p (cs)))
{
FOR_EACH_VEC_ELT (callers, j, cs)
{
- if (i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs)))
+ if (!IPA_EDGE_REF (cs)
+ || i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs)))
return;
ipa_jump_func *jfunc = ipa_get_ith_jump_func (IPA_EDGE_REF (cs),
i);
FOR_EACH_VEC_ELT (callers, j, cs)
{
+ if (!IPA_EDGE_REF (cs))
+ {
+ count = 0;
+ break;
+ }
int c = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
if (c < count)
count = c;
class ipa_fn_summary *info = ipa_fn_summaries->get (callee);
vec<tree> known_vals = vNULL;
vec<ipa_agg_jump_function_p> known_aggs = vNULL;
+ class ipa_edge_args *args;
if (clause_ptr)
*clause_ptr = inline_p ? 0 : 1 << predicate::not_inlined_condition;
if (ipa_node_params_sum
&& !e->call_stmt_cannot_inline_p
- && ((clause_ptr && info->conds) || known_vals_ptr || known_contexts_ptr))
+ && ((clause_ptr && info->conds) || known_vals_ptr || known_contexts_ptr)
+ && (args = IPA_EDGE_REF (e)) != NULL)
{
class ipa_node_params *caller_parms_info, *callee_pi;
- class ipa_edge_args *args = IPA_EDGE_REF (e);
class ipa_call_summary *es = ipa_call_summaries->get (e);
int i, count = ipa_get_cs_argument_count (args);
{
int i;
class ipa_edge_args *args = IPA_EDGE_REF (edge);
+ if (!args)
+ return;
class ipa_call_summary *es = ipa_call_summaries->get (edge);
class ipa_call_summary *inlined_es
= ipa_call_summaries->get (inlined_edge);
struct cgraph_edge *cs)
{
class ipa_node_params *info = IPA_NODE_REF (cs->caller);
- class ipa_edge_args *args = IPA_EDGE_REF (cs);
+ class ipa_edge_args *args = IPA_EDGE_REF_GET_CREATE (cs);
gcall *call = cs->call_stmt;
int n, arg_num = gimple_call_num_args (call);
bool useful_context = false;
{
class ipa_edge_args *top = IPA_EDGE_REF (cs);
class ipa_edge_args *args = IPA_EDGE_REF (e);
+ if (!args)
+ return;
int count = ipa_get_cs_argument_count (args);
int i;
propagate_controlled_uses (struct cgraph_edge *cs)
{
class ipa_edge_args *args = IPA_EDGE_REF (cs);
+ if (!args)
+ return;
struct cgraph_node *new_root = cs->caller->global.inlined_to
? cs->caller->global.inlined_to : cs->caller;
class ipa_node_params *new_root_info = IPA_NODE_REF (new_root);
propagate_controlled_uses (cs);
changed = propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
+ ipa_edge_args_sum->remove (cs);
return changed;
}
{
class ipa_edge_args *args = IPA_EDGE_REF (e);
+ if (!args)
+ {
+ streamer_write_uhwi (ob, 0);
+ continue;
+ }
+
streamer_write_uhwi (ob,
ipa_get_cs_argument_count (args) * 2
+ (args->polymorphic_call_contexts != NULL));
for (e = node->indirect_calls; e; e = e->next_callee)
{
class ipa_edge_args *args = IPA_EDGE_REF (e);
-
- streamer_write_uhwi (ob,
- ipa_get_cs_argument_count (args) * 2
- + (args->polymorphic_call_contexts != NULL));
- for (j = 0; j < ipa_get_cs_argument_count (args); j++)
+ if (!args)
+ streamer_write_uhwi (ob, 0);
+ else
{
- ipa_write_jump_function (ob, ipa_get_ith_jump_func (args, j));
- if (args->polymorphic_call_contexts != NULL)
- ipa_get_ith_polymorhic_call_context (args, j)->stream_out (ob);
+ streamer_write_uhwi (ob,
+ ipa_get_cs_argument_count (args) * 2
+ + (args->polymorphic_call_contexts != NULL));
+ for (j = 0; j < ipa_get_cs_argument_count (args); j++)
+ {
+ ipa_write_jump_function (ob, ipa_get_ith_jump_func (args, j));
+ if (args->polymorphic_call_contexts != NULL)
+ ipa_get_ith_polymorhic_call_context (args, j)->stream_out (ob);
+ }
}
ipa_write_indirect_edge_info (ob, e);
}
return;
if (prevails && e->possibly_call_in_translation_unit_p ())
{
- class ipa_edge_args *args = IPA_EDGE_REF (e);
+ class ipa_edge_args *args = IPA_EDGE_REF_GET_CREATE (e);
vec_safe_grow_cleared (args->jump_functions, count);
if (contexts_computed)
vec_safe_grow_cleared (args->polymorphic_call_contexts, count);
ipa_edge_args_sum_t (symbol_table *table, bool ggc)
: call_summary<ipa_edge_args *> (table, ggc) { }
+ void remove (cgraph_edge *edge)
+ {
+ call_summary <ipa_edge_args *>::remove (edge);
+ }
+
/* Hook that is called by summary when an edge is removed. */
virtual void remove (cgraph_edge *cs, ipa_edge_args *args);
/* Hook that is called by summary when an edge is duplicated. */
/* Return the associated parameter/argument info corresponding to the given
node/edge. */
#define IPA_NODE_REF(NODE) (ipa_node_params_sum->get_create (NODE))
-#define IPA_EDGE_REF(EDGE) (ipa_edge_args_sum->get_create (EDGE))
+#define IPA_EDGE_REF(EDGE) (ipa_edge_args_sum->get (EDGE))
+#define IPA_EDGE_REF_GET_CREATE(EDGE) (ipa_edge_args_sum->get_create (EDGE))
/* This macro checks validity of index returned by
ipa_get_param_decl_index function. */
#define IS_VALID_JUMP_FUNC_INDEX(I) ((I) != -1)