Simplify gather_scalar_reductions
authorTom de Vries <tom@codesourcery.com>
Mon, 27 Jul 2015 20:05:19 +0000 (20:05 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Mon, 27 Jul 2015 20:05:19 +0000 (20:05 +0000)
2015-07-27  Tom de Vries  <tom@codesourcery.com>

* tree-parloops.c (gather_scalar_reductions): Simplify function
structure.

From-SVN: r226270

gcc/ChangeLog
gcc/tree-parloops.c

index 4ec512f9b7d910f3a6473c45127043e056ccc3dc..55897c75a7b477c285ddb45f519417dbd0915a6f 100644 (file)
@@ -1,3 +1,8 @@
+2015-07-27  Tom de Vries  <tom@codesourcery.com>
+
+       * tree-parloops.c (gather_scalar_reductions): Simplify function
+       structure.
+
 2015-07-27  Marek Polacek  <polacek@redhat.com>
 
        * ipa-devirt.c (types_same_for_odr): Fix typo.
index 6e75cb13648117ad44b1b43801c6421069f0bd90..daf23f2532befbf2e7378d626fe3ad95588ee346 100644 (file)
@@ -2370,6 +2370,8 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
   loop_vec_info simple_loop_info;
 
   simple_loop_info = vect_analyze_loop_form (loop);
+  if (simple_loop_info == NULL)
+    return;
 
   for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi))
     {
@@ -2381,15 +2383,16 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
       if (virtual_operand_p (res))
        continue;
 
-      if (!simple_iv (loop, loop, res, &iv, true)
-       && simple_loop_info)
-       {
-          gimple reduc_stmt
-            = vect_force_simple_reduction (simple_loop_info, phi, true,
-                                           &double_reduc, true);
-          if (reduc_stmt && !double_reduc)
-              build_new_reduction (reduction_list, reduc_stmt, phi);
-        }
+      if (simple_iv (loop, loop, res, &iv, true))
+       continue;
+
+      gimple reduc_stmt
+       = vect_force_simple_reduction (simple_loop_info, phi, true,
+                                      &double_reduc, true);
+      if (!reduc_stmt || double_reduc)
+       continue;
+
+      build_new_reduction (reduction_list, reduc_stmt, phi);
     }
   destroy_loop_vec_info (simple_loop_info, true);