]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/84646 - remove premature thread path rejection
authorRichard Biener <rguenther@suse.de>
Wed, 9 Nov 2022 12:52:58 +0000 (13:52 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 9 Nov 2022 13:51:00 +0000 (14:51 +0100)
This removes a premature rejection that's done later in a different
way.

PR tree-optimization/84646
* tree-ssa-threadbackward.cc (back_threader::maybe_register_path):
Remove premature cycle rejection.

gcc/tree-ssa-threadbackward.cc

index 2a8cfa3ee01a71c8c3303232dfcfd9fec3b3c5d7..2290b95717d24a4a925777375187b53aaafc1225 100644 (file)
@@ -249,25 +249,16 @@ back_threader::maybe_register_path (back_threader_profitability &profit)
 
   if (taken_edge && taken_edge != UNREACHABLE_EDGE)
     {
-      if (m_visited_bbs.contains (taken_edge->dest))
+      bool irreducible = false;
+      if (profit.profitable_path_p (m_path, taken_edge, &irreducible)
+         && debug_counter ()
+         && m_registry.register_path (m_path, taken_edge))
        {
-         // Avoid circular paths by indicating there is nothing to
-         // see in this direction.
-         taken_edge = UNREACHABLE_EDGE;
+         if (irreducible)
+           vect_free_loop_info_assumptions (m_path[0]->loop_father);
        }
       else
-       {
-         bool irreducible = false;
-         if (profit.profitable_path_p (m_path, taken_edge, &irreducible)
-             && debug_counter ()
-             && m_registry.register_path (m_path, taken_edge))
-           {
-             if (irreducible)
-               vect_free_loop_info_assumptions (m_path[0]->loop_father);
-           }
-         else
-           taken_edge = NULL;
-       }
+       taken_edge = NULL;
     }
 
   if (dump_file && (dump_flags & TDF_DETAILS))