This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: [PATCH] Re: Vectorizer question: DIV to RSHIFT conversion (take 2)



Jakub Jelinek <jakub@redhat.com> wrote on 15/12/2011 03:51:25 PM:

> On Thu, Dec 15, 2011 at 03:35:34PM +0200, Ira Rosen wrote:
> > > This patch also fixes
> > > a problem where vect_determine_vectorization_factor would iterate the
> > same
> > > stmt twice - for some reason both the original stmt and pattern stmt
(and
> > > def stmt) are marked as relevant,
> >
> > Do you have a testcase where the original stmt is marked as relevant?
It
> > shouldn't be that way.
>
> Yes, gcc.dg/vect/pr51015.c.  It isn't vectorized on x86_64-linux in the
> end, because of the other shift (long long), even with -mavx2 or -mxop.
>

We need to mark original stmts as relevant in case they have uses both
inside and outside the pattern (
http://gcc.gnu.org/ml/gcc-patches/2011-06/msg02183.html). This case is a
bit different from the original intent:

S1:  D.2006_9 = D.2005_4 << D.2004_3;
S1':        --> pattern stmt
S2:  max_sizes_10 = max_sizes_5 + D.2006_9;
S3:  D.2007_16 = D.2006_9 << D.2004_3;
S3':        --> pattern stmt

D.2006_9 is used in S2, outside any pattern, and for this use we need LHS
of S1'. S3 is a pattern stmt, but this is actually another pattern. But we
still want the original D.2006_9 for S3', so we need to vectorize S1
(unless we change the pattern detector).

And, you are right, before your patch we analyzed the original stmt twice
in such cases.

Ira


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