https://gcc.gnu.org/g:9c18bdb07e299b25e7526fea16659c7ff8f0d14e

commit r15-74-g9c18bdb07e299b25e7526fea16659c7ff8f0d14e
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Sat Apr 27 18:54:44 2024 -0700

    MATCH: change single_non_singleton_phi_for_edges for singleton phis
    
    I noticed that single_non_singleton_phi_for_edges could
    return a phi whos entry are all the same for the edge.
    This happens only if there was a single phis in the first place.
    Also gimple_seq_singleton_p walks the sequence to see if it the one
    element in the sequence so there is removing that check actually
    reduces the number of pointer walks needed.
    
    Bootstrapped and tested on x86_64-linux-gnu with no regressions.
    
    gcc/ChangeLog:
    
            * tree-ssa-phiopt.cc (single_non_singleton_phi_for_edges):
            Remove the special case of gimple_seq_singleton_p.
    
    Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>

Diff:
---
 gcc/tree-ssa-phiopt.cc | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index d1746c4b468..f1e07502b02 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -62,14 +62,6 @@ single_non_singleton_phi_for_edges (gimple_seq seq, edge e0, 
edge e1)
 {
   gimple_stmt_iterator i;
   gphi *phi = NULL;
-  if (gimple_seq_singleton_p (seq))
-    {
-      phi = as_a <gphi *> (gsi_stmt (gsi_start (seq)));
-      /* Never return virtual phis.  */
-      if (virtual_operand_p (gimple_phi_result (phi)))
-       return NULL;
-      return phi;
-    }
   for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
     {
       gphi *p = as_a <gphi *> (gsi_stmt (i));

Reply via email to