Patchwork Remove pointless iteration in VN

login
register
mail settings
Submitter Richard Guenther
Date Nov. 30, 2012, 9:20 a.m.
Message ID <alpine.LNX.2.00.1211301019330.8142@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/202900/
State New
Headers show

Comments

Richard Guenther - Nov. 30, 2012, 9:20 a.m.
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.

Patch

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 ();