[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)
Tom Eccles via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Sep 10 03:26:44 PDT 2024
tblah wrote:
> @kiranchandramohan @tblah @skatrak I have a question to people more familiar with Fortran and the Flang pipeline - is it possible that we would have CFG (multiple blocks) in the IR generated in the `omp.workshare` region at this point in the pipeline (immediately after lowering HLFIR to FIR)?
>
> The transformation I implemented here can work with CFG but the transformation _inlines_ the region contained in the `omp.workshare` region in its parent op (while transforming it), which means that the parent op would need to support multiple blocks, which is not a given (e.g. `fir.if`). Is there an operation like `scf.execute` which can be used here to inline the contents of the `omp.workshare` or should we not support CFG in this transformation.
Yes we could have multiple blocks in cases where the control flow is not representable using our structured control flow operations. For example using CYCLE, EXIT or STOP statements.
I think as a first pass it would be better not to support CFG, because this has been a frequent source of bugs in OpenMP lowering and will need to be tested carefully.
I think the operation you are looking for might be `scf.execute_region`.
https://github.com/llvm/llvm-project/pull/101446
More information about the llvm-branch-commits
mailing list