[llvm-dev] How to get information about data dependencies?

Stefanos Baziotis via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 20 13:22:32 PDT 2020


Thanks for the info. Let me clarify something that might have caused
confusion: When I said 2D arrays above, I meant
double pointers, which is another beast on its own. Basically my example
states that e.g. a[0][1] and a[0][2] could easily
point to the same exact memory.

Now, returning the discussion to _static arrays_, which is more realistic
anyway in high-performance code, I think I would
be very happy to see GEP with dynamic sizes. In my current work, I depend
on SCEV Delinearization to recover the
indices (I guess many people have had to do that, for no actual reason).

> We also had a discussion whether `A[i][j]` can be lowered to a
> GetElementPtr with `inrange` keyword for the subscripts, including for
> statically sized arrays.

To lower it to _one_ GEP, wouldn't that require GEPs with dynamic sizes?

Also, to be sure we're on the same page, this is beneficial because, as in
the RFC example, if we have
A[x1][y1] and A[x2][y2] and x1 != x2 and y1 != y2, then the two don't
alias. Actually, if `inrange` works
as expected, even if one of the conditions holds, the two don't alias.

- Stefanos

Στις Τρί, 21 Ιουλ 2020 στις 12:18 π.μ., ο/η Michael Kruse <
llvmdev at meinersbur.de> έγραψε:

> Am Mi., 15. Juli 2020 um 14:18 Uhr schrieb David Greene via llvm-dev
> <llvm-dev at lists.llvm.org>:
> > Stefanos Baziotis via llvm-dev <llvm-dev at lists.llvm.org> writes:
> >
> > > Well... I tried that and it doesn't seem to be very useful
> > > unfortunately.  The C/C++ way that arrays are defined is probably why
> > > DA is not that useful. Namely that a row can alias with another row in
> > > 2D arrays. The theory behind DA is quite powerful if we knew that they
> > > don't alias. Right now, it just gives up.
> >
> > Note that the situation is very different in flang, where good
> > dependence analysis becomes much more critical.
>
> There was an RFC on the mailing list to support a GetElementPtr with
> dynamic array sizes:
> http://lists.llvm.org/pipermail/llvm-dev/2019-July/134063.html
>
> We also had a discussion whether `A[i][j]` can be lowered to a
> GetElementPtr with `inrange` keyword for the subscripts, including for
> statically sized arrays.
>
> Michael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200720/a51bc571/attachment.html>


More information about the llvm-dev mailing list