From: Andrew Pinski Date: Mon, 26 May 2025 21:40:12 +0000 (-0700) Subject: forwprop: Add stats for memcpy->memset X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4a4cf89f90bb1f618e97ae7deb59542a7421107;p=thirdparty%2Fgcc.git forwprop: Add stats for memcpy->memset 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 --- 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))