public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "linkw at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/98138] BB vect fail to SLP one case
Date: Wed, 06 Jan 2021 03:29:46 +0000	[thread overview]
Message-ID: <bug-98138-4-jgjahASTnP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98138-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Kewen Lin from comment #4)
> One rough idea seems:
>   1) Relax this condition all_uniform_p somehow to get SLP instance building
> to go deeper and get those p1/p2 loads as SLP nodes.
>   2) Introduce one more vect_pattern recognizer to catch this kind of
> pattern, transform the slp instance as we expect. I assume we can know the
> whole slp instance then we can transform it as we want here. Probably need
> some costing condition to gate this pattern matching.
>   3) If 2) fail, trim the slp instance from those nodes which satisfy
> all_uniform_p condition to ensure it's same as before.
> 

For 2), instead of vect_pattern with IFN, the appropriate place seems to be
vect_optimize_slp.

But after more thinking, building SLP instance starting from group loads
instead of group stores looks more straightforward. 

  a0 = (p1[0] - p2[0]);
  a1 = (p1[1] - p2[1]);
  a2 = (p1[2] - p2[2]);
  a3 = (p1[3] - p2[3]);

Building the vector <a0, a1, a2, a3> looks more natural and then check the uses
of its all lanes and special patterns to have vector <t0, t1, t2, t3> and
repeat similarly.

Hi Richi,

Is this a good example to request SLP instance build starting group loads?

  parent reply	other threads:[~2021-01-06  3:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 10:46 [Bug tree-optimization/98138] New: " linkw at gcc dot gnu.org
2020-12-04 10:52 ` [Bug tree-optimization/98138] " linkw at gcc dot gnu.org
2020-12-04 12:19 ` rguenth at gcc dot gnu.org
2020-12-07  3:10 ` linkw at gcc dot gnu.org
2021-01-05  8:42 ` linkw at gcc dot gnu.org
2021-01-06  3:29 ` linkw at gcc dot gnu.org [this message]
2021-01-06  9:48 ` rguenth at gcc dot gnu.org
2021-01-12  7:23 ` linkw at gcc dot gnu.org
2021-01-12  7:25 ` linkw at gcc dot gnu.org
2021-08-04 10:31 ` rguenth at gcc dot gnu.org
2022-07-06 10:39 ` ktkachov at gcc dot gnu.org
2023-02-01  8:19 ` manolis.tsamis at vrull dot eu
2023-10-04 22:37 ` jiangning.liu at amperecomputing dot com
2023-10-05  6:58 ` rguenth at gcc dot gnu.org
2023-10-09  7:38 ` 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-98138-4-jgjahASTnP@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).