public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/110445] New: [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2
@ 2023-06-28  6:53 rguenth at gcc dot gnu.org
  2023-06-28  6:53 ` [Bug testsuite/110445] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-06-28  6:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110445
           Summary: [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

With AVX2 we fail to SLP

double x[1024], y[1024];

void __attribute__((noipa)) foo()
{
  for (int i = 0; i < 512; ++i)
    {
      x[2*i] = y[i];
      x[2*i+1] = y[i];
    }
}

because we hit the following:

/space/rguenther/src/gcc11queue/gcc/testsuite/gcc.dg/vect/slp-46.c:10:21: note:
  ==> examining statement: _2 = y[i_12];
/space/rguenther/src/gcc11queue/gcc/testsuite/gcc.dg/vect/slp-46.c:10:21:
missed:   peeling for gaps insufficient for access
/space/rguenther/src/gcc11queue/gcc/testsuite/gcc.dg/vect/slp-46.c:12:17:
missed:   not vectorized: relevant stmt not supported: _2 = y[i_12];
/space/rguenther/src/gcc11queue/gcc/testsuite/gcc.dg/vect/slp-46.c:10:21: note:
  removing SLP instance operations starting from: x[_1] = _2;
/space/rguenther/src/gcc11queue/gcc/testsuite/gcc.dg/vect/slp-46.c:10:21:
missed:  unsupported SLP instances
/space/rguenther/src/gcc11queue/gcc/testsuite/gcc.dg/vect/slp-46.c:10:21: note:
 re-trying with SLP disabled

the issue is that in the last vector iteration with VF=2 we are accessing
{ i, i+1, i+2, i+3 }, if we're peeling at least a single scalar iteration
we still access possibly one too much elements.

The simplest solution would be to access { i, i+1 } only which I think
we already can do.  The other solution is to peel N scalar
iterations or apply masking to not access elements in the gap if the ISA
supports that.

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

* [Bug testsuite/110445] [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2
  2023-06-28  6:53 [Bug testsuite/110445] New: [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2 rguenth at gcc dot gnu.org
@ 2023-06-28  6:53 ` rguenth at gcc dot gnu.org
  2023-10-17 12:09 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-06-28  6:53 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization,
                   |                            |testsuite-fail
   Target Milestone|---                         |14.0

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

* [Bug testsuite/110445] [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2
  2023-06-28  6:53 [Bug testsuite/110445] New: [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2 rguenth at gcc dot gnu.org
  2023-06-28  6:53 ` [Bug testsuite/110445] " rguenth at gcc dot gnu.org
@ 2023-10-17 12:09 ` rguenth at gcc dot gnu.org
  2024-03-08 15:29 ` law at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-10-17 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-10-17

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed now.

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

* [Bug testsuite/110445] [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2
  2023-06-28  6:53 [Bug testsuite/110445] New: [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2 rguenth at gcc dot gnu.org
  2023-06-28  6:53 ` [Bug testsuite/110445] " rguenth at gcc dot gnu.org
  2023-10-17 12:09 ` rguenth at gcc dot gnu.org
@ 2024-03-08 15:29 ` law at gcc dot gnu.org
  2024-05-07  7:40 ` [Bug testsuite/110445] [14/15 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-08 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org
           Priority|P3                          |P2

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

* [Bug testsuite/110445] [14/15 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2
  2023-06-28  6:53 [Bug testsuite/110445] New: [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2 rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-03-08 15:29 ` law at gcc dot gnu.org
@ 2024-05-07  7:40 ` rguenth at gcc dot gnu.org
  2024-06-13  6:22 ` cvs-commit at gcc dot gnu.org
  2024-06-13  7:11 ` [Bug testsuite/110445] [14 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-07  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|14.0                        |14.2

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 14.1 is being released, retargeting bugs to GCC 14.2.

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

* [Bug testsuite/110445] [14/15 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2
  2023-06-28  6:53 [Bug testsuite/110445] New: [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2 rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-05-07  7:40 ` [Bug testsuite/110445] [14/15 " rguenth at gcc dot gnu.org
@ 2024-06-13  6:22 ` cvs-commit at gcc dot gnu.org
  2024-06-13  7:11 ` [Bug testsuite/110445] [14 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-13  6:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:1fe55a1794863b5ad9eeca5062782834716016b2

commit r15-1238-g1fe55a1794863b5ad9eeca5062782834716016b2
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jun 7 11:29:05 2024 +0200

    tree-optimization/114107 - avoid peeling for gaps in more cases

    The following refactors the code to detect necessary peeling for
    gaps, in particular the PR103116 case when there is no gap but
    the group size is smaller than the vector size.  The testcase in
    PR114107 shows we fail to SLP

      for (int i=0; i<n; i++)
        for (int k=0; k<4; k++)
          data[4*i+k] *= factor[i];

    because peeling one scalar iteration isn't enough to cover a gap
    of 3 elements of factor[i].  But the code detecting this is placed
    after the logic that detects cases we handle properly already as
    we'd code generate { factor[i], 0., 0., 0. } for V4DFmode vectorization
    already.  In fact the check to detect when peeling a single iteration
    isn't enough seems improperly guarded as it should apply to all cases.

    I'm not sure we correctly handle VMAT_CONTIGUOUS_REVERSE but I
    checked that VMAT_STRIDED_SLP and VMAT_ELEMENTWISE correctly avoid
    touching excess elements.

    With this change we can use SLP for the above testcase and the
    PR103116 testcases no longer require an epilogue on x86-64.  It
    might be different on other targets so I made those testcases
    runtime FAIL only instead of relying on dump scanning there's
    currently no easy way to properly constrain.

            PR tree-optimization/114107
            PR tree-optimization/110445
            * tree-vect-stmts.cc (get_group_load_store_type): Refactor
            contiguous access case.  Make sure peeling for gap constraints
            are always tested and consistently relax when we know we can
            avoid touching excess elements during code generation.  But
            rewrite the check poly-int aware.

            * gcc.dg/vect/pr114107.c: New testcase.
            * gcc.dg/vect/pr103116-1.c: Adjust.
            * gcc.dg/vect/pr103116-2.c: Likewise.

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

* [Bug testsuite/110445] [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2
  2023-06-28  6:53 [Bug testsuite/110445] New: [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2 rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-06-13  6:22 ` cvs-commit at gcc dot gnu.org
@ 2024-06-13  7:11 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-06-13  7:11 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[14/15 Regression] FAIL:    |[14 Regression] FAIL:
                   |gcc.dg/vect/slp-46.c with   |gcc.dg/vect/slp-46.c with
                   |AVX2                        |AVX2
      Known to work|                            |15.0

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
We now SLP this on trunk, the testsuite fail when using -mavx2 is gone.

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

end of thread, other threads:[~2024-06-13  7:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-28  6:53 [Bug testsuite/110445] New: [14 Regression] FAIL: gcc.dg/vect/slp-46.c with AVX2 rguenth at gcc dot gnu.org
2023-06-28  6:53 ` [Bug testsuite/110445] " rguenth at gcc dot gnu.org
2023-10-17 12:09 ` rguenth at gcc dot gnu.org
2024-03-08 15:29 ` law at gcc dot gnu.org
2024-05-07  7:40 ` [Bug testsuite/110445] [14/15 " rguenth at gcc dot gnu.org
2024-06-13  6:22 ` cvs-commit at gcc dot gnu.org
2024-06-13  7:11 ` [Bug testsuite/110445] [14 " rguenth 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).