diff options
author | Richard Biener <rguenther@suse.de> | 2017-08-17 12:10:11 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-08-17 12:10:11 +0000 |
commit | d506d6ca5c62f430807ed42c7d57512af002640b (patch) | |
tree | d5a10399f205edcfc1ece2741e7696ee1c428d1b /gcc/tree-ssa-structalias.c | |
parent | b8d8d3ff49a530e6a2ea99d546f41497f3f96654 (diff) | |
download | gcc-d506d6ca5c62f430807ed42c7d57512af002640b.zip gcc-d506d6ca5c62f430807ed42c7d57512af002640b.tar.gz gcc-d506d6ca5c62f430807ed42c7d57512af002640b.tar.bz2 |
tree-ssa-structalias.c (solve_graph): When propagating to successors update the graphs succ edges and avoid duplicate...
2017-08-17 Richard Biener <rguenther@suse.de>
* tree-ssa-structalias.c (solve_graph): When propagating
to successors update the graphs succ edges and avoid duplicate work.
From-SVN: r251146
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index c95d1e3..2cca970 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2765,20 +2765,35 @@ solve_graph (constraint_graph_t graph) unsigned eff_escaped_id = find (escaped_id); /* Propagate solution to all successors. */ + unsigned to_remove = ~0U; EXECUTE_IF_IN_NONNULL_BITMAP (graph->succs[i], 0, j, bi) { - bitmap tmp; - bool flag; - + if (to_remove != ~0U) + { + bitmap_clear_bit (graph->succs[i], to_remove); + to_remove = ~0U; + } unsigned int to = find (j); - tmp = get_varinfo (to)->solution; - flag = false; - + if (to != j) + { + /* Update the succ graph, avoiding duplicate + work. */ + to_remove = j; + if (! bitmap_set_bit (graph->succs[i], to)) + continue; + /* We eventually end up processing 'to' twice + as it is undefined whether bitmap iteration + iterates over bits set during iteration. + Play safe instead of doing tricks. */ + } /* Don't try to propagate to ourselves. */ if (to == i) continue; + bitmap tmp = get_varinfo (to)->solution; + bool flag = false; + /* If we propagate from ESCAPED use ESCAPED as placeholder. */ if (i == eff_escaped_id) @@ -2789,6 +2804,8 @@ solve_graph (constraint_graph_t graph) if (flag) bitmap_set_bit (changed, to); } + if (to_remove != ~0U) + bitmap_clear_bit (graph->succs[i], to_remove); } } } |