Commit 41b32876 by Richard Biener Committed by Richard Biener

re PR tree-optimization/87931 (ICE in vectorizable_reduction, at…

re PR tree-optimization/87931 (ICE in vectorizable_reduction, at tree-vect-loop.c:6193 since r265876)

2018-11-13  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/87931
	* tree-vect-loop.c (vect_is_simple_reduction): Restrict
	nested cycles we support to latch computations vectorizable_reduction
	handles.

	* gcc.dg/graphite/pr87931.c: New testcase.

From-SVN: r266075
parent 160576e1
2018-11-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/87931
* tree-vect-loop.c (vect_is_simple_reduction): Restrict
nested cycles we support to latch computations vectorizable_reduction
handles.
2018-11-13 Martin Liska <mliska@suse.cz> 2018-11-13 Martin Liska <mliska@suse.cz>
PR tree-optimization/87885 PR tree-optimization/87885
2018-11-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/87931
* gcc.dg/graphite/pr87931.c: New testcase.
2018-11-13 Martin Liska <mliska@suse.cz> 2018-11-13 Martin Liska <mliska@suse.cz>
PR sanitizer/87930 PR sanitizer/87930
......
/* { dg-do compile } */
/* { dg-options "-O3 -fno-tree-copy-prop -fgraphite-identity" } */
#define N 40
#define M 128
float in[N+M];
float coeff[M];
float fir_out[N];
void fir ()
{
int i,j,k;
float diff;
for (i = 0; i < N; i++) {
diff = 0;
for (j = 0; j < M; j++) {
diff += in[j+i]*coeff[j];
}
fir_out[i] = diff;
}
}
...@@ -2976,6 +2976,22 @@ vect_is_simple_reduction (loop_vec_info loop_info, stmt_vec_info phi_info, ...@@ -2976,6 +2976,22 @@ vect_is_simple_reduction (loop_vec_info loop_info, stmt_vec_info phi_info,
if (nested_in_vect_loop && !check_reduction) if (nested_in_vect_loop && !check_reduction)
{ {
/* FIXME: Even for non-reductions code generation is funneled
through vectorizable_reduction for the stmt defining the
PHI latch value. So we have to artificially restrict ourselves
for the supported operations. */
switch (get_gimple_rhs_class (code))
{
case GIMPLE_BINARY_RHS:
case GIMPLE_TERNARY_RHS:
break;
default:
/* Not supported by vectorizable_reduction. */
if (dump_enabled_p ())
report_vect_op (MSG_MISSED_OPTIMIZATION, def_stmt,
"nested cycle: not handled operation: ");
return NULL;
}
if (dump_enabled_p ()) if (dump_enabled_p ())
report_vect_op (MSG_NOTE, def_stmt, "detected nested cycle: "); report_vect_op (MSG_NOTE, def_stmt, "detected nested cycle: ");
return def_stmt_info; return def_stmt_info;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment