Dorit Nuzman - PING [PATCH] PR29145 (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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] PR29145 - be more restrict about restrict qualifier


ping!: http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00648.html

" This patch avoids generating wrong code by making us more conservative in our interpretation of the restrict qualifier. It makes us conclude that two pointers don't overlap only if both are "based on" restricted pointers, with "based on" trivially implemented as the pointer used in the reference itself. In addition, we check that the declarations of both pointers are in the parameter list of the same function (to be safe w.r.t the scope of the pointer declarations).

It's a stronger requirement than the definition of restrict, but if most uses of restrict are with pointers passed as arguments to a function (which I don't know to be the case) then this patch would be good enough. Most of the vectorizer testcases use restrict in that way, and continue to get vectorized with this patch. Two testcases that don't, however, are - vect-[74,80].c, for which we need a bit less trivial implementation of "based on".

Improvements on this would be to make us less conservative (at least enough to be able to vectorizer vect-[74,80].c again), and better - have this handled by the alias analyzer rather than this code in tree-data-ref.c.

Bootstrapped and tested on powerpc-linux.

ok for mainline?

thanks, dorit

ChangeLog:

    PR tree-optimization/29145
    * tree-data-ref.c (base_addr_differ_p): Make us more conservative
    in our handling of restrict qualified pointers.

Testsuite ChangeLog:

    PR tree-optimization/29145
    * gcc.dg/vect/vect-74.c: Xfail the test - cannot be vectorized

until alias analysis is improved to take better advantage of restrict qualified pointers. * gcc.dg/vect/vect-80.c: Likewise. * gcc.dg/vect/pr29145.c: New. " (See attached file: restrict.patch.txt)

Attachment:restrict.patch.txt
Description: Text document


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