The following keeps track of the number of edges we avoid to create because they redundandly feed ESCAPED. It also avoids printing a header for -details when not using -details.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-structalias.cc (constraint_stats::num_avoided_edges): New. (add_graph_edge): Count redundant edges we avoid to create. (dump_sa_stats): Dump them. (ipa_pta_execute): Do not dump generating constraints when we are not dumping them. --- gcc/tree-ssa-structalias.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index 546dab5035e..9ded34c1dd1 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -237,6 +237,7 @@ static struct constraint_stats unsigned int iterations; unsigned int num_edges; unsigned int num_implicit_edges; + unsigned int num_avoided_edges; unsigned int points_to_sets_created; } stats; @@ -1213,7 +1214,10 @@ add_graph_edge (constraint_graph_t graph, unsigned int to, if (to < FIRST_REF_NODE && bitmap_bit_p (graph->succs[from], find (escaped_id)) && bitmap_bit_p (get_varinfo (find (to))->solution, escaped_id)) - return false; + { + stats.num_avoided_edges++; + return false; + } if (bitmap_set_bit (graph->succs[from], to)) { @@ -7164,6 +7168,8 @@ dump_sa_stats (FILE *outfile) fprintf (outfile, "Number of edges: %d\n", stats.num_edges); fprintf (outfile, "Number of implicit edges: %d\n", stats.num_implicit_edges); + fprintf (outfile, "Number of avoided edges: %d\n", + stats.num_avoided_edges); } /* Dump points-to information to OUTFILE. */ @@ -8427,7 +8433,7 @@ ipa_pta_execute (void) || node->clone_of) continue; - if (dump_file) + if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "Generating constraints for %s", node->dump_name ()); -- 2.35.3