aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-11-15 13:59:02 +0100
committerRichard Biener <rguenth@gcc.gnu.org>2024-11-15 15:05:36 +0100
commitc57b2f88c93a00f4248b4e5da4de90d142967b4c (patch)
tree81b2811834b1e653557286a9a5e711565cacfbcc /gcc
parenta064fed18a02696586cd8c182fd56c571c9438c1 (diff)
downloadgcc-c57b2f88c93a00f4248b4e5da4de90d142967b4c.zip
gcc-c57b2f88c93a00f4248b4e5da4de90d142967b4c.tar.gz
gcc-c57b2f88c93a00f4248b4e5da4de90d142967b4c.tar.bz2
Remove unused vcond{,u,eq} expander infrastructure
Now that we no longer exercise vcond{,u,eq} patterns remove unused infrastructure. * optabs-query.h (get_vcond_icode): Remove. (get_vcond_eq_icode): Likewise. * optabs-tree.h (expand_vec_cond_expr_p): Remove code argument. * optabs-tree.cc (expand_vec_cond_expr_p): Likewise. (vcond_icode_p): Remove. (vcond_eq_icode_p): Likewise. * optabs.h (can_vcond_compare_p): Remove. * optabs.cc (can_vcond_compare_p): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/optabs-query.h23
-rw-r--r--gcc/optabs-tree.cc44
-rw-r--r--gcc/optabs-tree.h2
-rw-r--r--gcc/optabs.cc16
-rw-r--r--gcc/optabs.h5
5 files changed, 3 insertions, 87 deletions
diff --git a/gcc/optabs-query.h b/gcc/optabs-query.h
index 0cb2c21..932ee36 100644
--- a/gcc/optabs-query.h
+++ b/gcc/optabs-query.h
@@ -108,20 +108,6 @@ get_vec_cmp_eq_icode (machine_mode vmode, machine_mode mask_mode)
return convert_optab_handler (vec_cmpeq_optab, vmode, mask_mode);
}
-/* Return insn code for a conditional operator with a comparison in
- mode CMODE, unsigned if UNS is true, resulting in a value of mode VMODE. */
-
-inline enum insn_code
-get_vcond_icode (machine_mode vmode, machine_mode cmode, bool uns)
-{
- enum insn_code icode = CODE_FOR_nothing;
- if (uns)
- icode = convert_optab_handler (vcondu_optab, vmode, cmode);
- else
- icode = convert_optab_handler (vcond_optab, vmode, cmode);
- return icode;
-}
-
/* Return insn code for a conditional operator with a mask mode
MMODE resulting in a value of mode VMODE. */
@@ -131,15 +117,6 @@ get_vcond_mask_icode (machine_mode vmode, machine_mode mmode)
return convert_optab_handler (vcond_mask_optab, vmode, mmode);
}
-/* Return insn code for a conditional operator with a comparison in
- mode CMODE (only EQ/NE), resulting in a value of mode VMODE. */
-
-inline enum insn_code
-get_vcond_eq_icode (machine_mode vmode, machine_mode cmode)
-{
- return convert_optab_handler (vcondeq_optab, vmode, cmode);
-}
-
/* Enumerates the possible extraction_insn operations. */
enum extraction_pattern { EP_insv, EP_extv, EP_extzv };
diff --git a/gcc/optabs-tree.cc b/gcc/optabs-tree.cc
index b69a5bc..f5ef674 100644
--- a/gcc/optabs-tree.cc
+++ b/gcc/optabs-tree.cc
@@ -446,59 +446,19 @@ expand_vec_cmp_expr_p (tree value_type, tree mask_type, enum tree_code code)
|| vec_cmp_eq_icode_p (value_type, mask_type, code);
}
-/* Return true iff vcond_optab/vcondu_optab can handle a vector
- comparison for code CODE, comparing operands of type CMP_OP_TYPE and
- producing a result of type VALUE_TYPE. */
-
-static bool
-vcond_icode_p (tree value_type, tree cmp_op_type, enum tree_code code)
-{
- enum rtx_code rcode = get_rtx_code_1 (code, TYPE_UNSIGNED (cmp_op_type));
- if (rcode == UNKNOWN)
- return false;
-
- return can_vcond_compare_p (rcode, TYPE_MODE (value_type),
- TYPE_MODE (cmp_op_type));
-}
-
-/* Return true iff vcondeq_optab can handle a vector comparison for code CODE,
- comparing operands of type CMP_OP_TYPE and producing a result of type
- VALUE_TYPE. */
-
-static bool
-vcond_eq_icode_p (tree value_type, tree cmp_op_type, enum tree_code code)
-{
- if (code != EQ_EXPR && code != NE_EXPR)
- return false;
-
- return get_vcond_eq_icode (TYPE_MODE (value_type), TYPE_MODE (cmp_op_type))
- != CODE_FOR_nothing;
-}
-
/* Return TRUE iff, appropriate vector insns are available
for vector cond expr with vector type VALUE_TYPE and a comparison
with operand vector types in CMP_OP_TYPE. */
bool
-expand_vec_cond_expr_p (tree value_type, tree cmp_op_type, enum tree_code code)
+expand_vec_cond_expr_p (tree value_type, tree cmp_op_type)
{
- machine_mode value_mode = TYPE_MODE (value_type);
- machine_mode cmp_op_mode = TYPE_MODE (cmp_op_type);
if (VECTOR_BOOLEAN_TYPE_P (cmp_op_type)
&& get_vcond_mask_icode (TYPE_MODE (value_type),
TYPE_MODE (cmp_op_type)) != CODE_FOR_nothing)
return true;
- if (maybe_ne (GET_MODE_NUNITS (value_mode), GET_MODE_NUNITS (cmp_op_mode)))
- return false;
-
- if (TREE_CODE_CLASS (code) != tcc_comparison)
- /* This may happen, for example, if code == SSA_NAME, in which case we
- cannot be certain whether a vector insn is available. */
- return false;
-
- return vcond_icode_p (value_type, cmp_op_type, code)
- || vcond_eq_icode_p (value_type, cmp_op_type, code);
+ return false;
}
/* Use the current target and options to initialize
diff --git a/gcc/optabs-tree.h b/gcc/optabs-tree.h
index 85805fd..afd6fd5 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 = ERROR_MARK);
+bool expand_vec_cond_expr_p (tree, tree);
void init_tree_optimization_optabs (tree);
bool target_supports_op_p (tree, enum tree_code,
enum optab_subtype = optab_default);
diff --git a/gcc/optabs.cc b/gcc/optabs.cc
index 03ef0c5..fa51e49 100644
--- a/gcc/optabs.cc
+++ b/gcc/optabs.cc
@@ -4364,22 +4364,6 @@ can_vec_cmp_compare_p (enum rtx_code code, machine_mode value_mode,
return insn_predicate_matches_p (icode, 1, code, mask_mode, value_mode);
}
-/* Return whether the backend can emit a vector comparison (vcond/vcondu) for
- code CODE, comparing operands of mode CMP_OP_MODE and producing a result
- with VALUE_MODE. */
-
-bool
-can_vcond_compare_p (enum rtx_code code, machine_mode value_mode,
- machine_mode cmp_op_mode)
-{
- enum insn_code icode
- = get_vcond_icode (value_mode, cmp_op_mode, unsigned_optab_p (code));
- if (icode == CODE_FOR_nothing)
- return false;
-
- return insn_predicate_matches_p (icode, 3, code, value_mode, cmp_op_mode);
-}
-
/* Return whether the backend can emit vector set instructions for inserting
element into vector at variable index position. */
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 86a6086..a1dbaf8 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -262,11 +262,6 @@ extern bool can_compare_p (enum rtx_code, machine_mode,
with MASK_MODE. */
extern bool can_vec_cmp_compare_p (enum rtx_code, machine_mode, machine_mode);
-/* Return whether the backend can emit a vector comparison (vcond/vcondu) for
- code CODE, comparing operands of mode CMP_OP_MODE and producing a result
- with VALUE_MODE. */
-extern bool can_vcond_compare_p (enum rtx_code, machine_mode, machine_mode);
-
/* Return whether the backend can emit vector set instructions for inserting
element into vector at variable index position. */
extern bool can_vec_set_var_idx_p (machine_mode);