public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-2557] tree-optimization/106881 - fix simple_control_dep_chain part
Date: Fri,  9 Sep 2022 09:48:16 +0000 (GMT)	[thread overview]
Message-ID: <20220909094816.136763857343@sourceware.org> (raw)

https://gcc.gnu.org/g:923da63e0f69b091014df5cc91498756053b1a46

commit r13-2557-g923da63e0f69b091014df5cc91498756053b1a46
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Sep 9 09:56:45 2022 +0200

    tree-optimization/106881 - fix simple_control_dep_chain part
    
    This adjusts simple_control_dep_chain in the same way I adjusted
    compute_control_dep_chain_pdom to avoid adding fallthru edges to
    the predicate chain.
    
            PR tree-optimization/106881
            * gimple-predicate-analysis.cc (simple_control_dep_chain):
            Add only non-fallthru edges and avoid the same set of edges
            as compute_control_dep_chain_pdom does.

Diff:
---
 gcc/gimple-predicate-analysis.cc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc
index 910ab97a29e..bc9ed847267 100644
--- a/gcc/gimple-predicate-analysis.cc
+++ b/gcc/gimple-predicate-analysis.cc
@@ -926,10 +926,14 @@ simple_control_dep_chain (vec<edge>& chain, basic_block from, basic_block to)
     {
       basic_block dest = src;
       src = get_immediate_dominator (CDI_DOMINATORS, src);
-      edge pred_e;
-      if (single_pred_p (dest)
-	  && (pred_e = find_edge (src, dest)))
-	chain.safe_push (pred_e);
+      if (single_pred_p (dest))
+	{
+	  edge pred_e = single_pred_edge (dest);
+	  gcc_assert (pred_e->src == src);
+	  if (!(pred_e->flags & ((EDGE_FAKE | EDGE_ABNORMAL | EDGE_DFS_BACK)))
+	      && !single_succ_p (src))
+	    chain.safe_push (pred_e);
+	}
     }
 }

                 reply	other threads:[~2022-09-09  9:48 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=20220909094816.136763857343@sourceware.org \
    --to=rguenth@gcc.gnu.org \
    --cc=gcc-cvs@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).