aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-10-25 12:38:24 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2024-10-25 13:44:33 +0200
commit35c3aac80e7a18c32436259143cba0f47bd0cb5a (patch)
tree1bcbfc83788e8145c96427a0696cadcb6451e213
parenta0e37a6bf6e13968ddad3560213eece4baa34bee (diff)
downloadgcc-35c3aac80e7a18c32436259143cba0f47bd0cb5a.zip
gcc-35c3aac80e7a18c32436259143cba0f47bd0cb5a.tar.gz
gcc-35c3aac80e7a18c32436259143cba0f47bd0cb5a.tar.bz2
Default expand_vec_cond_expr_p code to ERROR_MARK
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.
-rw-r--r--gcc/match.pd17
-rw-r--r--gcc/optabs-tree.h2
-rw-r--r--gcc/tree-vect-generic.cc2
-rw-r--r--gcc/tree-vect-loop.cc3
-rw-r--r--gcc/tree-vect-stmts.cc7
5 files changed, 13 insertions, 18 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index 93536a3..e622ccb 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -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
diff --git a/gcc/optabs-tree.h b/gcc/optabs-tree.h
index f2b4999..85805fd 100644
--- a/gcc/optabs-tree.h
+++ b/gcc/optabs-tree.h
@@ -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);
diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc
index f6f5256..ef7d2dd 100644
--- a/gcc/tree-vect-generic.cc
+++ b/gcc/tree-vect-generic.cc
@@ -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;
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 414f836..b8e155b 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -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,
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 9f1449d..396eea0 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -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