public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98563] New: regression: vectorization fails while it worked on gcc 9 and earlier
@ 2021-01-06 14:53 nathanael.schaeffer at gmail dot com
  2021-01-06 15:04 ` [Bug tree-optimization/98563] " nathanael.schaeffer at gmail dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: nathanael.schaeffer at gmail dot com @ 2021-01-06 14:53 UTC (permalink / raw)
  To: gcc-bugs

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?

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-02-21  4:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 14:53 [Bug tree-optimization/98563] New: regression: vectorization fails while it worked on gcc 9 and earlier nathanael.schaeffer at gmail dot com
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

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).