Re: [PATCH] D17268: [LAA] Function 'isStridedPtr' returns additional result “Loop *Lp” via function argument and add appropriate checks out of the 'isStridedPtr'.

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 23:06:42 PDT 2016


anemet added a comment.

In http://reviews.llvm.org/D17268#433960, @hfinkel wrote:

> In http://reviews.llvm.org/D17268#432173, @anemet wrote:
>
> > In http://reviews.llvm.org/D17268#426175, @roman.shirokiy wrote:
> >
> > > Updated diff according to Adam suggestions. Also added negative unit stride check since it seems to not break anything and allows to vectorize
> >
> >
> > Can you please not change this for now.  I have been thinking about this code and I am not sure I understand the original version either.
> >
> > Particularly unclear is why we only check non-wrapping when we retry proving vectorization safety with memchecks only.  It seems to me that we'd have to do that for any pointer participating in memchecks.
> >
> > @Hal, do you remember this?  I asked Arnold and he didn't remember anymore.
>
>
> I don't in detail, but would the SCEV simplify in the first place if the expression might wrap? When we have memchecks we force the non-wrapping, and so we need to check.


Right but non-wrapping should be true for any memcheck not just those that we use instead of the failed SCEV-based testing.  E.g. in

for (i) {

  A[i] = B[i];

}

we will insert memchecks right away (i.e. ShouldCheckStride=false) but we should first make sure that the pointers don't wrap.

> 

> 

> > This check feels parallel to the SCEV tests in isDependent because the dep distance is only correct if the pointers don't wrap.  However in this case I think we're only interested if due to wrapping we need to consider the "inverse" interval (end->begin) rather than the normal (begin->end).

> 



http://reviews.llvm.org/D17268





More information about the llvm-commits mailing list