This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ping [patch] Re: towards fixing PR20794/PR19893 (vectorizer tests cleanup)



             M@IBMIL                                                    To 
             Sent by:                     
             gcc-patches-owner                                          cc 
                 Steve Ellcey <>       
                                       towards fixing PR20794/PR19893      
             28/04/2005 15:17          (vectorizer tests cleanup)          


The attached patch (tests.april28) fixes the places that prompt Steve's
patch ( to issue a
warning.  Most of the changes are to replace an array-of-aligned-type to an

This patch however does not entirely fix the problem discussed in
PR20794/PR19893 (and also in - there are still places
where we use "aligned pointers" - pointers to types whose alignment is
bigger than their size, but these places do not prompt the warning, so they
don't prevent applying Steve's patch.

To further clean up the "aligned pointers" problem (beyond avoiding the
warning) we'll need to consider the following cases (the problematic tests
fall into the following groups):

a) tests that use "aligned pointers" which can easily be replaced by
aligned-arrays (i.e., pointers are not inherent for the purpose of the
test). There was one such test - vect-92.c. This is already handled by the
attached patch.

b) tests that use "aligned pointers" which can easily be replaced by
regular pointers (i.e., the purpose of the test is not to check handling of
alignment). These are tests vect-[37,74,75,76,77,78,79,97].c and pr20122.c.
Replacing the "aligned pointers" with regular pointers in these tests is
not the ideal solution because in some cases this means that these tests
are no longer vectorizable on vect_no_align targets, and even for targets
that support alignment we'd rather have a minimal test that avoids
alignment handling when misalignment issues are irrelevant for the test.
However, the only alternative solution is to wait until attributes on array
parameters are implemented (as suggested here: For now, I applied this
change only to vect-[37,79,97].c and pr20122.c (included in the attached
patch). If this is the preferred approach, I'll change the other tests in
this spirit (I'll send a separate patch for that).

c) tests that use "aligned pointers" but that cannot be easily replaced
with regular-pointers or aligned-arrays because the purpose of the test is
to check handling of pointers that are aligned, or that have a compile-time
known misalignment. There are actually two sub-groups here:
c.1) tests vect[40,42,46,48,52,54,56,58,60].c: the pointers here are also
annotated as restricted. For these tests we can use local pointers instead
of pointers that are passed as parameters. As an example, see the proposed
change to vect-[40,48,54].c in tests.patch2 (attached below). This patch
will change the behavior of the test a bit - we will now deal with datarefs
whose access-function looks like this: {&b,+,4B} instead of like this:
{pb_13,+,4B}. In terms of aliasing an alignment the behavior remains the
same, so I guess we can move on with this change. If this approach is
accepted, I can send a separate patch for these tests, in the same spirit
of tests.patch2.

c.2) tests vect[41,43,47,49,53,55,57,59,61].c: these are the same tests as
above with one difference - the pointers here are not annotated as
restricted, and therefore not vectorized yet (they will be vectorized only
when runtime dependence testing is in place). It doesn't make sense to use
local pointers here because then aliasing is trivially resolved (it becomes
exactly like the c.1 tests above). I don't know what to do with these
besides waiting till attributes on array parameters are implemented. We
could also just drop these tests since they don't yet get vectorized, but
I'd prefer to keep them, since they don't prompt the alignment warning and
they'll be useful to test runtime-aliasing functionality.

This patch Also contains:
- documentation to some of the tests
- cleanups of some XPASSes

Tested on i686-pc-linux-gnu and powerpc-apple-darwin with and without
alignment support.



        * gcc.dg/vect/vect-35: Use aligned arrays instead of arrays to
        aligned type
        * gcc.dg/vect/vect-40: Likewise.
        * gcc.dg/vect/vect-41: Likewise.
        * gcc.dg/vect/vect-42: Likewise.
        * gcc.dg/vect/vect-43: Likewise.
        * gcc.dg/vect/vect-44: Likewise.
        * gcc.dg/vect/vect-46: Likewise.
        * gcc.dg/vect/vect-47: Likewise.
        * gcc.dg/vect/vect-48: Likewise.
        * gcc.dg/vect/vect-52: Likewise.
        * gcc.dg/vect/vect-53: Likewise.
        * gcc.dg/vect/vect-54: Likewise.
        * gcc.dg/vect/vect-55: Likewise.
        * gcc.dg/vect/vect-56: Likewise.
        * gcc.dg/vect/vect-57: Likewise.
        * gcc.dg/vect/vect-58: Likewise.
        * gcc.dg/vect/vect-59: Likewise.
        * gcc.dg/vect/vect-60: Likewise.
        * gcc.dg/vect/vect-61: Likewise.
        * gcc.dg/vect/vect-85: Likewise.
        * gcc.dg/vect/vect-87: Likewise.
        * gcc.dg/vect/vect-88: Likewise.
        * gcc.dg/vect/vect-93.c: Likewise.

        * gcc.dg/vect/vect-74: Likewise, and also added documentation.
        * gcc.dg/vect/vect-75: Likewise.
        * gcc.dg/vect/vect-76: Likewise.
        * gcc.dg/vect/vect-77: Likewise.
        * gcc.dg/vect/vect-78: Likewise.
        * gcc.dg/vect/vect-80: Likewise.

        * gcc.dg/vect/vect-35: Likewise, and also check that the test
        vectorized for the expected reason, rather than checking how
        was handled.

        * gcc.dg/vect/vect-97.c: Likewise, and also replace aligned
        with regular pointers.
        * gcc.dg/vect/vect-37.c: Likewise. This test may no longer
        on vect_no_align targets.
        * gcc.dg/vect/vect-79: Likewise.
        * gcc.dg/vect/pr20122.c: Likewise.

        * gcc.dg/vect/vect-92.c: Use aligned arrays instead of arrays to
        type and also instead of aligned pointers. Added documentation.

        * gcc.dg/vect/vect-8.c: Remove xfail.
        * gcc.dg/vect/vect-30.c: Remove xfail.
        * gcc.dg/vect/vect-67.c: Remove xfail.
        * gcc.dg/vect/vect-ifcvt-1.c: Remove xfail.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]