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.
Created attachment 48856 [details] 32-bit sparc-sun-solaris2.11 slp-45.c.163t.vect
I will take a look.
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 #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...
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.
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.
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.
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.
That should have fixed all (fingers crossing).
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"
Created attachment 57562 [details] 32-bit sparc-sun-solaris2.11 bb-slp-32.c.191t.slp2
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 } } } } */
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.
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.