[PATCH] D73998: [DA] renaming the -da-disable-delinearization-checks option
Bardia Mahjour via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 24 13:16:11 PST 2020
bmahjour added a comment.
In D73998#1889929 <https://reviews.llvm.org/D73998#1889929>, @Meinersbur wrote:
> Consider the example C source:
>
> float A[n*n+n];
> for (int i = 0; i < 2*n; i+=1)
> for (int j = 0; j < n; j+=1)
> A[j*n + i] = ...
>
>
> Delinearization might convert the access to `A[j][i]` for an array of size `A[][n]`. However, in this example, elements accessed by the j-loop overlap into elements accessed by the (j+1)-loop. Assuming that A[j] and A[j+1] do not overlap ("assume-inrange") would be illegal, but from the source code's point-of-view, there is not even an inner array dimension that could be out-of-range. Since the loop bounds are derived heuristically, the user doesn't even know what indexes they agree to not overlap (it could also be `A[j/2][n*(j%2) + i]` for an array of size `A[][2*n]`).
I think A should be `float A[n*n+2*n]` for it to even be an in-bound access, but I see what the concern is now. That is a much more useful example I've seen for describing the issue. Thank you very much!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73998/new/
https://reviews.llvm.org/D73998
More information about the llvm-commits
mailing list