As part of the review of copy prop for aggregates, it was
mentioned there should be some statistics added, and I noticed
the memcpy->memset was missing the statistics too. So this adds
that.

gcc/ChangeLog:

        * tree-ssa-forwprop.cc (optimize_memcpy_to_memset): Adds
        statistics when the statement changed.

Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>
---
 gcc/tree-ssa-forwprop.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc
index e457a69ed48..81ea7d4195e 100644
--- a/gcc/tree-ssa-forwprop.cc
+++ b/gcc/tree-ssa-forwprop.cc
@@ -1324,6 +1324,7 @@ optimize_memcpy_to_memset (gimple_stmt_iterator *gsip, 
tree dest, tree src, tree
       tree ctor = build_constructor (TREE_TYPE (dest), NULL);
       gimple_assign_set_rhs_from_tree (gsip, ctor);
       update_stmt (stmt);
+      statistics_counter_event (cfun, "copy zeroing propagation of aggregate", 
1);
     }
   else /* If stmt is memcpy, transform it into memset.  */
     {
@@ -1333,6 +1334,7 @@ optimize_memcpy_to_memset (gimple_stmt_iterator *gsip, 
tree dest, tree src, tree
       gimple_call_set_fntype (call, TREE_TYPE (fndecl));
       gimple_call_set_arg (call, 1, val);
       update_stmt (stmt);
+      statistics_counter_event (cfun, "memcpy to memset changed", 1);
     }
 
   if (dump_file && (dump_flags & TDF_DETAILS))
-- 
2.43.0

Reply via email to