tree-ssa-loop-manip.c (find_uses_to_rename): Do not scan the whole function when...
authorRichard Biener <rguenther@suse.de>
Mon, 18 Mar 2013 08:50:35 +0000 (08:50 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 18 Mar 2013 08:50:35 +0000 (08:50 +0000)
2013-03-18  Richard Biener  <rguenther@suse.de>

* tree-ssa-loop-manip.c (find_uses_to_rename): Do not scan the
whole function when there is nothing to do.
* tree-ssa-loop.c (pass_vectorize): Remove TODO_update_ssa.
* tree-vectorizer.c (vectorize_loops): Update virtual and
loop-closed SSA once.
* tree-vect-loop.c (vect_transform_loop): Do not update SSA here.

From-SVN: r196770

gcc/ChangeLog
gcc/tree-ssa-loop-manip.c
gcc/tree-ssa-loop.c
gcc/tree-vect-loop.c
gcc/tree-vectorizer.c

index 631ee729e629f7de74247191e6f708f9054f184d..f5d00c65abe3dca3469f3d2a680b831a53d8b6db 100644 (file)
@@ -1,3 +1,12 @@
+2013-03-18  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-loop-manip.c (find_uses_to_rename): Do not scan the
+       whole function when there is nothing to do.
+       * tree-ssa-loop.c (pass_vectorize): Remove TODO_update_ssa.
+       * tree-vectorizer.c (vectorize_loops): Update virtual and
+       loop-closed SSA once.
+       * tree-vect-loop.c (vect_transform_loop): Do not update SSA here.
+
 2013-03-18  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/56113
index 4645588d3e78a88a6c653b5094af068d73a030eb..a0516c45c4a5b7b33709c404047d208ad13e8fb6 100644 (file)
@@ -443,21 +443,12 @@ find_uses_to_rename (bitmap changed_bbs, bitmap *use_blocks, bitmap need_phis)
   unsigned index;
   bitmap_iterator bi;
 
-  /* ??? If CHANGED_BBS is empty we rewrite the whole function -- why?  */
-  if (changed_bbs && !bitmap_empty_p (changed_bbs))
-    {
-      EXECUTE_IF_SET_IN_BITMAP (changed_bbs, 0, index, bi)
-       {
-         find_uses_to_rename_bb (BASIC_BLOCK (index), use_blocks, need_phis);
-       }
-    }
+  if (changed_bbs)
+    EXECUTE_IF_SET_IN_BITMAP (changed_bbs, 0, index, bi)
+      find_uses_to_rename_bb (BASIC_BLOCK (index), use_blocks, need_phis);
   else
-    {
-      FOR_EACH_BB (bb)
-       {
-         find_uses_to_rename_bb (bb, use_blocks, need_phis);
-       }
-    }
+    FOR_EACH_BB (bb)
+      find_uses_to_rename_bb (bb, use_blocks, need_phis);
 }
 
 /* Rewrites the program into a loop closed ssa form -- i.e. inserts extra
index edc04eaa014964d81f73d4a43101e1312215edf9..fdfb9e7126241348519faaf7852d144fd2c420e7 100644 (file)
@@ -245,8 +245,7 @@ struct gimple_opt_pass pass_vectorize =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_update_ssa
-    | TODO_ggc_collect                 /* todo_flags_finish */
+  TODO_ggc_collect                     /* todo_flags_finish */
  }
 };
 
index 1252c5a04fc06f332276bc474dd8f72dc6192356..b7c55214169e58bb6151b6df6b2840746954b24b 100644 (file)
@@ -5773,11 +5773,6 @@ vect_transform_loop (loop_vec_info loop_vinfo)
         loop->nb_iterations_estimate = loop->nb_iterations_estimate - double_int_one;
     }
 
-  /* The memory tags and pointers in vectorized statements need to
-     have their SSA forms updated.  FIXME, why can't this be delayed
-     until all the loops have been transformed?  */
-  update_ssa (TODO_update_ssa);
-
   if (dump_enabled_p ())
     dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, "LOOP VECTORIZED.");
   if (loop->inner && dump_enabled_p ())
index 42ebb8d250f5baefabac07af9a2bcb43907ae43f..9d461997516cbf0736f87a98c27e2398dcf12c46 100644 (file)
@@ -149,7 +149,16 @@ vectorize_loops (void)
 
   free_stmt_vec_info_vec ();
 
-  return num_vectorized_loops > 0 ? TODO_cleanup_cfg : 0;
+  if (num_vectorized_loops > 0)
+    {
+      /* If we vectorized any loop only virtual SSA form needs to be updated.
+        ???  Also while we try hard to update loop-closed SSA form we fail
+        to properly do this in some corner-cases (see PR56286).  */
+      rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa_only_virtuals);
+      return TODO_cleanup_cfg;
+    }
+
+  return 0;
 }