]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not walk equivalence set in path_oracle::killing_def.
authorAndrew MacLeod <amacleod@redhat.com>
Wed, 3 Aug 2022 17:55:42 +0000 (13:55 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Wed, 3 Aug 2022 18:40:55 +0000 (14:40 -0400)
When killing a def in the path ranger, there is no need to walk the set
of existing equivalences clearing bits.  An equivalence match requires
that both ssa-names have to be in each others set.  As killing_def
creates a new empty set contianing only the current def,  it already
ensures false equivaelnces won't happen.

PR tree-optimization/106514
* value-relation.cc (path_oracle::killing_def) Do not walk the
  equivalence set clearing bits.

gcc/value-relation.cc

index a447021214fff977ad2e423f3893bb416018afae..3f0957ccdd64d455466f2239626815b50b33c6da 100644 (file)
@@ -1400,16 +1400,7 @@ path_oracle::killing_def (tree ssa)
   unsigned v = SSA_NAME_VERSION (ssa);
 
   bitmap_set_bit (m_killed_defs, v);
-
-  // Walk the equivalency list and remove SSA from any equivalencies.
-  if (bitmap_bit_p (m_equiv.m_names, v))
-    {
-      for (equiv_chain *ptr = m_equiv.m_next; ptr; ptr = ptr->m_next)
-       if (bitmap_bit_p (ptr->m_names, v))
-         bitmap_clear_bit (ptr->m_names, v);
-    }
-  else
-    bitmap_set_bit (m_equiv.m_names, v);
+  bitmap_set_bit (m_equiv.m_names, v);
 
   // Now add an equivalency with itself so we don't look to the root oracle.
   bitmap b = BITMAP_ALLOC (&m_bitmaps);