ipa-cp: New debug counters for IPA-CP

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.

gcc/ChangeLog:

2020-10-30  Martin Jambor  <mjambor@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.
This commit is contained in:
Martin Jambor 2020-11-02 15:43:28 +01:00
parent 637aeb6b8d
commit 86deadf8d3
2 changed files with 13 additions and 1 deletions

View file

@ -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)

View file

@ -5469,6 +5469,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 ");
@ -5584,6 +5587,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 ();
@ -5871,7 +5880,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 ();