]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Default expand_vec_cond_expr_p code to ERROR_MARK
authorRichard Biener <rguenther@suse.de>
Fri, 25 Oct 2024 10:38:24 +0000 (12:38 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 25 Oct 2024 11:44:33 +0000 (13:44 +0200)
As we want to transition to only vcond_mask expanders the following
makes it possible to easier distinguish queries that rely on
vcond queries for expand_vec_cond_expr_p from those of vcond_mask
by for the latter having the comparison code defaulted to ERROR_MARK.

* optabs-tree.h (expand_vec_cond_expr_p): Default the
comparison code to ERROR_MARK.
* match.pd: Remove unneded expand_vec_cond_expr_p args.
* tree-vect-generic.cc (expand_vector_condition): Likewise.
* tree-vect-loop.cc (vect_reduction_update_partial_vector_usage):
Likewise.
* tree-vect-stmts.cc (vectorizable_simd_clone_call): Likewise.
(scan_store_can_perm_p): Likewise.
(vectorizable_condition): Likewise.

gcc/match.pd
gcc/optabs-tree.h
gcc/tree-vect-generic.cc
gcc/tree-vect-loop.cc
gcc/tree-vect-stmts.cc

index 93536a39348dba0b3802998d43df5d7403633d96..e622ccbd67c0973b43e6865f1a36277728c7ac7c 100644 (file)
@@ -411,7 +411,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
        tree ones = build_all_ones_cst (vec_cmp_type);
       }
       (if (expand_vec_cmp_expr_p (vec_cmp_type, vec_truth_type, LT_EXPR)
-          && expand_vec_cond_expr_p (vec_cmp_type, vec_truth_type, LT_EXPR))
+          && expand_vec_cond_expr_p (vec_cmp_type, vec_truth_type))
        (view_convert:type (vec_cond (lt:vec_truth_type
                                     (view_convert:vec_cmp_type @0)
                                     { zeros; })
@@ -5805,13 +5805,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
   (if (VECTOR_TYPE_P (type)
        && (TREE_CODE_CLASS (op) != tcc_comparison
           || types_match (type, TREE_TYPE (@1))
-          || expand_vec_cond_expr_p (type, TREE_TYPE (@0), ERROR_MARK)
+          || expand_vec_cond_expr_p (type, TREE_TYPE (@0))
           || (optimize_vectors_before_lowering_p ()
               /* The following is optimistic on the side of non-support, we are
                  missing the legacy vcond{,u,eq} cases.  Do this only when
                  lowering will be able to fixup..  */
-              && !expand_vec_cond_expr_p (TREE_TYPE (@1),
-                                          TREE_TYPE (@0), ERROR_MARK))))
+              && !expand_vec_cond_expr_p (TREE_TYPE (@1), TREE_TYPE (@0)))))
    (vec_cond @0 (op! @1 @3) (op! @2 @4))))
 
 /* (c ? a : b) op d  -->  c ? (a op d) : (b op d) */
@@ -5820,20 +5819,18 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
   (if (VECTOR_TYPE_P (type)
        && (TREE_CODE_CLASS (op) != tcc_comparison
           || types_match (type, TREE_TYPE (@1))
-          || expand_vec_cond_expr_p (type, TREE_TYPE (@0), ERROR_MARK)
+          || expand_vec_cond_expr_p (type, TREE_TYPE (@0))
           || (optimize_vectors_before_lowering_p ()
-              && !expand_vec_cond_expr_p (TREE_TYPE (@1),
-                                          TREE_TYPE (@0), ERROR_MARK))))
+              && !expand_vec_cond_expr_p (TREE_TYPE (@1), TREE_TYPE (@0)))))
    (vec_cond @0 (op! @1 @3) (op! @2 @3))))
  (simplify
   (op @3 (vec_cond:s @0 @1 @2))
   (if (VECTOR_TYPE_P (type)
        && (TREE_CODE_CLASS (op) != tcc_comparison
           || types_match (type, TREE_TYPE (@1))
-          || expand_vec_cond_expr_p (type, TREE_TYPE (@0), ERROR_MARK)
+          || expand_vec_cond_expr_p (type, TREE_TYPE (@0))
           || (optimize_vectors_before_lowering_p ()
-              && !expand_vec_cond_expr_p (TREE_TYPE (@1),
-                                          TREE_TYPE (@0), ERROR_MARK))))
+              && !expand_vec_cond_expr_p (TREE_TYPE (@1), TREE_TYPE (@0)))))
    (vec_cond @0 (op! @3 @1) (op! @3 @2)))))
 
 #if GIMPLE
index f2b49991462d30842ace22356bf874d5271435f5..85805fd8296a798d1c35f72cd8c26838ce2afadc 100644 (file)
@@ -43,7 +43,7 @@ supportable_half_widening_operation (enum tree_code, tree, tree,
 bool supportable_convert_operation (enum tree_code, tree, tree,
                                    enum tree_code *);
 bool expand_vec_cmp_expr_p (tree, tree, enum tree_code);
-bool expand_vec_cond_expr_p (tree, tree, enum tree_code);
+bool expand_vec_cond_expr_p (tree, tree, enum tree_code = ERROR_MARK);
 void init_tree_optimization_optabs (tree);
 bool target_supports_op_p (tree, enum tree_code,
                           enum optab_subtype = optab_default);
index f6f52569f43304f4b83e5858dbf93159bbef50b1..ef7d2dd259da09208782a57cc7f11faf02cd8ff3 100644 (file)
@@ -1051,7 +1051,7 @@ expand_vector_condition (gimple_stmt_iterator *gsi, bitmap dce_ssa_names)
      VEC_COND_EXPR could be supported individually.  See PR109176.  */
   if (a_is_comparison
       && VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (a))
-      && expand_vec_cond_expr_p (type, TREE_TYPE (a), SSA_NAME)
+      && expand_vec_cond_expr_p (type, TREE_TYPE (a))
       && expand_vec_cmp_expr_p (TREE_TYPE (a1), TREE_TYPE (a), code))
     return true;
 
index 414f8360e518f45199cc4c7ef14d18c1955b5789..b8e155b90f81b0eacae6b7548c1b5d9e73be0c80 100644 (file)
@@ -7418,8 +7418,7 @@ vect_reduction_update_partial_vector_usage (loop_vec_info loop_vinfo,
     }
   else if (reduc_type == FOLD_LEFT_REDUCTION
           && reduc_fn == IFN_LAST
-          && !expand_vec_cond_expr_p (vectype_in, truth_type_for (vectype_in),
-                                      SSA_NAME))
+          && !expand_vec_cond_expr_p (vectype_in, truth_type_for (vectype_in)))
     {
       if (dump_enabled_p ())
        dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
index 9f1449dfc259dd760fff3c3c0b38383dfcabfab2..396eea070a4ebcbfc3542eb6c9c7eb04d2f988f1 100644 (file)
@@ -4292,7 +4292,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, stmt_vec_info stmt_info,
                  return false;
                }
              if (!expand_vec_cond_expr_p (clone_arg_vectype,
-                                          arginfo[i].vectype, ERROR_MARK))
+                                          arginfo[i].vectype))
                {
                  if (dump_enabled_p ())
                    dump_printf_loc (MSG_MISSED_OPTIMIZATION,
@@ -7425,7 +7425,7 @@ scan_store_can_perm_p (tree vectype, tree init,
                  || !initializer_zerop (init))
                {
                  tree masktype = truth_type_for (vectype);
-                 if (!expand_vec_cond_expr_p (vectype, masktype, VECTOR_CST))
+                 if (!expand_vec_cond_expr_p (vectype, masktype))
                    return -1;
                  whole_vector_shift_kind = scan_store_kind_lshift_cond;
                }
@@ -12432,8 +12432,7 @@ vectorizable_condition (vec_info *vinfo,
               && (masked
                   || (!expand_vec_cmp_expr_p (comp_vectype, vec_cmp_type,
                                               cond_code)
-                      || !expand_vec_cond_expr_p (vectype, vec_cmp_type,
-                                                  ERROR_MARK))))
+                      || !expand_vec_cond_expr_p (vectype, vec_cmp_type))))
        return false;
 
       if (slp_node