]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Assert finished vectorizer pattern COND_EXPR transition
authorRichard Biener <rguenther@suse.de>
Fri, 25 Oct 2024 12:27:37 +0000 (14:27 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 26 Oct 2024 12:15:23 +0000 (14:15 +0200)
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.

gcc/tree-vect-slp.cc
gcc/tree-vect-stmts.cc

index b192328e3eb7454de558b755bbbc493a969339b2..2e98a943e0615d503a10a60828dfc85a230505f2 100644 (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;
index 396eea070a4ebcbfc3542eb6c9c7eb04d2f988f1..4a824d1695503f6ec173a4d8b155fa1c2ebc1d21 100644 (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