public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nathanael.schaeffer at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/98563] New: regression: vectorization fails while it worked on gcc 9 and earlier
Date: Wed, 06 Jan 2021 14:53:21 +0000	[thread overview]
Message-ID: <bug-98563-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 98563
           Summary: regression: vectorization fails while it worked on gcc
                    9 and earlier
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nathanael.schaeffer at gmail dot com
  Target Milestone: ---

I have found what seems to be a regression.

The following code is not compiled to 256-bit AVX when compiled with
-fopenmp-simd, while it is fully vectorized without!

Here are the resulting code with different options, with gcc 10.1:
-O3 -fopenmp-simd  => xmm
-O3                => ymm
-O3 -fopenmp-simd -fno-signed-zeros  => ymm

gcc 9 and earlier always vectorize to full-width (ymm)

#include <complex>
typedef std::complex<double> cplx;

void test(cplx* __restrict__ a, const cplx* b, double c, int N)
{
    #pragma omp simd
    for (int i=0; i<8*N; i++) {
        a[i] = c*(a[i]-b[i]);
    }
}

See the result on godbolt: https://godbolt.org/z/9ThqKE

Also, I discover that no avx512 code is generated for this loop. Is this
intended? Is there an option to enable avx512 vectorization?

             reply	other threads:[~2021-01-06 14:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 14:53 nathanael.schaeffer at gmail dot com [this message]
2021-01-06 15:04 ` [Bug tree-optimization/98563] " nathanael.schaeffer at gmail dot com
2021-01-07  8:24 ` [Bug tree-optimization/98563] [10/11 Regression] " rguenth at gcc dot gnu.org
2021-01-07  8:34 ` nathanael.schaeffer at gmail dot com
2021-01-07 15:42 ` [Bug tree-optimization/98563] [10/11 Regression] vectorization fails while it worked on gcc 9 and earlier since since r10-2271-gd81ab49d0586fca0 marxin at gcc dot gnu.org
2021-01-25 12:58 ` jakub at gcc dot gnu.org
2021-01-26 12:11 ` rguenth at gcc dot gnu.org
2021-01-26 12:48 ` jakub at gcc dot gnu.org
2021-01-26 13:24 ` rguenth at gcc dot gnu.org
2021-01-26 13:34 ` jakub at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2022-06-28 10:43 ` [Bug tree-optimization/98563] [10/11/12/13 " jakub at gcc dot gnu.org
2023-07-07 10:38 ` [Bug tree-optimization/98563] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-02-21  4:27 ` 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-98563-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).