public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-2096] vect: Cost intermediate conversions
Date: Mon, 26 Jun 2023 12:48:46 +0000 (GMT)	[thread overview]
Message-ID: <20230626124846.A4EC33858D1E@sourceware.org> (raw)

https://gcc.gnu.org/g:9302b0743b366037379af0568534c23ab597b4d4

commit r14-2096-g9302b0743b366037379af0568534c23ab597b4d4
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Mon Jun 26 13:48:35 2023 +0100

    vect: Cost intermediate conversions
    
    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.
    
    gcc/
            * tree-vect-stmts.cc (vectorizable_conversion): Take multi_step_cvt
            into account when costing non-widening/truncating conversions.

Diff:
---
 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 bf61461939b..b31971e99a4 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -5478,8 +5478,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)
 	{

                 reply	other threads:[~2023-06-26 12:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230626124846.A4EC33858D1E@sourceware.org \
    --to=rsandifo@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).