> 2020-09-01  Martin Jambor  <mjam...@suse.cz>
> 
>       * ipa-prop.h (ipa_auto_call_arg_values): New type.
>       (class ipa_call_arg_values): Likewise.
>       (ipa_get_indirect_edge_target): Replaced vector arguments with
>       ipa_call_arg_values in declaration.  Added an overload for
>       ipa_auto_call_arg_values.
>       * ipa-fnsummary.h (ipa_call_context): Removed members m_known_vals,
>       m_known_contexts, m_known_aggs, duplicate_from, release and equal_to,
>       new members m_avals, store_to_cache and equivalent_to_p.  Adjusted
>       construcotr arguments.
>       (estimate_ipcp_clone_size_and_time): Replaced vector arguments
>       with ipa_auto_call_arg_values in declaration.
>       (evaluate_properties_for_edge): Likewise.
>       * ipa-cp.c (ipa_get_indirect_edge_target): Adjusted to work on
>       ipa_call_arg_values rather than on separate vectors.  Added an
>       overload for ipa_auto_call_arg_values.
>       (devirtualization_time_bonus): Adjusted to work on
>       ipa_auto_call_arg_values rather than on separate vectors.
>       (gather_context_independent_values): Adjusted to work on
>       ipa_auto_call_arg_values rather than on separate vectors.
>       (perform_estimation_of_a_value): Likewise.
>       (estimate_local_effects): Likewise.
>       (modify_known_vectors_with_val): Adjusted both variants to work on
>       ipa_auto_call_arg_values and rename them to
>       copy_known_vectors_add_val.
>       (decide_about_value): Adjusted to work on ipa_call_arg_values rather
>       than on separate vectors.
>       (decide_whether_version_node): Likewise.
>       * ipa-fnsummary.c (evaluate_conditions_for_known_args): Likewise.
>       (evaluate_properties_for_edge): Likewise.
>       (ipa_fn_summary_t::duplicate): Likewise.
>       (estimate_edge_devirt_benefit): Adjusted to work on
>       ipa_call_arg_values rather than on separate vectors.
>       (estimate_edge_size_and_time): Likewise.
>       (estimate_calls_size_and_time_1): Likewise.
>       (summarize_calls_size_and_time): Adjusted calls to
>       estimate_edge_size_and_time.
>       (estimate_calls_size_and_time): Adjusted to work on
>       ipa_call_arg_values rather than on separate vectors.
>       (ipa_call_context::ipa_call_context): Construct from a pointer to
>       ipa_auto_call_arg_values instead of inividual vectors.
>       (ipa_call_context::duplicate_from): Adjusted to access vectors within
>       m_avals.
>       (ipa_call_context::release): Likewise.
>       (ipa_call_context::equal_to): Likewise.
>       (ipa_call_context::estimate_size_and_time): Adjusted to work on
>       ipa_call_arg_values rather than on separate vectors.
>       (estimate_ipcp_clone_size_and_time): Adjusted to work with
>       ipa_auto_call_arg_values rather than on separate vectors.
>       (ipa_merge_fn_summary_after_inlining): Likewise.  Adjusted call to
>       estimate_edge_size_and_time.
>       (ipa_update_overall_fn_summary): Adjusted call to
>       estimate_edge_size_and_time.
>       * ipa-inline-analysis.c (do_estimate_edge_time): Adjusted to work with
>       ipa_auto_call_arg_values rather than with separate vectors.
>       (do_estimate_edge_size): Likewise.
>       (do_estimate_edge_hints): Likewise.
>       * ipa-prop.c (ipa_auto_call_arg_values::~ipa_auto_call_arg_values):
>       New destructor.

> @@ -328,14 +326,9 @@ private:
>    /* Inline summary maintains info about change probabilities.  */
>    vec<inline_param_summary> m_inline_param_summary;
>  
> -  /* The following is used only to resolve indirect calls.  */
> -
> -  /* Vector describing known values of parameters.  */
> -  vec<tree> m_known_vals;
> -  /* Vector describing known polymorphic call contexts.  */
> -  vec<ipa_polymorphic_call_context> m_known_contexts;
> -  /* Vector describing known aggregate values.  */
> -  vec<ipa_agg_value_set> m_known_aggs;
> +  /* Even after having calculated clauses, the information about argument
> +     values is used to resolve indirect calls.  */
> +  ipa_call_arg_values m_avals;

In cached context we keep the vectors populated only if they are going
to be used by the predicates.  Is this preserved?

Otherwise the patch looks OK.  It would be nice to test it on building
bigger project and see how memory allocation is affeced by your change.

Honza

Reply via email to