Closed thomasrolinger closed 2 years ago
Addressed this. The tricky part was handling the checks for i
in B[i]
to be yielded by the loop iterator. That only matters for the closest for-loop in the nest. We had to add a flag argument to isLoopDomainValidIE
to indicate whether we are processing the "first" loop or not. When we process the first loop, we do the checks as usual. Any other loop after that in the nest will skip the check.
New tests added and appear to be working: ie_test_nestedForLoops.chpl
and ie_test_nestedForLoops_invalid.chpl
.
Right now, we detect during normalization if
A[B[i]]
is within a loop that is within theforall
. We do some correctness checks regarding that loop's domain. But we don't check to see if there is yet another outer loop within theforall
, something like:So we need to apply our checks recursively to each nested loop. We can use the same requirements for each loop, which is that it must iterate over
B
's domain. But we can relax the other conditions, which is thati
must be yielded by its iterator. That only applies to the "closest" loop to theA[B[i]]
access.