Bug 96147 - [11 regression] gcc.dg/vect/slp-43.c etc. FAIL
Summary: [11 regression] gcc.dg/vect/slp-43.c etc. FAIL
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 11.0
: P1 normal
Target Milestone: 11.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-10 08:23 UTC by Rainer Orth
Modified: 2024-03-22 09:12 UTC (History)
1 user (show)

See Also:
Host:
Target: sparc-sun-solaris2.11
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-10-16 00:00:00


Attachments
32-bit sparc-sun-solaris2.11 slp-43.c.163t.vect (58.54 KB, text/plain)
2020-07-10 08:23 UTC, Rainer Orth
Details
32-bit sparc-sun-solaris2.11 slp-45.c.163t.vect (31.57 KB, application/x-bzip)
2020-07-10 08:25 UTC, Rainer Orth
Details
32-bit sparc-sun-solaris2.11 bb-slp-32.c.191t.slp2 (3.80 KB, text/plain)
2024-02-28 14:49 UTC, Rainer Orth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2020-07-10 08:23:55 UTC
Created attachment 48855 [details]
32-bit sparc-sun-solaris2.11 slp-43.c.163t.vect

Between 20200708 (30fdaead5b7880c4e9f140618e26ad1c545642d5) and 20200709 (fab263ab0fc10ea08409b80afa7e8569438b8d28), a couple of testcases regressed on
Solaris/SPARC, both 32 and 64-bit:

+XPASS: gcc.dg/vect/bb-slp-32.c -flto -ffat-lto-objects  scan-tree-dump slp2 "vectorization is not profitable"
+XPASS: gcc.dg/vect/bb-slp-32.c scan-tree-dump slp2 "vectorization is not profitable"
+XPASS: gcc.dg/vect/bb-slp-9.c -flto -ffat-lto-objects  scan-tree-dump-times slp2 "basic block vectorized" 1
+XPASS: gcc.dg/vect/bb-slp-9.c scan-tree-dump-times slp2 "basic block vectorized" 1
+FAIL: gcc.dg/vect/slp-43.c -flto -ffat-lto-objects  scan-tree-dump-times vect "vectorized 1 loops" 2
+FAIL: gcc.dg/vect/slp-43.c scan-tree-dump-times vect "vectorized 1 loops" 2
+FAIL: gcc.dg/vect/slp-45.c -flto -ffat-lto-objects  scan-tree-dump-times vect "vectorized 1 loops" 13
+FAIL: gcc.dg/vect/slp-45.c scan-tree-dump-times vect "vectorized 1 loops" 13

There's a similar regression reported on ia64-suse-linux-gnu.

Dumps for the FAILs attached.
Comment 1 Rainer Orth 2020-07-10 08:25:35 UTC
Created attachment 48856 [details]
32-bit sparc-sun-solaris2.11 slp-45.c.163t.vect
Comment 2 Richard Biener 2020-10-16 11:57:55 UTC
I will take a look.
Comment 3 Richard Biener 2020-12-08 11:54:09 UTC
There are now 9 vectorized loops in slp-43.c.  I suppose since the testcase uses

  T *in = __builtin_assume_aligned (in_, __BIGGEST_ALIGNMENT__); \
  T *out = __builtin_assume_aligned (out_, __BIGGEST_ALIGNMENT__); \

keying on vect_hw_misalign is misleading.

in your attached dump file foo_int_2 is singled out not vectorized amongst
the _int cases, because SLP is not supported because it tries to use an
unaligned access.  For foo_int_4 it uses elementwise vectorization it seems.

For now can you confirm the FAILs persist?  I'll have to dig in with a cross...
Comment 4 ro@CeBiTec.Uni-Bielefeld.DE 2020-12-08 12:21:02 UTC
> --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
[...]
> For now can you confirm the FAILs persist?  I'll have to dig in with a cross...

The FAILs (and XPASSes) are still exactly as reported.

There's also gcc211 in the cfarm, but I'd expect a cross to be
considerably faster...
Comment 5 GCC Commits 2021-01-15 12:51:03 UTC
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:d03f14c354a348cc1043f637cae1ac6470034f71

commit r11-6712-gd03f14c354a348cc1043f637cae1ac6470034f71
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jan 15 13:49:04 2021 +0100

    testsuite/96147 - remove scanning for ! vect_hw_misalign
    
    This removes scanning that's too difficult to get correct for all
    targets, leaving the correctness test for them and keeping the
    vectorization capability check to vect_hw_misalign targets.
    
    2021-01-15  Richard Biener  <rguenther@suse.de>
    
            PR testsuite/96147
            * gcc.dg/vect/slp-43.c: Remove ! vect_hw_misalign scan.
Comment 6 GCC Commits 2021-01-15 12:53:59 UTC
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:e1bd80fb7064869e8d03ddb59e583f4cc9020770

commit r11-6713-ge1bd80fb7064869e8d03ddb59e583f4cc9020770
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jan 15 13:52:12 2021 +0100

    testsuite/96147 - key scanning on vect_hw_misalign
    
    gcc.dg/vect/slp-45.c failed to key the vectorization capability
    scanning on vect_hw_misalign.  Since the stores are strided
    they cannot be (all) analyzed to be aligned.
    
    2021-01-15  Richard Biener  <rguenther@suse.de>
    
            PR testsuite/96147
            * gcc.dg/vect/slp-45.c: Key scanning on
            vect_hw_misalign.
Comment 7 GCC Commits 2021-01-15 13:05:24 UTC
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:aa4ee5798fefd8eedd51287695120bf5219a9858

commit r11-6714-gaa4ee5798fefd8eedd51287695120bf5219a9858
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jan 15 14:02:06 2021 +0100

    testsuite/96147 - scan for vectorized load
    
    This changes gcc.dg/vect/bb-slp-9.c to scan for a vectorized load
    instead of a vectorized BB which then correctly captures the
    unaligned load we try to test and not some intermediate built
    from scalar vector.
    
    2021-01-15  Richard Biener  <rguenther@suse.de>
    
            PR testsuite/96147
            * gcc.dg/vect/bb-slp-9.c: Scan for a vector load transform.
Comment 8 GCC Commits 2021-01-15 13:05:29 UTC
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:b36c9cd09472c8efb8405726b7cc94fa4ae7059f

commit r11-6715-gb36c9cd09472c8efb8405726b7cc94fa4ae7059f
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jan 15 14:03:37 2021 +0100

    testsuite/96147 - align vector access
    
    This aligns p so that the testcase is meaningful for targets
    without a hw misaligned access.
    
    2021-01-15  Richard Biener  <rguenther@suse.de>
    
            PR testsuite/96147
            * gcc.dg/vect/bb-slp-32.c: Align p.
Comment 9 Richard Biener 2021-01-15 13:06:18 UTC
That should have fixed all (fingers crossing).
Comment 10 Rainer Orth 2024-02-28 14:49:11 UTC
Unfortunately, I missed that one of those tests still XPASSes:

XPASS: gcc.dg/vect/bb-slp-32.c -flto -ffat-lto-objects  scan-tree-dump slp2 "vectorization is not profitable"
XPASS: gcc.dg/vect/bb-slp-32.c scan-tree-dump slp2 "vectorization is not profitable"
Comment 11 Rainer Orth 2024-02-28 14:49:56 UTC
Created attachment 57562 [details]
32-bit sparc-sun-solaris2.11 bb-slp-32.c.191t.slp2
Comment 12 ro@CeBiTec.Uni-Bielefeld.DE 2024-03-19 10:08:25 UTC
It seems the xfail can go completely now: the test PASSes on both
sparc-sun-solaris2.11 and i386-pc-solaris2.11 (32 and 64-bit) with

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-32.c b/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
@@ -25,4 +25,4 @@ int foo (int *p, int a, int b)
   return sum;
 }
 
-/* { dg-final { scan-tree-dump "vectorization is not profitable" "slp2" { xfail  { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump "vectorization is not profitable" "slp2" { xfail  { ! vect_hw_misalign } } } } */
Comment 13 GCC Commits 2024-03-22 09:07:45 UTC
The master branch has been updated by Rainer Orth <ro@gcc.gnu.org>:

https://gcc.gnu.org/g:644a7033cc09b79a5cfefe1fe9b307d835009b17

commit r14-9612-g644a7033cc09b79a5cfefe1fe9b307d835009b17
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date:   Fri Mar 22 10:07:05 2024 +0100

    testsuite: vect: Remove dg-final in gcc.dg/vect/bb-slp-32.c [PR96147]
    
    gcc.dg/vect/bb-slp-32.c currently XPASSes on 32 and 64-bit Solaris/SPARC:
    
    XPASS: gcc.dg/vect/bb-slp-32.c -flto -ffat-lto-objects scan-tree-dump slp2
    "vectorization is not profitable"
    XPASS: gcc.dg/vect/bb-slp-32.c scan-tree-dump slp2 "vectorization is not
    profitable"
    
    Richard suggested to remove the dg-final, so this is what the patch does.
    
    Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11.
    
    2024-03-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
    
            gcc/testsuite:
            PR tree-optimization/96147
            * gcc.dg/vect/bb-slp-32.c (dg-final): Remove.
Comment 14 Rainer Orth 2024-03-22 09:12:05 UTC
gcc.dg/vect/bb-slp-32.c XPASSes avoided as discussed in
https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648142.html and followups.