public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-2557] tree-optimization/106881 - fix simple_control_dep_chain part
@ 2022-09-09  9:48 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-09-09  9:48 UTC (permalink / raw)
  To: gcc-cvs

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);
+	}
     }
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-09  9:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09  9:48 [gcc r13-2557] tree-optimization/106881 - fix simple_control_dep_chain part Richard Biener

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).