On Fri, Oct 30, 2020 at 7:59 PM Martin Jambor <mjam...@suse.cz> wrote: > > Hi, > > Martin Liška has been asking me to add debug counters to the IPA-CP pass so > that testcase reductions are easier. The pass already has one for the bit > value propagation, so this patch adds one for value_range propagation > and one for the actual constant propagation. > > Passed bootstrap and testing on x86_64-linux. OK for trunk?
OK > Thanks, > > Martin > > > gcc/ChangeLog: > > 2020-10-30 Martin Jambor <mjam...@suse.cz> > > * dbgcnt.def (ipa_cp_values): New counter. > (ipa_cp_vr): Likewise. > * ipa-cp.c (decide_about_value): Check and bump ipa_cp_values debug > counter. > (decide_whether_version_node): Likewise. > (ipcp_store_vr_results):Check and bump ipa_cp_vr debug counter. > --- > gcc/dbgcnt.def | 2 ++ > gcc/ipa-cp.c | 12 +++++++++++- > 2 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def > index 07946a85ecc..a5b6bb66a6c 100644 > --- a/gcc/dbgcnt.def > +++ b/gcc/dbgcnt.def > @@ -171,6 +171,8 @@ DEBUG_COUNTER (if_after_reload) > DEBUG_COUNTER (if_conversion) > DEBUG_COUNTER (if_conversion_tree) > DEBUG_COUNTER (ipa_cp_bits) > +DEBUG_COUNTER (ipa_cp_values) > +DEBUG_COUNTER (ipa_cp_vr) > DEBUG_COUNTER (ipa_mod_ref) > DEBUG_COUNTER (ipa_sra_params) > DEBUG_COUNTER (ipa_sra_retvalues) > diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c > index f981366a345..9895548fc35 100644 > --- a/gcc/ipa-cp.c > +++ b/gcc/ipa-cp.c > @@ -5462,6 +5462,9 @@ decide_about_value (struct cgraph_node *node, int > index, HOST_WIDE_INT offset, > &caller_count)) > return false; > > + if (!dbg_cnt (ipa_cp_values)) > + return false; > + > if (dump_file && (dump_flags & TDF_DETAILS)) > { > fprintf (dump_file, " - considering value "); > @@ -5577,6 +5580,12 @@ decide_whether_version_node (struct cgraph_node *node) > > if (info->do_clone_for_all_contexts) > { > + if (!dbg_cnt (ipa_cp_values)) > + { > + info->do_clone_for_all_contexts = false; > + return ret; > + } > + > struct cgraph_node *clone; > vec<cgraph_edge *> callers = node->collect_callers (); > > @@ -5864,7 +5873,8 @@ ipcp_store_vr_results (void) > ipa_vr vr; > > if (!plats->m_value_range.bottom_p () > - && !plats->m_value_range.top_p ()) > + && !plats->m_value_range.top_p () > + && dbg_cnt (ipa_cp_vr)) > { > vr.known = true; > vr.type = plats->m_value_range.m_vr.kind (); > -- > 2.28.0 >