]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-sccvn.c (vuse_ssa_val): Return NULL for unvisited virtual operands that...
authorRichard Biener <rguenther@suse.de>
Wed, 29 Aug 2018 15:02:06 +0000 (15:02 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 29 Aug 2018 15:02:06 +0000 (15:02 +0000)
2018-08-29  Richard Biener  <rguenther@suse.de>

* tree-ssa-sccvn.c (vuse_ssa_val): Return NULL for unvisited
virtual operands that are not default defs to honor region
boundaries.
(rpo_vn_valueize): Remove ineffective code here.

From-SVN: r263960

gcc/ChangeLog
gcc/tree-ssa-sccvn.c

index 91a06ed7a16b3373b5460649f051e9d8a1af3a56..dcec935d5beee031e23f0ad48772a23ae0fdb5c1 100644 (file)
@@ -1,3 +1,10 @@
+2018-08-29  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-sccvn.c (vuse_ssa_val): Return NULL for unvisited
+       virtual operands that are not default defs to honor region
+       boundaries.
+       (rpo_vn_valueize): Remove ineffective code here.
+
 2018-08-29  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/87132
index e3b9f1c7dbc233e2ae612e282e6fd22c243e2081..39ab4b252858d5b6e0f672beb5b5d1d764008429 100644 (file)
@@ -474,12 +474,16 @@ vuse_ssa_val (tree x)
 
   do
     {
-      tree tem = SSA_VAL (x);
-      /* stmt walking can walk over a backedge and reach code we didn't
-        value-number yet.  */
-      if (tem == VN_TOP)
+      if (SSA_NAME_IS_DEFAULT_DEF (x))
        return x;
-      x = tem;
+      vn_ssa_aux_t tem
+       = vn_ssa_aux_hash->find_with_hash (x, SSA_NAME_VERSION (x));
+      /* For region-based VN this makes walk_non_aliased_vuses stop walking
+        when we are about to look at a def outside of the region.  */
+      if (!tem || !tem->visited)
+       return NULL_TREE;
+      gcc_assert (tem->valnum != VN_TOP);
+      x = tem->valnum;
     }
   while (SSA_NAME_IN_FREE_LIST (x));
 
@@ -5751,11 +5755,6 @@ rpo_vn_valueize (tree name)
   if (TREE_CODE (name) == SSA_NAME)
     {
       vn_ssa_aux_t val = VN_INFO (name);
-      /* For region-based VN this makes walk_non_aliased_vuses stop walking
-        when we are about to look at a def outside of the region.  */
-      if (SSA_NAME_IS_VIRTUAL_OPERAND (name)
-         && !val->visited)
-       return NULL_TREE;
       if (val)
        {
          tree tem = val->valnum;