[flang-commits] [flang] [Flang] Hoist concurrent-limit and concurrent-step expressions outsid… (PR #111665)
via flang-commits
flang-commits at lists.llvm.org
Thu Oct 17 04:53:13 PDT 2024
https://github.com/jeanPerier requested changes to this pull request.
I agree with @vdonaldson comments. The patch is trying to solve two different problems at once.
The first one, evaluating all the concurrent limit and steps of a single do concurrent constructs before the related fir.do_loop, I agree makes sense to do in lowering because that is what the language requires. Thanks for working on that.
The second one is a general loop hoisting optimization that cannot be done in general, a FIR/MLIR pass will be needed for that. The main thing FIR operation need to use MLIR code motion utilities is the speculability trait (which obviously cannot blindly be added on all operations).
To solve this, you probably do not even need to add a lot of contexts/new argument, you can likely just solve it internally in genFIRIncrementLoopBegin by either keeping an insertion point before the fir.loops and generating the loop bounds SSA value there like you did, or do a first iteration to generate all these value and keep them in some vectors for later use in the iteration loop that generate the fir.do_loop.
https://github.com/llvm/llvm-project/pull/111665
More information about the flang-commits
mailing list