[flang-commits] [flang] [RFC][flang] Add support for assumed-shape dummy arrays repacking. (PR #127147)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Wed Feb 19 03:41:22 PST 2025
https://github.com/tblah commented:
Thanks for all of your work so far on this proposal. I like the design and think it will be a lot easier to extend than the existing loop versioning pass.
You raise a very interesting point with the visibility of side effects to array variables accessed via multiple threads. I agree making this change could change the result of such programs, but I wonder if the ordering of the visibility of different array accesses between threads can be depended on by conformant programs in the absence of memory barriers, ASYNCHRONOUS, or VOLATILE. You are right that we cannot know inside of a function whether threading is enabled, but if the visibility of memory accesses is only guaranteed by barriers, we can inspect and see whether any memory barriers are present inside of this function (doing this might need new dialect interfaces).
Other than shared variables, another possibility in openmp is that array variables are privatized. Then a copy is made of the source variable already. This is another case to be considered in the optimization passes you mentioned.
https://github.com/llvm/llvm-project/pull/127147
More information about the flang-commits
mailing list