On Mon, Jun 26, 2023 at 1:58 PM Richard Sandiford via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> g:6f19cf7526168f8 extended N-vector to N-vector conversions
> to handle cases where an intermediate integer extension or
> truncation is needed.  This patch adjusts the cost to account
> for these intermediate conversions.
>
> Tested on aarch64-linux-gnu & x86_64-linux-gnu.  OK to install?

OK.

> Richard
>
> gcc/
>         * tree-vect-stmts.cc (vectorizable_conversion): Take multi_step_cvt
>         into account when costing non-widening/truncating conversions.
> ---
>  gcc/tree-vect-stmts.cc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
> index ae24f3e66e6..7bc602bf90a 100644
> --- a/gcc/tree-vect-stmts.cc
> +++ b/gcc/tree-vect-stmts.cc
> @@ -5470,8 +5470,9 @@ vectorizable_conversion (vec_info *vinfo,
>        if (modifier == NONE)
>          {
>           STMT_VINFO_TYPE (stmt_info) = type_conversion_vec_info_type;
> -         vect_model_simple_cost (vinfo, stmt_info, ncopies, dt, ndts, 
> slp_node,
> -                                 cost_vec);
> +         vect_model_simple_cost (vinfo, stmt_info,
> +                                 ncopies * (1 + multi_step_cvt),
> +                                 dt, ndts, slp_node, cost_vec);
>         }
>        else if (modifier == NARROW_SRC || modifier == NARROW_DST)
>         {
> --
> 2.25.1
>

Reply via email to