Fix nested access with nested symbol dependency #1239
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the Python frontend, when accessing an array from a higher-level scope, we try to "squeeze" the access to begin from index 0 while propagating the correct offset to the edge connecting the outer data to the nested scope (NestedSDFG). To achieve this, any access utilizing a symbol
k
that is local to the nested scope with an access methodf(k)
is altered tof(k) - f(min(range(k))
so that it starts from index 0, while the offsetf(min(range(k))
is propagated to the outer edge.However, issues arise when the symbol
k
range depends on other symbols local to the nested scope. In those cases, the symbols have to be altered/replaced recursively so that no local symbol remains in the offset; otherwise, it is impossible to propagate it to the outer edge, which then starts from index 0, leading to erroneous accesses in the nested scope.This PR solves the above issue by simply skipping the elaborate and strict squeezing of the local-symbol-dependent sub-ranges when meeting such cases.