public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/101908] [12 regression] cray regression with -O2 -ftree-slp-vectorize compared to -O2
Date: Mon, 28 Feb 2022 01:29:05 +0000	[thread overview]
Message-ID: <bug-101908-4-XHcx6Z968g@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101908-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #26 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Richard Biener from comment #22)
> (In reply to Hongtao.liu from comment #21)
> > Now we have SLP node available in vector cost hook, maybe we can do sth in
> > cost model to prevent vectorization when node's definition from big-size
> > parameter.
> 
> Note we vectorize a load here for which we do not pass down an SLP node.
> But of course there's the stmt-info one could look at - but the issue
> is that for SLP that doesn't tell you which part of the variable is accessed.
> Also even if we were to pass down the SLP node we do not know exactly how
> it is going to vectorize - but sure, we could play with some heuristics
> there.
> 
> For x86 we can just assume that all aggregates > 16 bytes are passed on the
> stack, correct?  Note I see for
> 
> #include <stdlib.h>
> 
> struct X { double x[3]; };
> typedef double v2df __attribute__((vector_size(16)));
> 
> v2df __attribute__((noipa))
> foo (struct X x, struct X y)
> {
>   return (v2df) {x.x[1], x.x[2] } + (v2df) { y.x[0], y.x[1] };
> }
> 
> struct X y;
> int main(int argc, char **argv)
> {
>   struct X x = y;
>   int cnt = atoi (argv[1]);
>   for (int i = 0; i < cnt; ++i)
>     foo (x, x);
>   return 0;
> }
> 
> the structs passed as
> 
>         movups  %xmm0, 24(%rsp)
>         movq    %rax, 40(%rsp)
>         movq    %rax, 16(%rsp)
>         movups  %xmm0, (%rsp)
>         call    foo
> 
> so alignment of the stack variable depends on the position of the
> function argument (and thus preceeding parameters).  That means
> we cannot rely on &y being 16 byte aligned and it seems we cannot
> rely on a particular store sequence order either here.
We can start with disabling vectorization with very cheap cost model to fix O2
regressions, then fine tune that in GCC 13.

  parent reply	other threads:[~2022-02-28  1:29 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-14 14:27 [Bug middle-end/101908] New: " hubicka at gcc dot gnu.org
2021-08-16  8:33 ` [Bug middle-end/101908] " crazylht at gmail dot com
2021-08-16  9:05 ` [Bug tree-optimization/101908] " rguenth at gcc dot gnu.org
2021-08-16  9:06 ` rguenth at gcc dot gnu.org
2021-08-25  7:47 ` crazylht at gmail dot com
2021-10-28 12:26 ` [Bug tree-optimization/101908] [12 regression] " hubicka at gcc dot gnu.org
2021-10-28 12:39 ` hubicka at gcc dot gnu.org
2021-10-28 13:02 ` rguenth at gcc dot gnu.org
2021-10-28 13:05 ` rguenth at gcc dot gnu.org
2021-10-28 13:06 ` hubicka at kam dot mff.cuni.cz
2021-10-28 13:09 ` hubicka at kam dot mff.cuni.cz
2021-10-28 13:09 ` rguenth at gcc dot gnu.org
2021-10-28 13:12 ` hubicka at kam dot mff.cuni.cz
2021-10-28 13:13 ` rguenth at gcc dot gnu.org
2021-10-28 13:15 ` rguenth at gcc dot gnu.org
2021-10-28 13:21 ` rguenth at gcc dot gnu.org
2021-10-29 13:58 ` hubicka at kam dot mff.cuni.cz
2022-01-20 11:12 ` rguenth at gcc dot gnu.org
2022-01-20 11:26 ` [Bug target/101908] " rguenth at gcc dot gnu.org
2022-01-20 11:52 ` rguenth at gcc dot gnu.org
2022-02-24  9:54 ` rguenth at gcc dot gnu.org
2022-02-25  3:57 ` crazylht at gmail dot com
2022-02-25  7:33 ` rguenth at gcc dot gnu.org
2022-02-25  8:26 ` lili.cui at intel dot com
2022-02-25  8:31 ` lili.cui at intel dot com
2022-02-25 15:27 ` hjl.tools at gmail dot com
2022-02-28  1:29 ` crazylht at gmail dot com [this message]
2022-02-28  1:30 ` crazylht at gmail dot com
2022-02-28  5:13 ` lili.cui at intel dot com
2022-03-01  9:33 ` crazylht at gmail dot com
2022-03-10 13:47 ` crazylht at gmail dot com
2022-03-10 13:54 ` crazylht at gmail dot com
2022-03-10 13:55 ` crazylht at gmail dot com
2022-03-11  7:11 ` crazylht at gmail dot com
2022-03-11  8:32 ` rguenth at gcc dot gnu.org
2022-03-11  8:48 ` crazylht at gmail dot com
2022-03-11 10:41 ` rguenth at gcc dot gnu.org
2022-03-11 13:14 ` crazylht at gmail dot com
2022-03-11 13:27 ` rguenther at suse dot de
2022-03-14  9:05 ` crazylht at gmail dot com
2022-03-14  9:16 ` rguenther at suse dot de
2022-03-15  1:52 ` crazylht at gmail dot com
2022-03-15  7:14 ` rguenther at suse dot de
2022-03-29  3:40 ` crazylht at gmail dot com
2022-03-29  4:01 ` crazylht at gmail dot com
2022-03-29  6:47 ` rguenther at suse dot de
2022-03-29  8:27 ` crazylht at gmail dot com
2022-03-29 10:00 ` rguenther at suse dot de
2022-04-05  5:17 ` cvs-commit at gcc dot gnu.org
2022-04-05  6: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-101908-4-XHcx6Z968g@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).