+45
−0
+207
−0
File added.
Preview size limit exceeded, changes collapsed.
Loading
This patch improves the addressing of temporaries created when needed for simple FORALL or WHERE as below to not introduce iteration dependencies. ``` subroutine foo(p1, p2, mask) real, pointer :: p1(:), p2(:) logical :: mask(:) where (mask) p1 = p2 end subroutine ``` Instead of using a stack like temporary that uses a counter to push and fetch elements, the loop IVs are directly used to address the temporaries. This makes it easier to later vectorize or parallelize those loops. This is only done when: - This is not a FORALL with array expressions - The dynamic type is the same at each iterations - The WHERE and FORALL do not create loops of depth more than 15. - If there are FORALLs, their strides are constants 1 or -1. Note that only the addressing is impacted, the stack-like approach already allocated a temporary big enough for all the iterations regardless of the masking. So the temporary size will remain the same. Assisted by: Claude
File added.
Preview size limit exceeded, changes collapsed.