This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR88031
On Mon, 19 Nov 2018, Christophe Lyon wrote:
> On Thu, 15 Nov 2018 at 14:41, Richard Biener <rguenther@suse.de> wrote:
> >
> >
> > With one of my last changes we regressed here so this goes all the
> > way cleaning up things so we only have a single flag to
> > vectorizable_condition whetehr we are called from reduction context.
> > In theory the !multiple-types restriction could be easily lifted now
> > (just remove the check).
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
> >
> > Richard.
> >
> > 2018-11-15 Richard Biener <rguenther@suse.de>
> >
> > PR tree-optimization/88031
> > * tree-vect-loop.c (vectorizable_reduction): Move check
> > for multiple types earlier so we get the expected dump.
> > Simplify calls to vectorizable_condition.
> > * tree-vect-stmts.h (vectorizable_condition): Update prototype.
> > * tree-vect-stmts.c (vectorizable_condition): Instead of
> > reduc_def and reduc_index take just a flag. Simplify
> > code-generation now that we can rely on the defs being set up.
> > (vectorizable_comparison): Remove unused argument.
> >
> > * gcc.dg/pr88031.c: New testcase.
> >
>
> Hi Richard,
>
> Since you committed this patch (r266182),
> I've noticed regressions on aarch64:
> gcc.target/aarch64/sve/clastb_1.c -march=armv8.2-a+sve (internal
> compiler error)
> gcc.target/aarch64/sve/clastb_2.c -march=armv8.2-a+sve (internal
> compiler error)
> gcc.target/aarch64/sve/clastb_3.c -march=armv8.2-a+sve (internal
> compiler error)
> gcc.target/aarch64/sve/clastb_4.c -march=armv8.2-a+sve (internal
> compiler error)
> gcc.target/aarch64/sve/clastb_5.c -march=armv8.2-a+sve (internal
> compiler error)
> gcc.target/aarch64/sve/clastb_6.c -march=armv8.2-a+sve (internal
> compiler error)
> gcc.target/aarch64/sve/clastb_7.c -march=armv8.2-a+sve (internal
> compiler error)
>
> during GIMPLE pass: vect
> /gcc/testsuite/gcc.target/aarch64/sve/clastb_1.c: In function
> 'condition_reduction':
> /gcc/testsuite/gcc.target/aarch64/sve/clastb_1.c:9:1: internal
> compiler error: in vect_get_vec_def_for_operand_1, at
> tree-vect-stmts.c:1485
I am testing the following.
Richard.
2018-11-20 Richard Biener <rguenther@suse.de>
* tree-vect-stmts.c (vectorizable_condition): Do not get
at else_clause vect def for EXTRACT_LAST_REDUCTION. Remove
pointless vect_is_simple_use calls.
Index: gcc/tree-vect-stmts.c
===================================================================
--- gcc/tree-vect-stmts.c (revision 266306)
+++ gcc/tree-vect-stmts.c (working copy)
@@ -8911,26 +8911,21 @@ vectorizable_condition (stmt_vec_info st
vec_cond_lhs
= vect_get_vec_def_for_operand (cond_expr, stmt_info,
comp_vectype);
- vect_is_simple_use (cond_expr, stmt_info->vinfo, &dts[0]);
}
else
{
vec_cond_lhs
= vect_get_vec_def_for_operand (cond_expr0,
stmt_info, comp_vectype);
- vect_is_simple_use (cond_expr0, loop_vinfo, &dts[0]);
-
vec_cond_rhs
= vect_get_vec_def_for_operand (cond_expr1,
stmt_info, comp_vectype);
- vect_is_simple_use (cond_expr1, loop_vinfo, &dts[1]);
}
vec_then_clause = vect_get_vec_def_for_operand (then_clause,
stmt_info);
- vect_is_simple_use (then_clause, loop_vinfo, &dts[2]);
- vec_else_clause = vect_get_vec_def_for_operand (else_clause,
- stmt_info);
- vect_is_simple_use (else_clause, loop_vinfo, &dts[3]);
+ if (reduction_type != EXTRACT_LAST_REDUCTION)
+ vec_else_clause = vect_get_vec_def_for_operand (else_clause,
+ stmt_info);
}
}
else