re PR tree-optimization/85597 (internal compiler error: in compute_live_loop_exits, at tree-ssa-loop-manip.c:229)

2018-05-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/85597
	* tree-vect-stmts.c (vectorizable_operation): For ternary SLP
	do not use split vect_get_vec_defs call but call vect_get_slp_defs
	directly.

	* gcc.dg/vect/pr85597.c: New testcase.

From-SVN: r259840
This commit is contained in:
Richard Biener 2018-05-02 14:19:51 +00:00 committed by Richard Biener
parent 9220b5116d
commit d6476f90da
4 changed files with 61 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2018-05-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/85597
* tree-vect-stmts.c (vectorizable_operation): For ternary SLP
do not use split vect_get_vec_defs call but call vect_get_slp_defs
directly.
2018-05-02 Tom de Vries <tom@codesourcery.com>
PR testsuite/85106

View file

@ -1,3 +1,8 @@
2018-05-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/85597
* gcc.dg/vect/pr85597.c: New testcase.
2018-05-02 Tom de Vries <tom@codesourcery.com>
PR testsuite/85106

View file

@ -0,0 +1,26 @@
/* { dg-do compile } */
/* { dg-options "-O3" } */
/* { dg-additional-options "-mfma" { target { x86_64-*-* i?86-*-* } } } */
extern double fma (double, double, double);
static inline void
bar (int i, double *D, double *S)
{
while (i-- > 0)
{
D[0] = fma (1, S[0], D[0]);
D[1] = fma (1, S[1], D[1]);
D[2] = fma (1, S[2], D[2]);
D[3] = fma (1, S[3], D[3]);
D += 4;
S += 4;
}
}
void
foo (double *d, double *s)
{
bar (10, d, s);
}

View file

@ -5923,15 +5923,34 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
/* Handle uses. */
if (j == 0)
{
if (op_type == binary_op || op_type == ternary_op)
if (op_type == binary_op)
vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1,
slp_node);
else if (op_type == ternary_op)
{
if (slp_node)
{
auto_vec<tree> ops(3);
ops.quick_push (op0);
ops.quick_push (op1);
ops.quick_push (op2);
auto_vec<vec<tree> > vec_defs(3);
vect_get_slp_defs (ops, slp_node, &vec_defs);
vec_oprnds0 = vec_defs[0];
vec_oprnds1 = vec_defs[1];
vec_oprnds2 = vec_defs[2];
}
else
{
vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1,
NULL);
vect_get_vec_defs (op2, NULL_TREE, stmt, &vec_oprnds2, NULL,
NULL);
}
}
else
vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,
slp_node);
if (op_type == ternary_op)
vect_get_vec_defs (op2, NULL_TREE, stmt, &vec_oprnds2, NULL,
slp_node);
}
else
{