Hi Mikael, hi all, Mikael Morin:
This starts a series of patches (funded by STF) to refactor initialisation and updates of array descriptors.
First: Good to see progress in that area – and great that the Sovereign Tech Fund fund this kind of work! And, of course, thanks for working on this! If I see this patch topic plus "simplify and improve scalarization" on the to-do list: If you touch algorithms, as surely required for the last last item, can you (or whoever does it) try to ensure that arrays are possibly passed as type 'array(size1,size2)' and 'array[i][j]' to the middle end? It has a harder time to optimize 'array + size1*i + j' compared to already see where the memory is adjacent. Originally, when gfortran was written, this was not supported by the ME – now it is, but gfortran does not use it. Sandra also has some patch that fell through the cracks that handles this: "Fortran: delinearize multi-dimensional array accesses" https://gcc.gnu.org/g:b547ec0621593cd893f80292908806d1e5e8c4ad for the commit (on the OG13 branch) and the old email at https://gcc.gnu.org/pipermail/fortran/2020-December/055438.html Maybe this helps when implementing it. In any case, if we do things from scratch, it would be good to handle it. * * * Another remark regarding scalarization: OpenMP 6 supports: !$omp workdistribute a(:) = 0 b(:) = 0 !$omp end workdistribute !$omp workdistribute c(:) = 0 !$omp end workdistribute !$omp workdistribute call my_pure_elemental_sub(a) !$omp end workdistribute the compile should see that the 'C' can be done as part of the a/b work and all in parallel, except that the call depends on the assignment to 'a'. With 'target workshare', the compiler could additionally see that merging the targets unconditionally into a single 'target' would work - but the 'a'/call dependency of course stays. I have currently no idea how this relates to the scalarizer changes in practice, but I want to mention it – just in case; maybe some implementation decision will become differently knowing about this. * * * Thanks for working on this! I will try to have a look on the patch set.* Tobias [* It will take a while; I still need to look at two patches by Sandra for OpenMP and one by Kwok; Yuao has a simple Fortran patch pending - and two pending 'sinpi'-related patches; I guess eventually someone has to look as Matthew's OpenMP patches - if not Jakub, I guess, it's me. - And more patches tend to pop up. - And, obviously, I need to do more than just reviewing patches. I wonder how esp. Richi manages to be that efficient with patch reviews!]
