From bce29d65ebe1316d15ec7582a1d257ef1be163f7 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Tue, 18 Jun 2019 08:09:00 +0000 Subject: [Vectorizer] Support masking fold left reductions This patch adds support in the vectorizer for masking fold left reductions. This avoids the need to insert a conditional assignement with some identity value. From-SVN: r272407 --- gcc/internal-fn.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/internal-fn.c') diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c index 04081f3..90f8e56 100644 --- a/gcc/internal-fn.c +++ b/gcc/internal-fn.c @@ -117,6 +117,7 @@ init_internal_fns () #define while_direct { 0, 2, false } #define fold_extract_direct { 2, 2, false } #define fold_left_direct { 1, 1, false } +#define mask_fold_left_direct { 1, 1, false } const direct_internal_fn_info direct_internal_fn_array[IFN_LAST + 1] = { #define DEF_INTERNAL_FN(CODE, FLAGS, FNSPEC) not_direct, @@ -3000,6 +3001,9 @@ expand_while_optab_fn (internal_fn, gcall *stmt, convert_optab optab) #define expand_fold_left_optab_fn(FN, STMT, OPTAB) \ expand_direct_optab_fn (FN, STMT, OPTAB, 2) +#define expand_mask_fold_left_optab_fn(FN, STMT, OPTAB) \ + expand_direct_optab_fn (FN, STMT, OPTAB, 3) + /* RETURN_TYPE and ARGS are a return type and argument list that are in principle compatible with FN (which satisfies direct_internal_fn_p). Return the types that should be used to determine whether the @@ -3088,6 +3092,7 @@ multi_vector_optab_supported_p (convert_optab optab, tree_pair types, #define direct_while_optab_supported_p convert_optab_supported_p #define direct_fold_extract_optab_supported_p direct_optab_supported_p #define direct_fold_left_optab_supported_p direct_optab_supported_p +#define direct_mask_fold_left_optab_supported_p direct_optab_supported_p /* Return the optab used by internal function FN. */ -- cgit v1.1