public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] tree-optimization/84646 - remove premature thread path rejection
Date: Wed, 9 Nov 2022 14:50:45 +0100 (CET)	[thread overview]
Message-ID: <20221109135046.17EDE1331F@imap2.suse-dmz.suse.de> (raw)

This removes a premature rejection that's done later in a different
way.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

	PR tree-optimization/84646
	* tree-ssa-threadbackward.cc (back_threader::maybe_register_path):
	Remove premature cycle rejection.
---
 gcc/tree-ssa-threadbackward.cc | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/gcc/tree-ssa-threadbackward.cc b/gcc/tree-ssa-threadbackward.cc
index 2a8cfa3ee01..2290b95717d 100644
--- a/gcc/tree-ssa-threadbackward.cc
+++ b/gcc/tree-ssa-threadbackward.cc
@@ -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))
-- 
2.35.3

                 reply	other threads:[~2022-11-09 13:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221109135046.17EDE1331F@imap2.suse-dmz.suse.de \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).