aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-05-31 11:51:06 +0200
committerRichard Biener <rguenther@suse.de>2023-05-31 13:24:36 +0200
commita960f9ac76ec596b32ec1e64dad68c614aa3ca4d (patch)
treeabf5d09a86f35acecc78542c7bb19c5c782837b2 /gcc/tree-ssa-structalias.cc
parent11bd9b1f8133fc07c267e6d1aee8b01e06c7a750 (diff)
downloadgcc-a960f9ac76ec596b32ec1e64dad68c614aa3ca4d.zip
gcc-a960f9ac76ec596b32ec1e64dad68c614aa3ca4d.tar.gz
gcc-a960f9ac76ec596b32ec1e64dad68c614aa3ca4d.tar.bz2
IPA PTA stats enhancement and non-details dump slimming
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. * 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.
Diffstat (limited to 'gcc/tree-ssa-structalias.cc')
-rw-r--r--gcc/tree-ssa-structalias.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc
index 546dab5..9ded34c 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 ());