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/106022] [12/13 Regression] Enable vectorizer generates extra load
Date: Thu, 23 Jun 2022 06:19:54 +0000	[thread overview]
Message-ID: <bug-106022-4-3MO0yeYphb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106022-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #9)
> (In reply to Richard Biener from comment #8)
> > (In reply to H.J. Lu from comment #6)
> > > Created attachment 53169 [details]
> > > A patch
> > > 
> > > This patch multiplies the vector store cost by the number of scalar elements
> > > in
> > > a word to properly compare scalar store cost against vector store cost.
> > 
> > But that's not "properly" but "wrong" ...
> > 
> > Note we already cost the vector load from the constant pool so the vector
> > side costing is correct.
> > 
> > What's eventually imprecise is the scalar cost where you could anticipate
> > store merging, but adjusting the vector cost side is just wrong.
> 
> I tried to adjust the scalar cost.  When the scalar cost of storing a byte
> is 6, dividing it by 8 (the number of scalar elements in a word) becomes 0.
> Will it work?

No, I think you would need to pattern match an actual store sequence,
for example by looking at

 if (STMT_VINFO_GROUPED_ACCESS (stmt_info)
     && pow2p_hwi (DR_GROUP_STORE_COUNT (stmt_info)))
   /* cost a possibly merged store only once (but with larger mode?) */
   if (DR_GROUP_FIRST_ELEMENT (stmt_info) == stmt_info)
     ...

So costing the whole sequence of scalar stores a single time, with
adjusted mode.

store-merging also handles non-QImode stores btw.

  parent reply	other threads:[~2022-06-23  6:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 21:59 [Bug target/106022] New: " hjl.tools at gmail dot com
2022-06-17 23:18 ` [Bug target/106022] " hjl.tools at gmail dot com
2022-06-20  2:07 ` crazylht at gmail dot com
2022-06-20 11:23 ` rguenth at gcc dot gnu.org
2022-06-20 11:24 ` rguenth at gcc dot gnu.org
2022-06-20 12:42 ` crazylht at gmail dot com
2022-06-20 14:07 ` hjl.tools at gmail dot com
2022-06-20 16:35 ` hjl.tools at gmail dot com
2022-06-21  6:41 ` rguenth at gcc dot gnu.org
2022-06-21 14:39 ` hjl.tools at gmail dot com
2022-06-21 22:23 ` hjl.tools at gmail dot com
2022-06-23  6:19 ` rguenth at gcc dot gnu.org [this message]
2022-06-24 21:22 ` hjl.tools at gmail dot com
2022-06-27  9:00 ` rguenther at suse dot de
2022-06-27 13:33 ` hjl.tools at gmail dot com
2022-06-28  6:44 ` rguenther at suse dot de
2022-06-29 21:53 ` hjl.tools at gmail dot com
2022-06-30  3:48 ` crazylht at gmail dot com
2022-07-03 17:30 ` cvs-commit at gcc dot gnu.org
2022-07-25 15:57 ` [Bug target/106022] [12 " rguenth at gcc dot gnu.org
2022-07-27  7:26 ` rguenth at gcc dot gnu.org
2023-01-18  9:57 ` jakub at gcc dot gnu.org
2023-05-08 12:24 ` 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-106022-4-3MO0yeYphb@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).