This explicitely treats the case of scalar operands for SLP
when computing insert locations.
2020-06-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/95916
* tree-vect-slp.c (vect_schedule_slp_instance): Explicitely handle
the case of not vectorized externals.
* gcc.dg/vect/pr95916.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+extern short var_3, var_8;
+extern int var_5;
+extern char var_10;
+extern int arr_99[][16];
+void test()
+{
+ for (; 0 < var_10;)
+ for (long a = var_8;; a++)
+ arr_99[4][a] = var_3 << var_5;
+}
|| vect_stmt_dominates_stmt_p (last_stmt, vstmt))
last_stmt = vstmt;
}
+ else if (!SLP_TREE_VECTYPE (child))
+ {
+ /* For externals we use unvectorized at all scalar defs. */
+ unsigned j;
+ tree def;
+ FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_OPS (child), j, def)
+ if (TREE_CODE (def) == SSA_NAME
+ && !SSA_NAME_IS_DEFAULT_DEF (def))
+ {
+ gimple *stmt = SSA_NAME_DEF_STMT (def);
+ if (!last_stmt
+ || vect_stmt_dominates_stmt_p (last_stmt, stmt))
+ last_stmt = stmt;
+ }
+ }
else
{
/* For externals we have to look at all defs since their