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] Remove pointless iteration in VN


This removes iterating propagation of value-ids (I verified
it never needs iteration in practice - certainly it does not
need iteration by design).

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2012-11-30  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c (run_scc_vn): Remove iteration propagating
	value_ids.

Index: gcc/tree-ssa-sccvn.c
===================================================================
--- gcc/tree-ssa-sccvn.c	(revision 193932)
+++ gcc/tree-ssa-sccvn.c	(working copy)
@@ -3983,7 +3983,6 @@ run_scc_vn (vn_lookup_kind default_vn_wa
 {
   size_t i;
   tree param;
-  bool changed = true;
 
   default_vn_walk_kind = default_vn_walk_kind_;
 
@@ -4028,25 +4027,18 @@ run_scc_vn (vn_lookup_kind default_vn_wa
 	info->value_id = get_or_alloc_constant_value_id (info->valnum);
     }
 
-  /* Propagate until they stop changing.  */
-  while (changed)
+  /* Propagate.  */
+  for (i = 1; i < num_ssa_names; ++i)
     {
-      changed = false;
-      for (i = 1; i < num_ssa_names; ++i)
-	{
-	  tree name = ssa_name (i);
-	  vn_ssa_aux_t info;
-	  if (!name)
-	    continue;
-	  info = VN_INFO (name);
-	  if (TREE_CODE (info->valnum) == SSA_NAME
-	      && info->valnum != name
-	      && info->value_id != VN_INFO (info->valnum)->value_id)
-	    {
-	      changed = true;
-	      info->value_id = VN_INFO (info->valnum)->value_id;
-	    }
-	}
+      tree name = ssa_name (i);
+      vn_ssa_aux_t info;
+      if (!name)
+	continue;
+      info = VN_INFO (name);
+      if (TREE_CODE (info->valnum) == SSA_NAME
+	  && info->valnum != name
+	  && info->value_id != VN_INFO (info->valnum)->value_id)
+	info->value_id = VN_INFO (info->valnum)->value_id;
     }
 
   set_hashtable_value_ids ();


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