This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] tree-phinodes.c: Drop the last argument of remove_phi_node.


Hi,

Attached is a patch to drop the last argument of remove_phi_node as it
can be inferred from the first argument, PHI, via bb_for_stmt (PHI).

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2005-03-04  Kazu Hirata  <kazu@cs.umass.edu>

	* tree-phinodes.c (remove_phi_node): Drop the last argument.
	* tree-flow.h: Adjust the prototype for remove_phi_node.
	* lambda-code.c (perfect_nestify): Adjust a call to
	remove_phi_node.
	* tree-cfg.c
	(remove_phi_nodes_and_edges_for_unreachable_block): Likewise.
	* tree-outof-ssa.c (eliminate_virtual_phis, remove_ssa_form):
	Likewise.
	* tree-ssa-dce.c (remove_dead_phis): Likewise.
	* tree-ssa-loop-ivopts.c (remove_statement): Likewise.
	* tree-ssa-pre.c (remove_dead_inserted_code): Likewise.
	* tree-ssa.c (kill_redundant_phi_nodes): Likewise.

Index: lambda-code.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lambda-code.c,v
retrieving revision 2.27
diff -u -d -p -r2.27 lambda-code.c
--- lambda-code.c	1 Mar 2005 13:44:43 -0000	2.27
+++ lambda-code.c	4 Mar 2005 21:42:00 -0000
@@ -2327,7 +2327,7 @@ perfect_nestify (struct loops *loops,
   while (phi_nodes (olddest) != NULL)
     {
       SET_PHI_RESULT (phi_nodes (olddest), NULL);
-      remove_phi_node (phi_nodes (olddest), NULL, olddest);
+      remove_phi_node (phi_nodes (olddest), NULL);
     }      
 
   /* and add them back to the new basic block.  */
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.153
diff -u -d -p -r2.153 tree-cfg.c
--- tree-cfg.c	3 Mar 2005 14:29:00 -0000	2.153
+++ tree-cfg.c	4 Mar 2005 21:42:00 -0000
@@ -1997,7 +1997,7 @@ remove_phi_nodes_and_edges_for_unreachab
   while (phi)
     {
       tree next = PHI_CHAIN (phi);
-      remove_phi_node (phi, NULL_TREE, bb);
+      remove_phi_node (phi, NULL_TREE);
       phi = next;
     }
 
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-flow.h,v
retrieving revision 2.82
diff -u -d -p -r2.82 tree-flow.h
--- tree-flow.h	1 Mar 2005 17:59:04 -0000	2.82
+++ tree-flow.h	4 Mar 2005 21:42:01 -0000
@@ -522,7 +522,7 @@ extern void reserve_phi_args_for_new_edg
 extern tree create_phi_node (tree, basic_block);
 extern void add_phi_arg (tree, tree, edge);
 extern void remove_phi_args (edge);
-extern void remove_phi_node (tree, tree, basic_block);
+extern void remove_phi_node (tree, tree);
 extern void remove_all_phi_nodes_for (bitmap);
 extern tree phi_reverse (tree);
 extern void dump_dfa_stats (FILE *);
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-outof-ssa.c,v
retrieving revision 2.47
diff -u -d -p -r2.47 tree-outof-ssa.c
--- tree-outof-ssa.c	22 Feb 2005 16:48:03 -0000	2.47
+++ tree-outof-ssa.c	4 Mar 2005 21:42:01 -0000
@@ -1030,7 +1030,7 @@ eliminate_virtual_phis (void)
 		    }
 		}
 #endif
-	      remove_phi_node (phi, NULL_TREE, bb);
+	      remove_phi_node (phi, NULL_TREE);
 	    }
 	}
     }
@@ -2371,7 +2371,7 @@ remove_ssa_form (FILE *dump, var_map map
       for (phi = phi_nodes (bb); phi; phi = next)
 	{
 	  next = PHI_CHAIN (phi);
-	  remove_phi_node (phi, NULL_TREE, bb);
+	  remove_phi_node (phi, NULL_TREE);
 	}
     }
 
Index: tree-phinodes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-phinodes.c,v
retrieving revision 2.30
diff -u -d -p -r2.30 tree-phinodes.c
--- tree-phinodes.c	3 Mar 2005 17:15:36 -0000	2.30
+++ tree-phinodes.c	4 Mar 2005 21:42:01 -0000
@@ -402,7 +402,7 @@ remove_phi_args (edge e)
    used as the node immediately before PHI in the linked list.  */
 
 void
-remove_phi_node (tree phi, tree prev, basic_block bb)
+remove_phi_node (tree phi, tree prev)
 {
   tree *loc;
 
@@ -412,7 +412,7 @@ remove_phi_node (tree phi, tree prev, ba
     }
   else
     {
-      for (loc = &(bb_ann (bb)->phi_nodes);
+      for (loc = &(bb_ann (bb_for_stmt (phi))->phi_nodes);
 	   *loc != phi;
 	   loc = &PHI_CHAIN (*loc))
 	;
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dce.c,v
retrieving revision 2.33
diff -u -d -p -r2.33 tree-ssa-dce.c
--- tree-ssa-dce.c	1 Mar 2005 17:59:05 -0000	2.33
+++ tree-ssa-dce.c	4 Mar 2005 21:42:01 -0000
@@ -684,7 +684,7 @@ remove_dead_phis (basic_block bb)
 	      fprintf (dump_file, "\n");
 	    }
 
-	  remove_phi_node (phi, prev, bb);
+	  remove_phi_node (phi, prev);
 	  stats.removed_phis++;
 	  phi = next;
 	}
Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
retrieving revision 2.50
diff -u -d -p -r2.50 tree-ssa-loop-ivopts.c
--- tree-ssa-loop-ivopts.c	25 Feb 2005 12:07:11 -0000	2.50
+++ tree-ssa-loop-ivopts.c	4 Mar 2005 21:42:01 -0000
@@ -4652,7 +4652,7 @@ remove_statement (tree stmt, bool includ
 	  /* Prevent the ssa name defined by the statement from being removed.  */
 	  SET_PHI_RESULT (stmt, NULL);
 	}
-      remove_phi_node (stmt, NULL_TREE, bb_for_stmt (stmt));
+      remove_phi_node (stmt, NULL_TREE);
     }
   else
     {
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v
retrieving revision 2.65
diff -u -d -p -r2.65 tree-ssa-pre.c
--- tree-ssa-pre.c	17 Feb 2005 16:19:46 -0000	2.65
+++ tree-ssa-pre.c	4 Mar 2005 21:42:01 -0000
@@ -2106,7 +2106,7 @@ remove_dead_inserted_code (void)
 	    }
 	  if (TREE_CODE (t) == PHI_NODE)
 	    {
-	      remove_phi_node (t, NULL, bb_for_stmt (t));
+	      remove_phi_node (t, NULL);
 	    }
 	  else
 	    {
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.79
diff -u -d -p -r2.79 tree-ssa.c
--- tree-ssa.c	28 Feb 2005 17:21:05 -0000	2.79
+++ tree-ssa.c	4 Mar 2005 21:42:01 -0000
@@ -1290,7 +1290,7 @@ kill_redundant_phi_nodes (void)
       if (repl != ssa_name (i))
 	{
 	  stmt = SSA_NAME_DEF_STMT (ssa_name (i));
-	  remove_phi_node (stmt, NULL_TREE, bb_for_stmt (stmt));
+	  remove_phi_node (stmt, NULL_TREE);
 	}
     }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]