public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/pheeck/heads/sccp)] corrected handling of abnormal phis
@ 2022-09-05  9:53 Filip Kastl
  0 siblings, 0 replies; 2+ messages in thread
From: Filip Kastl @ 2022-09-05  9:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5b14058a7bad4457c73540eb62139dfebfe952b1

commit 5b14058a7bad4457c73540eb62139dfebfe952b1
Author: Filip Kastl <filip.kastl@gmail.com>
Date:   Mon Sep 5 11:53:10 2022 +0200

    corrected handling of abnormal phis

Diff:
---
 gcc/sccp.cc | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/gcc/sccp.cc b/gcc/sccp.cc
index 1ac4474c019..bcb3b313782 100644
--- a/gcc/sccp.cc
+++ b/gcc/sccp.cc
@@ -126,11 +126,10 @@ finalize_sccp (void)
 {
 }
 
-/* Return vector of all PHI functions available to this pass that aren't
-   abnormal.  */
+/* Return vector of all PHI functions from all basic blocks.  */
 
 static vec<gphi *>
-get_all_normal_phis (void)
+get_all_phis (void)
 {
   vec<gphi *> result = vNULL;
 
@@ -141,9 +140,6 @@ get_all_normal_phis (void)
       for (pi = gsi_start_phis (bb); !gsi_end_p (pi); gsi_next (&pi))
 	{
 	  gphi *phi = pi.phi ();
-	  tree ssa_name = gimple_phi_result (phi);
-	  if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssa_name))
-	    continue;
 	  result.safe_push (phi);
 	}
     }
@@ -423,7 +419,10 @@ process_scc (vec<gphi *> scc)
 	  break;
 	}
 
-      replace_scc_by_value (scc, outer_op);
+      /* Only replace by non-abnormal phi.  */
+      if (!(TREE_CODE (outer_op) == SSA_NAME &&
+	  SSA_NAME_OCCURS_IN_ABNORMAL_PHI (outer_op)))
+	replace_scc_by_value (scc, outer_op);
     }
   else if (outer_ops.elements () > 1)
     {
@@ -476,7 +475,7 @@ unsigned
 pass_sccp::execute (function *)
 {
   init_sccp ();
-  remove_redundant_phis (get_all_normal_phis ());
+  remove_redundant_phis (get_all_phis ());
   finalize_sccp ();
 
   return 0;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/pheeck/heads/sccp)] corrected handling of abnormal phis
@ 2023-02-15 10:14 Filip Kastl
  0 siblings, 0 replies; 2+ messages in thread
From: Filip Kastl @ 2023-02-15 10:14 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e99a83d936697065a05d151305b0075db91c3970

commit e99a83d936697065a05d151305b0075db91c3970
Author: Filip Kastl <filip.kastl@gmail.com>
Date:   Mon Sep 5 11:53:10 2022 +0200

    corrected handling of abnormal phis

Diff:
---
 gcc/sccp.cc | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/gcc/sccp.cc b/gcc/sccp.cc
index 1ac4474c019..bcb3b313782 100644
--- a/gcc/sccp.cc
+++ b/gcc/sccp.cc
@@ -126,11 +126,10 @@ finalize_sccp (void)
 {
 }
 
-/* Return vector of all PHI functions available to this pass that aren't
-   abnormal.  */
+/* Return vector of all PHI functions from all basic blocks.  */
 
 static vec<gphi *>
-get_all_normal_phis (void)
+get_all_phis (void)
 {
   vec<gphi *> result = vNULL;
 
@@ -141,9 +140,6 @@ get_all_normal_phis (void)
       for (pi = gsi_start_phis (bb); !gsi_end_p (pi); gsi_next (&pi))
 	{
 	  gphi *phi = pi.phi ();
-	  tree ssa_name = gimple_phi_result (phi);
-	  if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssa_name))
-	    continue;
 	  result.safe_push (phi);
 	}
     }
@@ -423,7 +419,10 @@ process_scc (vec<gphi *> scc)
 	  break;
 	}
 
-      replace_scc_by_value (scc, outer_op);
+      /* Only replace by non-abnormal phi.  */
+      if (!(TREE_CODE (outer_op) == SSA_NAME &&
+	  SSA_NAME_OCCURS_IN_ABNORMAL_PHI (outer_op)))
+	replace_scc_by_value (scc, outer_op);
     }
   else if (outer_ops.elements () > 1)
     {
@@ -476,7 +475,7 @@ unsigned
 pass_sccp::execute (function *)
 {
   init_sccp ();
-  remove_redundant_phis (get_all_normal_phis ());
+  remove_redundant_phis (get_all_phis ());
   finalize_sccp ();
 
   return 0;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-15 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05  9:53 [gcc(refs/users/pheeck/heads/sccp)] corrected handling of abnormal phis Filip Kastl
2023-02-15 10:14 Filip Kastl

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