Commit 6e222b2a by Richard Biener Committed by Richard Biener

re PR tree-optimization/91822 (FAIL: gcc.dg/pr88031.c (internal compiler error))

2019-09-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91822
	* tree-vectorizer.h (vectorizable_condition): Restore for_reduction
	parameter.
	* tree-vect-loop.c (vectorizable_reduction): Adjust asserts
	for reduc_index in nested cycles, adjust vectorizable_condition
	calls.
	* tree-vect-stmts.c (vectorizable_condition): Restore for_reduction
	parameter.
	(vect_analyze_stmt): Adjust.
	(vect_transform_stmt): Likewise.

From-SVN: r275990
parent d865ed72
2019-09-20 Richard Biener <rguenther@suse.de> 2019-09-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/91822
* tree-vectorizer.h (vectorizable_condition): Restore for_reduction
parameter.
* tree-vect-loop.c (vectorizable_reduction): Adjust asserts
for reduc_index in nested cycles, adjust vectorizable_condition
calls.
* tree-vect-stmts.c (vectorizable_condition): Restore for_reduction
parameter.
(vect_analyze_stmt): Adjust.
(vect_transform_stmt): Likewise.
2019-09-20 Richard Biener <rguenther@suse.de>
PR target/91767 PR target/91767
* config/i386/i386-features.c (general_scalar_chain::convert_registers): * config/i386/i386-features.c (general_scalar_chain::convert_registers):
Ensure there's a sequence point between allocating the new register Ensure there's a sequence point between allocating the new register
......
...@@ -6534,9 +6534,10 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, ...@@ -6534,9 +6534,10 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
{ {
/* Only call during the analysis stage, otherwise we'll lose /* Only call during the analysis stage, otherwise we'll lose
STMT_VINFO_TYPE. */ STMT_VINFO_TYPE. */
gcc_assert (reduc_index > 0); gcc_assert (nested_cycle || reduc_index > 0);
if (!vec_stmt && !vectorizable_condition (stmt_info, gsi, NULL, if (!vec_stmt && !vectorizable_condition (stmt_info, gsi, NULL,
reduc_index, NULL, cost_vec)) true, reduc_index,
NULL, cost_vec))
{ {
if (dump_enabled_p ()) if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
...@@ -6991,7 +6992,7 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, ...@@ -6991,7 +6992,7 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
{ {
gcc_assert (!slp_node && reduc_index > 0); gcc_assert (!slp_node && reduc_index > 0);
return vectorizable_condition (stmt_info, gsi, vec_stmt, return vectorizable_condition (stmt_info, gsi, vec_stmt,
reduc_index, NULL, NULL); true, reduc_index, NULL, NULL);
} }
/* Create the destination vector */ /* Create the destination vector */
...@@ -7021,8 +7022,8 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, ...@@ -7021,8 +7022,8 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
{ {
if (code == COND_EXPR) if (code == COND_EXPR)
{ {
gcc_assert (!slp_node && reduc_index > 0); gcc_assert (!slp_node && (nested_cycle || reduc_index > 0));
vectorizable_condition (stmt_info, gsi, vec_stmt, vectorizable_condition (stmt_info, gsi, vec_stmt, true,
reduc_index, NULL, NULL); reduc_index, NULL, NULL);
break; break;
} }
......
...@@ -9778,7 +9778,8 @@ vect_is_simple_cond (tree cond, vec_info *vinfo, ...@@ -9778,7 +9778,8 @@ vect_is_simple_cond (tree cond, vec_info *vinfo,
bool bool
vectorizable_condition (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, vectorizable_condition (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
stmt_vec_info *vec_stmt, int reduc_index, stmt_vec_info *vec_stmt, bool for_reduction,
int reduc_index,
slp_tree slp_node, stmt_vector_for_cost *cost_vec) slp_tree slp_node, stmt_vector_for_cost *cost_vec)
{ {
vec_info *vinfo = stmt_info->vinfo; vec_info *vinfo = stmt_info->vinfo;
...@@ -9807,7 +9808,6 @@ vectorizable_condition (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, ...@@ -9807,7 +9808,6 @@ vectorizable_condition (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
vec<tree> vec_oprnds3 = vNULL; vec<tree> vec_oprnds3 = vNULL;
tree vec_cmp_type; tree vec_cmp_type;
bool masked = false; bool masked = false;
bool for_reduction = (reduc_index > 0);
if (for_reduction && STMT_SLP_TYPE (stmt_info)) if (for_reduction && STMT_SLP_TYPE (stmt_info))
return false; return false;
...@@ -10668,7 +10668,7 @@ vect_analyze_stmt (stmt_vec_info stmt_info, bool *need_to_vectorize, ...@@ -10668,7 +10668,7 @@ vect_analyze_stmt (stmt_vec_info stmt_info, bool *need_to_vectorize,
node_instance, cost_vec) node_instance, cost_vec)
|| vectorizable_induction (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_induction (stmt_info, NULL, NULL, node, cost_vec)
|| vectorizable_shift (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_shift (stmt_info, NULL, NULL, node, cost_vec)
|| vectorizable_condition (stmt_info, NULL, NULL, 0, node, || vectorizable_condition (stmt_info, NULL, NULL, false, -1, node,
cost_vec) cost_vec)
|| vectorizable_comparison (stmt_info, NULL, NULL, node, || vectorizable_comparison (stmt_info, NULL, NULL, node,
cost_vec)); cost_vec));
...@@ -10687,7 +10687,7 @@ vect_analyze_stmt (stmt_vec_info stmt_info, bool *need_to_vectorize, ...@@ -10687,7 +10687,7 @@ vect_analyze_stmt (stmt_vec_info stmt_info, bool *need_to_vectorize,
|| vectorizable_load (stmt_info, NULL, NULL, node, node_instance, || vectorizable_load (stmt_info, NULL, NULL, node, node_instance,
cost_vec) cost_vec)
|| vectorizable_store (stmt_info, NULL, NULL, node, cost_vec) || vectorizable_store (stmt_info, NULL, NULL, node, cost_vec)
|| vectorizable_condition (stmt_info, NULL, NULL, 0, node, || vectorizable_condition (stmt_info, NULL, NULL, false, -1, node,
cost_vec) cost_vec)
|| vectorizable_comparison (stmt_info, NULL, NULL, node, || vectorizable_comparison (stmt_info, NULL, NULL, node,
cost_vec)); cost_vec));
...@@ -10792,7 +10792,7 @@ vect_transform_stmt (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, ...@@ -10792,7 +10792,7 @@ vect_transform_stmt (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
break; break;
case condition_vec_info_type: case condition_vec_info_type:
done = vectorizable_condition (stmt_info, gsi, &vec_stmt, 0, done = vectorizable_condition (stmt_info, gsi, &vec_stmt, false, -1,
slp_node, NULL); slp_node, NULL);
gcc_assert (done); gcc_assert (done);
break; break;
......
...@@ -1534,7 +1534,7 @@ extern void vect_remove_stores (stmt_vec_info); ...@@ -1534,7 +1534,7 @@ extern void vect_remove_stores (stmt_vec_info);
extern opt_result vect_analyze_stmt (stmt_vec_info, bool *, slp_tree, extern opt_result vect_analyze_stmt (stmt_vec_info, bool *, slp_tree,
slp_instance, stmt_vector_for_cost *); slp_instance, stmt_vector_for_cost *);
extern bool vectorizable_condition (stmt_vec_info, gimple_stmt_iterator *, extern bool vectorizable_condition (stmt_vec_info, gimple_stmt_iterator *,
stmt_vec_info *, int, slp_tree, stmt_vec_info *, bool, int, slp_tree,
stmt_vector_for_cost *); stmt_vector_for_cost *);
extern bool vectorizable_shift (stmt_vec_info, gimple_stmt_iterator *, extern bool vectorizable_shift (stmt_vec_info, gimple_stmt_iterator *,
stmt_vec_info *, slp_tree, stmt_vec_info *, slp_tree,
......
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