tree-optimization/95916 - treat scalar ops explicitely
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.
This commit is contained in:
parent
008842d741
commit
9a4a52e359
13
gcc/testsuite/gcc.dg/vect/pr95916.c
Normal file
13
gcc/testsuite/gcc.dg/vect/pr95916.c
Normal file
@ -0,0 +1,13 @@
|
||||
/* { 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;
|
||||
}
|
@ -4293,6 +4293,21 @@ vect_schedule_slp_instance (vec_info *vinfo,
|
||||
|| 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
|
||||
|
Loading…
Reference in New Issue
Block a user