> Hi,
> 
> currently, IPA-CP makes decisions to clone a function for all (known)
> contexts in the evaluation phase, in a separate sweep over the call
> graph from the decisions about cloning for values available only in
> certain contexts.  This patch moves it to the decision stage, which
> requires slightly more computation at the decision stage but the
> benefit/cost heuristics is also likely to be slightly better because
> it can be calculated using the call graph edges that remain after any
> cloning for special contexts.  Perhaps more importantly, it also
> allows us to do multiple decision sweeps over the call graph with
> different "parameters."

I believe the costs here should be pretty much OK - ipa-cp is not that
busy about evaulating the metrics (i.e. I never really saw it important
in the WPA profiles)
> 
> Bootstrapped, LTO-bootstrapped and tested on x86_64, OK for master?
> 
> Thanks,
> 
> Martin
> 
> 
> gcc/ChangeLog:
> 
> 2025-07-02  Martin Jambor  <[email protected]>
> 
>       * ipa-prop.h (ipa_node_params): Remove member do_clone_for_all_contexts.
>       (ipa_node_params::ipa_node_params): Do not initialize
>       do_clone_for_all_contexts.
>       * ipa-cp.cc (gather_context_independent_values): Remove parameter
>       calculate_aggs, calculate them always.
>       (estimate_local_effects): Move the decision whether to clone for
>       all context...
>       (decide_whether_version_node): ...here.  Fix dumps.
>       (decide_about_value): Adjust alignment in dumps.
OK,
Thanks,
Honza

Reply via email to