tree-vectorizer.h (struct _slp_oprnd_info): Remove first_const_oprnd field, rename first_def_type to first_op_type.
2013-04-10 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (struct _slp_oprnd_info): Remove first_const_oprnd field, rename first_def_type to first_op_type. * tree-vect-slp.c (vect_create_oprnd_info): Adjust. (vect_get_and_check_slp_defs): Always use the type of the operand. Allow mixed vect_external_def, vect_constant_def types. (vect_get_constant_vectors): Handle mixed vect_external_def, vect_constant_def types. * gcc.dg/vect/slp-39.c: New testcase. From-SVN: r197669
This commit is contained in:
parent
ee8a9b7b50
commit
793d9a16a2
|
@ -1,3 +1,13 @@
|
||||||
|
2013-04-10 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
|
* tree-vectorizer.h (struct _slp_oprnd_info): Remove
|
||||||
|
first_const_oprnd field, rename first_def_type to first_op_type.
|
||||||
|
* tree-vect-slp.c (vect_create_oprnd_info): Adjust.
|
||||||
|
(vect_get_and_check_slp_defs): Always use the type of the
|
||||||
|
operand. Allow mixed vect_external_def, vect_constant_def types.
|
||||||
|
(vect_get_constant_vectors): Handle mixed vect_external_def,
|
||||||
|
vect_constant_def types.
|
||||||
|
|
||||||
2013-04-10 Joern Rennecke <joern.rennecke@embecosm.com>
|
2013-04-10 Joern Rennecke <joern.rennecke@embecosm.com>
|
||||||
|
|
||||||
PR tree-optimization/55524
|
PR tree-optimization/55524
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2013-04-10 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
|
* gcc.dg/vect/slp-39.c: New testcase.
|
||||||
|
|
||||||
2013-04-10 Joern Rennecke <joern.rennecke@embecosm.com>
|
2013-04-10 Joern Rennecke <joern.rennecke@embecosm.com>
|
||||||
|
|
||||||
PR tree-optimization/55524
|
PR tree-optimization/55524
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-require-effective-target vect_double } */
|
||||||
|
|
||||||
|
double x[1024], y[1024], z[1024];
|
||||||
|
void foo (double w)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < 1023; i+=2)
|
||||||
|
{
|
||||||
|
z[i] = x[i] + 1;
|
||||||
|
z[i+1] = x[i+1] + w;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void bar (double w)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < 1023; i+=2)
|
||||||
|
{
|
||||||
|
z[i] = x[i] + w;
|
||||||
|
z[i+1] = x[i+1] + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
|
||||||
|
/* { dg-final { cleanup-tree-dump "vect" } } */
|
|
@ -140,8 +140,7 @@ vect_create_oprnd_info (int nops, int group_size)
|
||||||
oprnd_info = XNEW (struct _slp_oprnd_info);
|
oprnd_info = XNEW (struct _slp_oprnd_info);
|
||||||
oprnd_info->def_stmts.create (group_size);
|
oprnd_info->def_stmts.create (group_size);
|
||||||
oprnd_info->first_dt = vect_uninitialized_def;
|
oprnd_info->first_dt = vect_uninitialized_def;
|
||||||
oprnd_info->first_def_type = NULL_TREE;
|
oprnd_info->first_op_type = NULL_TREE;
|
||||||
oprnd_info->first_const_oprnd = NULL_TREE;
|
|
||||||
oprnd_info->first_pattern = false;
|
oprnd_info->first_pattern = false;
|
||||||
oprnds_info.quick_push (oprnd_info);
|
oprnds_info.quick_push (oprnd_info);
|
||||||
}
|
}
|
||||||
|
@ -321,16 +320,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
||||||
{
|
{
|
||||||
oprnd_info->first_dt = dt;
|
oprnd_info->first_dt = dt;
|
||||||
oprnd_info->first_pattern = pattern;
|
oprnd_info->first_pattern = pattern;
|
||||||
if (def)
|
oprnd_info->first_op_type = TREE_TYPE (oprnd);
|
||||||
{
|
|
||||||
oprnd_info->first_def_type = TREE_TYPE (def);
|
|
||||||
oprnd_info->first_const_oprnd = NULL_TREE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
oprnd_info->first_def_type = NULL_TREE;
|
|
||||||
oprnd_info->first_const_oprnd = oprnd;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -341,13 +331,12 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
||||||
vect_internal_def. */
|
vect_internal_def. */
|
||||||
if (((oprnd_info->first_dt != dt
|
if (((oprnd_info->first_dt != dt
|
||||||
&& !(oprnd_info->first_dt == vect_reduction_def
|
&& !(oprnd_info->first_dt == vect_reduction_def
|
||||||
&& dt == vect_internal_def))
|
&& dt == vect_internal_def)
|
||||||
|| (oprnd_info->first_def_type != NULL_TREE
|
&& !((oprnd_info->first_dt == vect_external_def
|
||||||
&& def
|
|| oprnd_info->first_dt == vect_constant_def)
|
||||||
&& !types_compatible_p (oprnd_info->first_def_type,
|
&& (dt == vect_external_def
|
||||||
TREE_TYPE (def))))
|
|| dt == vect_constant_def)))
|
||||||
|| (!def
|
|| !types_compatible_p (oprnd_info->first_op_type,
|
||||||
&& !types_compatible_p (TREE_TYPE (oprnd_info->first_const_oprnd),
|
|
||||||
TREE_TYPE (oprnd))))
|
TREE_TYPE (oprnd))))
|
||||||
{
|
{
|
||||||
if (dump_enabled_p ())
|
if (dump_enabled_p ())
|
||||||
|
@ -2471,7 +2460,7 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
|
||||||
the lhs, so make sure the scalar is the right type if
|
the lhs, so make sure the scalar is the right type if
|
||||||
we are dealing with vectors of
|
we are dealing with vectors of
|
||||||
long long/long/short/char. */
|
long long/long/short/char. */
|
||||||
if (op_num == 1 && constant_p)
|
if (op_num == 1 && TREE_CODE (op) == INTEGER_CST)
|
||||||
op = fold_convert (TREE_TYPE (vector_type), op);
|
op = fold_convert (TREE_TYPE (vector_type), op);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2504,7 +2493,7 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
|
||||||
number_of_places_left_in_vector--;
|
number_of_places_left_in_vector--;
|
||||||
if (!types_compatible_p (TREE_TYPE (vector_type), TREE_TYPE (op)))
|
if (!types_compatible_p (TREE_TYPE (vector_type), TREE_TYPE (op)))
|
||||||
{
|
{
|
||||||
if (constant_p)
|
if (CONSTANT_CLASS_P (op))
|
||||||
{
|
{
|
||||||
op = fold_unary (VIEW_CONVERT_EXPR,
|
op = fold_unary (VIEW_CONVERT_EXPR,
|
||||||
TREE_TYPE (vector_type), op);
|
TREE_TYPE (vector_type), op);
|
||||||
|
@ -2525,6 +2514,8 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elts[number_of_places_left_in_vector] = op;
|
elts[number_of_places_left_in_vector] = op;
|
||||||
|
if (!CONSTANT_CLASS_P (op))
|
||||||
|
constant_p = false;
|
||||||
|
|
||||||
if (number_of_places_left_in_vector == 0)
|
if (number_of_places_left_in_vector == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -169,8 +169,7 @@ typedef struct _slp_oprnd_info
|
||||||
operand itself in case it's constant, and an indication if it's a pattern
|
operand itself in case it's constant, and an indication if it's a pattern
|
||||||
stmt. */
|
stmt. */
|
||||||
enum vect_def_type first_dt;
|
enum vect_def_type first_dt;
|
||||||
tree first_def_type;
|
tree first_op_type;
|
||||||
tree first_const_oprnd;
|
|
||||||
bool first_pattern;
|
bool first_pattern;
|
||||||
} *slp_oprnd_info;
|
} *slp_oprnd_info;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue