Adjust BB vectorization function splitting
authorRichard Biener <rguenther@suse.de>
Tue, 27 Oct 2020 13:16:45 +0000 (14:16 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 27 Oct 2020 14:08:21 +0000 (15:08 +0100)
This adjusts the condition when to split at control altering stmts,
only when there's a definition.  It also removes the only use
of --param slp-max-insns-in-bb which a previous change left doing
nothing (but repeatedly print a message for each successive
instruction...).

2020-10-27  Richard Biener  <rguenther@suse.de>

* tree-vect-slp.c (vect_slp_bbs): Remove no-op
slp-max-insns-in-bb check.
(vect_slp_function): Dump when splitting the function.
Adjust the split condition for control altering stmts.
* params.opt (-param=slp-max-insns-in-bb): Remove.
* doc/invoke.texi (-param=slp-max-insns-in-bb): Likewise.

gcc/doc/invoke.texi
gcc/params.opt
gcc/tree-vect-slp.c

index edea7ee25ba6aa6ee8fee9ed1e74acd63d47a81a..f82eeea097af61b6bc8fe96c0352b458fd49e1b5 100644 (file)
@@ -13749,10 +13749,6 @@ code to iterate.  2 allows partial vector loads and stores in all loops.
 The parameter only has an effect on targets that support partial
 vector loads and stores.
 
-@item slp-max-insns-in-bb
-Maximum number of instructions in basic block to be
-considered for SLP vectorization.
-
 @item avoid-fma-max-bits
 Maximum number of bits for which we avoid creating FMAs.
 
index e05f7ffa4461a785429619168cc255c0bdc428ef..563c67c11f20238d52a05a890a533a86da476986 100644 (file)
@@ -855,10 +855,6 @@ The number of prefetches that can run at the same time.
 Common Joined UInteger Var(param_sink_frequency_threshold) Init(75) IntegerRange(0, 100) Param Optimization
 Target block's relative execution frequency (as a percentage) required to sink a statement.
 
--param=slp-max-insns-in-bb=
-Common Joined UInteger Var(param_slp_max_insns_in_bb) Init(1000) Param Optimization
-Maximum number of instructions in basic block to be considered for SLP vectorization.
-
 -param=sms-dfa-history=
 Common Joined UInteger Var(param_sms_dfa_history) IntegerRange(0, 16) Param Optimization
 The number of cycles the swing modulo scheduler considers when checking conflicts using DFA.
index f544b552a46fe5dbc52ecf8db32cabdd89bd1823..ba43adb8a7d5ee2cf8d85554ccca427a988cb29a 100644 (file)
@@ -4336,14 +4336,6 @@ vect_slp_bbs (vec<basic_block> bbs)
          if (!vect_find_stmt_data_reference (NULL, stmt, &datarefs,
                                              &dataref_groups, current_group))
            ++current_group;
-
-         if (insns > param_slp_max_insns_in_bb)
-           {
-             if (dump_enabled_p ())
-               dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-                                "not vectorized: too many instructions in "
-                                "region.\n");
-           }
        }
     }
 
@@ -4386,14 +4378,26 @@ vect_slp_function (function *fun)
       /* Split when a BB is not dominated by the first block.  */
       if (!bbs.is_empty ()
          && !dominated_by_p (CDI_DOMINATORS, bb, bbs[0]))
-       split = true;
+       {
+         if (dump_enabled_p ())
+           dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+                            "splitting region at dominance boundary bb%d\n",
+                            bb->index);
+         split = true;
+       }
       /* Split when the loop determined by the first block
         is exited.  This is because we eventually insert
         invariants at region begin.  */
       else if (!bbs.is_empty ()
               && bbs[0]->loop_father != bb->loop_father
               && !flow_loop_nested_p (bbs[0]->loop_father, bb->loop_father))
-       split = true;
+       {
+         if (dump_enabled_p ())
+           dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+                            "splitting region at loop %d exit at bb%d\n",
+                            bbs[0]->loop_father->num, bb->index);
+         split = true;
+       }
 
       if (split && !bbs.is_empty ())
        {
@@ -4404,11 +4408,17 @@ vect_slp_function (function *fun)
       else
        bbs.safe_push (bb);
 
-      /* When we have a stmt ending this block we have to insert on
-        edges when inserting after it.  Avoid this for now.  */
+      /* When we have a stmt ending this block and defining a
+        value we have to insert on edges when inserting after it for
+        a vector containing its definition.  Avoid this for now.  */
       if (gimple *last = last_stmt (bb))
-       if (is_ctrl_altering_stmt (last))
+       if (gimple_get_lhs (last)
+           && is_ctrl_altering_stmt (last))
          {
+           if (dump_enabled_p ())
+             dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+                              "splitting region at control altering "
+                              "definition %G", last);
            r |= vect_slp_bbs (bbs);
            bbs.truncate (0);
          }