Assert finished vectorizer pattern COND_EXPR transition

The following places a few strathegic asserts so we do not end up
with COND_EXPRs with a comparison as the first operand during
vectorization.

	* tree-vect-slp.cc (vect_get_operand_map): Mark
	COMPARISON_CLASS_P COND_EXPR condition path unreachable.
	* tree-vect-stmts.cc (vect_is_simple_use): Likewise.
	(vectorizable_condition): Assert the COND_EXPR condition isn't
	COMPARISON_CLASS_P.
This commit is contained in:
Richard Biener 2024-10-25 14:27:37 +02:00 committed by Richard Biener
parent 9fd8636167
commit d17e672ce8
2 changed files with 3 additions and 7 deletions

View File

@ -549,7 +549,7 @@ vect_get_operand_map (const gimple *stmt, bool gather_scatter_p = false,
{
if (gimple_assign_rhs_code (assign) == COND_EXPR
&& COMPARISON_CLASS_P (gimple_assign_rhs1 (assign)))
return cond_expr_maps[swap];
gcc_unreachable ();
if (TREE_CODE_CLASS (gimple_assign_rhs_code (assign)) == tcc_comparison
&& swap)
return op1_op0_map;

View File

@ -12290,6 +12290,7 @@ vectorizable_condition (vec_info *vinfo,
return false; /* FORNOW */
cond_expr = gimple_assign_rhs1 (stmt);
gcc_assert (! COMPARISON_CLASS_P (cond_expr));
if (!vect_is_simple_cond (cond_expr, vinfo, stmt_info, slp_node,
&comp_vectype, &dts[0], vectype)
@ -14257,12 +14258,7 @@ vect_is_simple_use (vec_info *vinfo, stmt_vec_info stmt, slp_tree slp_node,
{
if (gimple_assign_rhs_code (ass) == COND_EXPR
&& COMPARISON_CLASS_P (gimple_assign_rhs1 (ass)))
{
if (operand < 2)
*op = TREE_OPERAND (gimple_assign_rhs1 (ass), operand);
else
*op = gimple_op (ass, operand);
}
gcc_unreachable ();
else if (gimple_assign_rhs_code (ass) == VIEW_CONVERT_EXPR)
*op = TREE_OPERAND (gimple_assign_rhs1 (ass), 0);
else