From c7fba0e96641e57164fc72bdbffd9a1cea244818 Mon Sep 17 00:00:00 2001 From: Victor Do Nascimento Date: Wed, 22 May 2024 10:06:57 +0100 Subject: autovectorizer: Add basic support for convert optabs Given the shift from modeling dot products as direct optabs to treating them as conversion optabs, we make necessary changes to the autovectorizer code to ensure that given the relevant tree code, together with the input and output data modes, we can retrieve the relevant optab and subsequently the insn_code for it. gcc/ChangeLog: * gimple-match-exports.cc (directly_supported_p): Add overload for conversion-type optabs. * gimple-match.h (directly_supported_p): Add new function prototype. * optabs.cc (expand_widen_pattern_expr): Make the DOT_PROD_EXPR tree code use `find_widening_optab_handler' to retrieve icode. * tree-vect-loop.cc (vect_is_emulated_mixed_dot_prod): make it call conversion-type overloaded `directly_supported_p'. * tree-vect-patterns.cc (vect_supportable_conv_optab_p): New. (vect_recog_dot_prod_pattern): s/direct/conv/ in call to `vect_supportable_direct_optab_p'. --- gcc/tree-vect-loop.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/tree-vect-loop.cc') diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 0ce1bf8..a5a4461 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -5244,6 +5244,7 @@ vect_is_emulated_mixed_dot_prod (stmt_vec_info stmt_info) gcc_assert (STMT_VINFO_REDUC_VECTYPE_IN (stmt_info)); return !directly_supported_p (DOT_PROD_EXPR, + STMT_VINFO_VECTYPE (stmt_info), STMT_VINFO_REDUC_VECTYPE_IN (stmt_info), optab_vector_mixed_sign); } -- cgit v1.1