Re: [PATCH] Update SSA_NAME manager to use two lists
authorJeff Law <law@redhat.com>
Fri, 9 Oct 2015 21:16:16 +0000 (15:16 -0600)
committerJeff Law <law@gcc.gnu.org>
Fri, 9 Oct 2015 21:16:16 +0000 (15:16 -0600)
* tree-ssanames.c (flush_ssaname_freelist): Use splice and truncate
rather than moving each name to the freelist individually.

From-SVN: r228668

gcc/ChangeLog
gcc/tree-ssanames.c

index 69743c318fb8b1c43f8ed17eb2dcf91c7b130f38..4b81033bc601280d3df68e50106ae196232f10d1 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-09  Jeff Law  <law@redhat.com>
+
+       * tree-ssanames.c (flush_ssaname_freelist): Use splice and truncate
+       rather than moving each name to the freelist individually.
+
 2015-10-09  Steve Ellcey  <sellcey@imgtec.com>
 
        * config.gcc (mips*-*-*): Add frame-header-opt.o to extra_objs.
index 91f4ed8d7f162719012e9cf29aaa0f36cc31ca4a..82fd4a15f85926038f9f0f742979ce2c69cd70c1 100644 (file)
@@ -127,11 +127,8 @@ ssanames_print_statistics (void)
 void
 flush_ssaname_freelist (void)
 {
-  while (!vec_safe_is_empty (FREE_SSANAMES_QUEUE (cfun)))
-    {
-      tree t = FREE_SSANAMES_QUEUE (cfun)->pop ();
-      vec_safe_push (FREE_SSANAMES (cfun), t);
-    }
+  vec_safe_splice (FREE_SSANAMES (cfun), FREE_SSANAMES_QUEUE (cfun));
+  vec_safe_truncate (FREE_SSANAMES_QUEUE (cfun), 0);
 }
 
 /* Return an SSA_NAME node for variable VAR defined in statement STMT