public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fixup copyrename statistics
@ 2011-07-12 14:53 Richard Guenther
  0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2011-07-12 14:53 UTC (permalink / raw)
  To: gcc-patches


I noticed we forget to clear the stats and that we do 1:1
replacements.

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

Richard.

2011-07-12  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-copyrename.c (rename_ssa_copies): Zero statistics.
	Do not perform no-op changes.

Index: gcc/tree-ssa-copyrename.c
===================================================================
--- gcc/tree-ssa-copyrename.c	(revision 176196)
+++ gcc/tree-ssa-copyrename.c	(working copy)
@@ -296,6 +296,8 @@ rename_ssa_copies (void)
   FILE *debug;
   bool updated = false;
 
+  memset (&stats, 0, sizeof (stats));
+
   if (dump_file && (dump_flags & TDF_DETAILS))
     debug = dump_file;
   else
@@ -355,16 +357,15 @@ rename_ssa_copies (void)
       if (!part_var)
         continue;
       var = ssa_name (x);
+      if (SSA_NAME_VAR (var) == SSA_NAME_VAR (part_var))
+	continue;
       if (debug)
         {
-	  if (SSA_NAME_VAR (var) != SSA_NAME_VAR (part_var))
-	    {
-	      fprintf (debug, "Coalesced ");
-	      print_generic_expr (debug, var, TDF_SLIM);
-	      fprintf (debug, " to ");
-	      print_generic_expr (debug, part_var, TDF_SLIM);
-	      fprintf (debug, "\n");
-	    }
+	  fprintf (debug, "Coalesced ");
+	  print_generic_expr (debug, var, TDF_SLIM);
+	  fprintf (debug, " to ");
+	  print_generic_expr (debug, part_var, TDF_SLIM);
+	  fprintf (debug, "\n");
 	}
       stats.coalesced++;
       replace_ssa_name_symbol (var, SSA_NAME_VAR (part_var));

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-12 14:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-12 14:53 [PATCH] Fixup copyrename statistics Richard Guenther

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