]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove special-cased edges when solving copies
authorRichard Biener <rguenther@suse.de>
Wed, 15 Mar 2023 07:46:04 +0000 (08:46 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 19 Apr 2023 12:14:14 +0000 (14:14 +0200)
The following makes sure to remove the copy edges we ignore or
need to special-case only once.

* tree-ssa-structalias.cc (solve_graph): Remove self-copy
edges, remove edges from escaped after special-casing them.

gcc/tree-ssa-structalias.cc

index 4f350bfbfc031ae1743daf236dbe90e28fbdf867..39c342fae417e334c48401e13b7d2d5861e6f12f 100644 (file)
@@ -2873,19 +2873,22 @@ solve_graph (constraint_graph_t graph)
                        }
                      /* 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.  */
+                       {
+                         to_remove = j;
+                         continue;
+                       }
+                     /* Early node unification can lead to edges from
+                        escaped - remove them.  */
                      if (i == eff_escaped_id)
-                       flag = bitmap_set_bit (tmp, escaped_id);
-                     else
-                       flag = bitmap_ior_into (tmp, pts);
+                       {
+                         to_remove = j;
+                         if (bitmap_set_bit (get_varinfo (to)->solution,
+                                             escaped_id))
+                           bitmap_set_bit (changed, to);
+                         continue;
+                       }
 
-                     if (flag)
+                     if (bitmap_ior_into (get_varinfo (to)->solution, pts))
                        bitmap_set_bit (changed, to);
                    }
                  if (to_remove != ~0U)