public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "g.peterhoff@t-online.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/100171] New: autovectorizer
Date: Wed, 21 Apr 2021 03:36:14 +0000	[thread overview]
Message-ID: <bug-100171-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 100171
           Summary: autovectorizer
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: g.peterhoff@t-online.de
  Target Milestone: ---

Hello gcc team,
I once wrote a small test case to show the problems with the autovectorizer
https://godbolt.org/z/xs35P45MM . In particular, the += operator is not
vectorized. The + operator works in the same context. I do not understand that.
If you decrement the arraysize in foo from 2 to 1 it doesn't work at all
anymore - scalar operations are always generated for ARR_2x.
In general, I made the experience that the autovectorizer starts much too late.
It should always do this from 2 values, even if these are much smaller than a
simd register. This also saves a lot of memory accesses - especially when the
data is linear in the memory (as in the example). Usually, however,
vectorization is only carried out when the data is at least as large as a simd
register, but often only when it is twice or even four times as large.
I think you should urgently update/optimize the autovectorizer.

thx & regards
Gero

             reply	other threads:[~2021-04-21  3:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  3:36 g.peterhoff@t-online.de [this message]
2021-04-21  5:09 ` [Bug tree-optimization/100171] autovectorizer pinskia at gcc dot gnu.org
2021-04-21  6:58 ` rguenth at gcc dot gnu.org
2021-04-21  8:25 ` rguenth at gcc dot gnu.org
2021-08-17  5:40 ` pinskia 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-100171-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).