public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/109747] New: [12/13/14 Regression] SLP cost of constructors is off
Date: Fri, 05 May 2023 11:56:19 +0000	[thread overview]
Message-ID: <bug-109747-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109747

            Bug ID: 109747
           Summary: [12/13/14 Regression] SLP cost of constructors is off
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

When r12-7319-g90d693bdc9d718 added the accounting for GPR->XMM moves to the
cost of SLP CTORs I failed to realize that the costing code will pass down
the very same (and full) SLP node from vect_prologue_cost_for_slp but
will generate costs for each individual actual vector that's constructed.

So for the case where the SLP node covers more than one vector the costing
will be off.  That's visible in the costing of the testcase for PR108724
for example which is

void foo(int *a, const int *__restrict b, const int *__restrict c)
{
  for (int i = 0; i < 16; i++) {
    a[i] = b[i] + c[i];
  }
}

and we end up with

_17 8 times unaligned_store (misalign -1) costs 96 in body
node 0x3fb5838 1 times vec_construct costs 100 in prologue
node 0x3fb5838 1 times vec_construct costs 100 in prologue
node 0x3fb5838 1 times vec_construct costs 100 in prologue
node 0x3fb5838 1 times vec_construct costs 100 in prologue
node 0x3fb5838 1 times vec_construct costs 100 in prologue
node 0x3fb5838 1 times vec_construct costs 100 in prologue
node 0x3fb5838 1 times vec_construct costs 100 in prologue
node 0x3fb5838 1 times vec_construct costs 100 in prologue

             reply	other threads:[~2023-05-05 11:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 11:56 rguenth at gcc dot gnu.org [this message]
2023-05-05 12:02 ` [Bug target/109747] " rguenth at gcc dot gnu.org
2023-05-08 12:27 ` rguenth at gcc dot gnu.org
2023-05-09 11:05 ` rguenth at gcc dot gnu.org
2023-05-23 16:59 ` cvs-commit at gcc dot gnu.org
2023-05-23 17:00 ` [Bug target/109747] [12/13 " rguenth at gcc dot gnu.org

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=bug-109747-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).