[Bug other/92366] new test case gcc.dg/vect/bb-slp-41.c fails with its introduction in r277784

rsandifo at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 14 19:25:00 GMT 2019


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

--- Comment #5 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Author: rsandifo
Date: Thu Nov 14 19:24:21 2019
New Revision: 278262

URL: https://gcc.gnu.org/viewcvs?rev=278262&root=gcc&view=rev
Log:
Tweak gcc.dg/vect/bb-slp-4[01].c (PR92366)

gcc.dg/vect/bb-slp-40.c was failing on some targets because the
explicit dg-options overrode things like -maltivec.  This patch
uses dg-additional-options instead.

Also, it seems safer not to require exactly 1 instance of each message,
since that depends on the target vector length.

gcc.dg/vect/bb-slp-41.c contained invariant constructors that are
vectorised on AArch64 (foo) and constructors that aren't (bar).
This meant that the number of times we print "Found vectorizable
constructor" depended on how many vector sizes we try, since we'd
print it for each failed attempt.

In foo, we create invariant { b[0], ... } and { b[1], ... },
and the test is making sure that the two separate invariant vectors
can be fed from the same vector load at b.  This is a different case
from bb-slp-40.c, where the constructors are naturally separate.
(The expected count is 4 rather than 2 because we can vectorise the
epilogue too.)

However, due to limitations in the loop vectoriser, we still do the
addition of { b[0], ... } and { b[1], ... } in the loop.  Hopefully
that'll be fixed at some point, so this patch adds an alternative test
that directly needs 4 separate invariant constructors.  E.g. with Joel's
SLP optimisation, the new test generates:

        ldr     q4, [x1]
        dup     v7.4s, v4.s[0]
        dup     v6.4s, v4.s[1]
        dup     v5.4s, v4.s[2]
        dup     v4.4s, v4.s[3]

instead of the somewhat bizarre:

        ldp     s6, s5, [x1, 4]
        ldr     s4, [x1, 12]
        ld1r    {v7.4s}, [x1]
        dup     v6.4s, v6.s[0]
        dup     v5.4s, v5.s[0]
        dup     v4.4s, v4.s[0]

The patch then disables vectorisation of the original foo in
bb-vect-slp-41.c, so that we get the same correctness testing
for bar but don't need to test for specific counts.

2019-11-14  Richard Sandiford  <richard.sandiford@arm.com>

gcc/testsuite/
        PR testsuite/92366
        * gcc.dg/vect/bb-slp-40.c: Use dg-additional-options instead
        of dg-options.  Remove expected counts.
        * gcc.dg/vect/bb-slp-41.c: Remove dg-options and explicit
        dg-do run.  Suppress vectorization of foo.
        * gcc.dg/vect/bb-slp-42.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/bb-slp-42.c
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/vect/bb-slp-40.c
    trunk/gcc/testsuite/gcc.dg/vect/bb-slp-41.c


More information about the Gcc-bugs mailing list